summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/onda_vx747
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
commit12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch)
treefc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/target/mips/ingenic_jz47xx/onda_vx747
parent05e180a1308a095d51d51d0e047fcd44425ea88f (diff)
downloadrockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz
rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.bz2
rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip
Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
index 92cf0d7552..99d73fa3c7 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
@@ -74,7 +74,7 @@ static int datacount = 0;
static volatile int cur_touch = 0;
static volatile bool pen_down = false;
static struct mutex battery_mtx;
-static struct wakeup battery_wkup;
+static struct semaphore battery_done;
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
@@ -113,7 +113,7 @@ unsigned int battery_adc_voltage(void)
REG_SADC_ENA |= SADC_ENA_PBATEN;
- wakeup_wait(&battery_wkup, HZ/4);
+ semaphore_wait(&battery_done, HZ/4);
bat_val = REG_SADC_BATDAT;
logf("%d %d", bat_val, (bat_val * BATTERY_SCALE_FACTOR) / 4096);
@@ -268,7 +268,7 @@ void SADC(void)
if(state & SADC_CTRL_PBATRDYM)
{
/* Battery AD IRQ */
- wakeup_signal(&battery_wkup);
+ semaphore_release(&battery_done);
}
}
@@ -290,7 +290,7 @@ void adc_init(void)
REG_SADC_ENA = SADC_ENA_TSEN;
mutex_init(&battery_mtx);
- wakeup_init(&battery_wkup);
+ semaphore_init(&battery_done, 1, 0);
}
void adc_close(void)