summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c
index 0f8cb67a9d..6e76615308 100644
--- a/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/headphone-gigabeat-s.c
@@ -29,7 +29,7 @@
29#include "adc.h" 29#include "adc.h"
30#include "button.h" 30#include "button.h"
31 31
32static struct wakeup headphone_wakeup; 32static struct semaphore headphone_wakeup;
33static unsigned int headphone_thread_id; 33static unsigned int headphone_thread_id;
34static int headphone_stack[200/sizeof(int)]; /* Not much stack needed */ 34static int headphone_stack[200/sizeof(int)]; /* Not much stack needed */
35static const char * const headphone_thread_name = "headphone"; 35static const char * const headphone_thread_name = "headphone";
@@ -115,7 +115,7 @@ static void headphone_thread(void)
115 115
116 while (1) 116 while (1)
117 { 117 {
118 int rc = wakeup_wait(&headphone_wakeup, headphone_wait_timeout); 118 int rc = semaphore_wait(&headphone_wakeup, headphone_wait_timeout);
119 unsigned int data = adc_read(ADC_HPREMOTE); 119 unsigned int data = adc_read(ADC_HPREMOTE);
120 120
121 if (rc == OBJ_WAIT_TIMEDOUT) 121 if (rc == OBJ_WAIT_TIMEDOUT)
@@ -175,7 +175,7 @@ static void headphone_thread(void)
175void headphone_detect_event(void) 175void headphone_detect_event(void)
176{ 176{
177 /* Trigger the thread immediately. */ 177 /* Trigger the thread immediately. */
178 wakeup_signal(&headphone_wakeup); 178 semaphore_release(&headphone_wakeup);
179} 179}
180 180
181/* Tell if anything is in the jack. */ 181/* Tell if anything is in the jack. */
@@ -187,7 +187,7 @@ bool headphones_inserted(void)
187void INIT_ATTR headphone_init(void) 187void INIT_ATTR headphone_init(void)
188{ 188{
189 /* A thread is required to monitor the remote ADC and jack state. */ 189 /* A thread is required to monitor the remote ADC and jack state. */
190 wakeup_init(&headphone_wakeup); 190 semaphore_init(&headphone_wakeup, 1, 0);
191 headphone_thread_id = create_thread(headphone_thread, 191 headphone_thread_id = create_thread(headphone_thread,
192 headphone_stack, 192 headphone_stack,
193 sizeof(headphone_stack), 193 sizeof(headphone_stack),