summaryrefslogtreecommitdiff
path: root/firmware/target/arm/olympus
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/arm/olympus
parent05e180a1308a095d51d51d0e047fcd44425ea88f (diff)
downloadrockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz
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/arm/olympus')
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
index 036b6ae71c..d1e1c82c95 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
@@ -67,7 +67,7 @@ unsigned char rc_buf[5];
67/* Remote thread functions */ 67/* Remote thread functions */
68/* These functions are private to the remote thread */ 68/* These functions are private to the remote thread */
69/* ================================================== */ 69/* ================================================== */
70static struct wakeup rc_thread_wakeup; 70static struct semaphore rc_thread_wakeup;
71static unsigned int remote_thread_id; 71static unsigned int remote_thread_id;
72static int remote_stack[256/sizeof(int)]; 72static int remote_stack[256/sizeof(int)];
73static const char * const remote_thread_name = "remote"; 73static const char * const remote_thread_name = "remote";
@@ -368,7 +368,7 @@ static void remote_thread(void)
368 368
369 while (1) 369 while (1)
370 { 370 {
371 wakeup_wait(&rc_thread_wakeup, rc_thread_wait_timeout); 371 semaphore_wait(&rc_thread_wakeup, rc_thread_wait_timeout);
372 372
373 /* Error handling (most likely due to remote not present) */ 373 /* Error handling (most likely due to remote not present) */
374 if (rc_status & RC_ERROR_MASK) 374 if (rc_status & RC_ERROR_MASK)
@@ -500,7 +500,7 @@ void lcd_remote_off(void)
500{ 500{
501 /* should only be used to power off at shutdown */ 501 /* should only be used to power off at shutdown */
502 rc_status |= RC_POWER_OFF; 502 rc_status |= RC_POWER_OFF;
503 wakeup_signal(&rc_thread_wakeup); 503 semaphore_release(&rc_thread_wakeup);
504 504
505 /* wait until the things are powered off */ 505 /* wait until the things are powered off */
506 while (rc_status & RC_DEV_INIT) 506 while (rc_status & RC_DEV_INIT)
@@ -515,7 +515,7 @@ void lcd_remote_on(void)
515 { 515 {
516 rc_status &= ~RC_FORCE_DETECT; 516 rc_status &= ~RC_FORCE_DETECT;
517 rc_status &= ~RC_POWER_OFF; 517 rc_status &= ~RC_POWER_OFF;
518 wakeup_signal(&rc_thread_wakeup); 518 semaphore_release(&rc_thread_wakeup);
519 } 519 }
520} 520}
521 521
@@ -536,7 +536,7 @@ void lcd_remote_init_device(void)
536 GPIO_SET_BITWISE(GPIOL_OUTPUT_EN, 0x80); 536 GPIO_SET_BITWISE(GPIOL_OUTPUT_EN, 0x80);
537 537
538 /* a thread is required to poll & update the remote */ 538 /* a thread is required to poll & update the remote */
539 wakeup_init(&rc_thread_wakeup); 539 semaphore_init(&rc_thread_wakeup, 1, 0);
540 remote_thread_id = create_thread(remote_thread, remote_stack, 540 remote_thread_id = create_thread(remote_thread, remote_stack,
541 sizeof(remote_stack), 0, remote_thread_name 541 sizeof(remote_stack), 0, remote_thread_name
542 IF_PRIO(, PRIORITY_SYSTEM) 542 IF_PRIO(, PRIORITY_SYSTEM)