summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-12-19 16:50:07 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-12-19 16:50:07 +0000
commit4b902679cc5fcca7f4e8d83b25112754f7903736 (patch)
tree7853f7d80a4254f521107c2c6e7191d3a1e1974e /firmware
parentd152b6492a2371c261c195494864c3744609cf3c (diff)
downloadrockbox-4b902679cc5fcca7f4e8d83b25112754f7903736.tar.gz
rockbox-4b902679cc5fcca7f4e8d83b25112754f7903736.zip
Convert queues to use intptr_t for event data and return values as most of the time pointer are not passed and it should make some things a bit cleaner.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11818 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight.c14
-rw-r--r--firmware/drivers/ata.c2
-rw-r--r--firmware/drivers/button.c20
-rw-r--r--firmware/export/kernel.h15
-rw-r--r--firmware/kernel.c21
-rw-r--r--firmware/mpeg.c32
-rw-r--r--firmware/pcm_record.c24
-rw-r--r--firmware/powermgmt.c6
-rw-r--r--firmware/target/arm/ipod/3g/button-3g.c2
-rw-r--r--firmware/target/arm/ipod/button-clickwheel.c2
-rw-r--r--firmware/target/arm/ipod/button-mini1g.c2
-rw-r--r--firmware/usb.c12
12 files changed, 77 insertions, 75 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index b794f23056..a2d35302eb 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -213,7 +213,7 @@ static void backlight_isr(void)
if (idle)
{
#ifdef CPU_COLDFIRE
- queue_post(&backlight_queue, BACKLIGHT_UNBOOST_CPU, NULL);
+ queue_post(&backlight_queue, BACKLIGHT_UNBOOST_CPU, 0);
#endif
timer_unregister();
bl_timer_active = false;
@@ -530,7 +530,7 @@ static void backlight_tick(void)
if(lcd_sleep_timer == 0)
{
/* Queue on bl thread or freeze! */
- queue_post(&backlight_queue, LCD_SLEEP, NULL);
+ queue_post(&backlight_queue, LCD_SLEEP, 0);
}
}
#endif /* HAVE_LCD_SLEEP */
@@ -579,7 +579,7 @@ void x5_backlight_shutdown(void)
queue_empty(&backlight_queue);
tick_remove_task(backlight_tick);
/* Next time the thread runs, if at all, it will just remove itself. */
- queue_post(&backlight_queue, BACKLIGHT_QUIT, NULL);
+ queue_post(&backlight_queue, BACKLIGHT_QUIT, 0);
__backlight_on();
}
#endif /* X5_BACKLIGHT_SHUTDOWN */
@@ -587,12 +587,12 @@ void x5_backlight_shutdown(void)
void backlight_on(void)
{
queue_remove_from_head(&backlight_queue, BACKLIGHT_ON);
- queue_post(&backlight_queue, BACKLIGHT_ON, NULL);
+ queue_post(&backlight_queue, BACKLIGHT_ON, 0);
}
void backlight_off(void)
{
- queue_post(&backlight_queue, BACKLIGHT_OFF, NULL);
+ queue_post(&backlight_queue, BACKLIGHT_OFF, 0);
}
/* returns true when the backlight is on OR when it's set to always off */
@@ -692,12 +692,12 @@ void lcd_set_sleep_after_backlight_off(int index)
#ifdef HAVE_REMOTE_LCD
void remote_backlight_on(void)
{
- queue_post(&backlight_queue, REMOTE_BACKLIGHT_ON, NULL);
+ queue_post(&backlight_queue, REMOTE_BACKLIGHT_ON, 0);
}
void remote_backlight_off(void)
{
- queue_post(&backlight_queue, REMOTE_BACKLIGHT_OFF, NULL);
+ queue_post(&backlight_queue, REMOTE_BACKLIGHT_OFF, 0);
}
void remote_backlight_set_timeout(int index)
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 800bd1a31a..8c591253f9 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -571,7 +571,7 @@ static int ata_perform_sleep(void)
void ata_sleep(void)
{
- queue_post(&ata_queue, Q_SLEEP, NULL);
+ queue_post(&ata_queue, Q_SLEEP, 0);
}
void ata_sleepnow(void)
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index deaf7f2fdd..cab62f950c 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -85,7 +85,7 @@ static void button_tick(void)
btn = remote_control_rx();
if(btn)
{
- queue_post(&button_queue, btn, NULL);
+ queue_post(&button_queue, btn, 0);
}
#endif
@@ -94,13 +94,13 @@ static void button_tick(void)
{
if (! phones_present )
{
- queue_post(&button_queue, SYS_PHONE_PLUGGED, NULL);
+ queue_post(&button_queue, SYS_PHONE_PLUGGED, 0);
phones_present = true;
}
} else {
if ( phones_present )
{
- queue_post(&button_queue, SYS_PHONE_UNPLUGGED, NULL);
+ queue_post(&button_queue, SYS_PHONE_UNPLUGGED, 0);
phones_present = false;
}
}
@@ -116,17 +116,17 @@ static void button_tick(void)
#ifdef HAVE_REMOTE_LCD
if(diff & BUTTON_REMOTE)
if(!skip_remote_release)
- queue_post(&button_queue, BUTTON_REL | diff, NULL);
+ queue_post(&button_queue, BUTTON_REL | diff, 0);
else
skip_remote_release = false;
else
#endif
if(!skip_release)
- queue_post(&button_queue, BUTTON_REL | diff, NULL);
+ queue_post(&button_queue, BUTTON_REL | diff, 0);
else
skip_release = false;
#else
- queue_post(&button_queue, BUTTON_REL | diff, NULL);
+ queue_post(&button_queue, BUTTON_REL | diff, 0);
#endif
}
else
@@ -201,7 +201,7 @@ static void button_tick(void)
* to avoid afterscroll effects. */
if (queue_empty(&button_queue))
{
- queue_post(&button_queue, BUTTON_REPEAT | btn, NULL);
+ queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
#ifdef CONFIG_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
skip_remote_release = false;
@@ -221,18 +221,18 @@ static void button_tick(void)
|| (remote_type()==REMOTETYPE_H300_NONLCD)
#endif
)
- queue_post(&button_queue, btn, NULL);
+ queue_post(&button_queue, btn, 0);
else
skip_remote_release = true;
}
else
#endif
if (!filter_first_keypress || is_backlight_on())
- queue_post(&button_queue, btn, NULL);
+ queue_post(&button_queue, btn, 0);
else
skip_release = true;
#else /* no backlight, nothing to skip */
- queue_post(&button_queue, btn, NULL);
+ queue_post(&button_queue, btn, 0);
#endif
post = false;
}
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 23ffc3c06a..ec8aa28a08 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -20,6 +20,7 @@
#define _KERNEL_H_
#include <stdbool.h>
+#include <inttypes.h>
#include "config.h"
/* wrap-safe macros for tick comparison */
@@ -51,15 +52,15 @@
struct event
{
- long id;
- void *data;
+ long id;
+ intptr_t data;
};
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
struct queue_sender
{
struct thread_entry *thread;
- void *retval;
+ intptr_t retval;
};
struct queue_sender_list
@@ -112,17 +113,17 @@ extern void queue_init(struct event_queue *q, bool register_queue);
extern void queue_delete(struct event_queue *q);
extern void queue_wait(struct event_queue *q, struct event *ev);
extern void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks);
-extern void queue_post(struct event_queue *q, long id, void *data);
+extern void queue_post(struct event_queue *q, long id, intptr_t data);
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
extern void queue_enable_queue_send(struct event_queue *q, struct queue_sender_list *send);
-extern void * queue_send(struct event_queue *q, long id, void *data);
-extern void queue_reply(struct event_queue *q, void *retval);
+extern intptr_t queue_send(struct event_queue *q, long id, intptr_t data);
+extern void queue_reply(struct event_queue *q, intptr_t retval);
extern bool queue_in_queue_send(struct event_queue *q);
#endif /* HAVE_EXTENDED_MESSAGING_AND_NAME */
extern bool queue_empty(const struct event_queue* q);
extern void queue_clear(struct event_queue* q);
extern void queue_remove_from_head(struct event_queue *q, long id);
-extern int queue_broadcast(long id, void *data);
+extern int queue_broadcast(long id, intptr_t data);
extern void mutex_init(struct mutex *m);
extern void mutex_lock(struct mutex *m);
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 55d78e0e0b..01adfcc57d 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -107,7 +107,8 @@ static void queue_fetch_sender(struct queue_sender_list *send,
/* Puts the specified return value in the waiting thread's return value
and wakes the thread - a sender should be confirmed to exist first */
-static void queue_release_sender(struct queue_sender **sender, void *retval)
+static void queue_release_sender(struct queue_sender **sender,
+ intptr_t retval)
{
(*sender)->retval = retval;
wakeup_thread(&(*sender)->thread);
@@ -127,7 +128,7 @@ static void queue_release_all_senders(struct event_queue *q)
&q->send->senders[i & QUEUE_LENGTH_MASK];
if(*spp)
{
- queue_release_sender(spp, NULL);
+ queue_release_sender(spp, 0);
}
}
}
@@ -242,7 +243,7 @@ void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks)
}
}
-void queue_post(struct event_queue *q, long id, void *data)
+void queue_post(struct event_queue *q, long id, intptr_t data)
{
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
unsigned int wr = q->write++ & QUEUE_LENGTH_MASK;
@@ -258,7 +259,7 @@ void queue_post(struct event_queue *q, long id, void *data)
if(*spp)
{
/* overflow protect - unblock any thread waiting at this index */
- queue_release_sender(spp, NULL);
+ queue_release_sender(spp, 0);
}
}
#endif
@@ -268,7 +269,7 @@ void queue_post(struct event_queue *q, long id, void *data)
}
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
-void * queue_send(struct event_queue *q, long id, void *data)
+intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
{
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
unsigned int wr = q->write++ & QUEUE_LENGTH_MASK;
@@ -284,7 +285,7 @@ void * queue_send(struct event_queue *q, long id, void *data)
if(*spp)
{
/* overflow protect - unblock any thread waiting at this index */
- queue_release_sender(spp, NULL);
+ queue_release_sender(spp, 0);
}
*spp = &sender;
@@ -298,7 +299,7 @@ void * queue_send(struct event_queue *q, long id, void *data)
/* Function as queue_post if sending is not enabled */
wakeup_thread(&q->thread);
set_irq_level(oldlevel);
- return NULL;
+ return 0;
}
#if 0 /* not used now but probably will be later */
@@ -310,7 +311,7 @@ bool queue_in_queue_send(struct event_queue *q)
#endif
/* Replies with retval to any dequeued message sent with queue_send */
-void queue_reply(struct event_queue *q, void *retval)
+void queue_reply(struct event_queue *q, intptr_t retval)
{
if(q->send && q->send->curr_sender)
{
@@ -360,7 +361,7 @@ void queue_remove_from_head(struct event_queue *q, long id)
if(*spp)
{
/* Release any thread waiting on this message */
- queue_release_sender(spp, NULL);
+ queue_release_sender(spp, 0);
}
}
#endif
@@ -370,7 +371,7 @@ void queue_remove_from_head(struct event_queue *q, long id)
set_irq_level(oldlevel);
}
-int queue_broadcast(long id, void *data)
+int queue_broadcast(long id, intptr_t data)
{
int i;
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index c9f48f2d97..d3e508a159 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -89,7 +89,7 @@ extern int playlist_update_resume_info(const struct mp3entry* id3);
#define MPEG_PRERECORDING_TICK 104
/* indicator for MPEG_NEED_DATA */
-#define GENERATE_UNBUFFER_EVENTS ((void*)1)
+#define GENERATE_UNBUFFER_EVENTS 1
/* list of tracks in memory */
#define MAX_TRACK_ENTRIES (1<<4) /* Must be power of 2 */
@@ -2006,7 +2006,7 @@ static void mpeg_thread(void)
break;
case STOP_RECORDING:
- queue_post(&mpeg_queue, MPEG_STOP_DONE, NULL);
+ queue_post(&mpeg_queue, MPEG_STOP_DONE, 0);
/* will close the file */
break;
@@ -2123,7 +2123,7 @@ bool audio_has_changed_track(void)
void audio_init_playback(void)
{
init_playback_done = false;
- queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, NULL);
+ queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, 0);
while(!init_playback_done)
sleep_thread(1);
@@ -2137,7 +2137,7 @@ void audio_init_recording(unsigned int buffer_offset)
{
buffer_offset = buffer_offset;
init_recording_done = false;
- queue_post(&mpeg_queue, MPEG_INIT_RECORDING, NULL);
+ queue_post(&mpeg_queue, MPEG_INIT_RECORDING, 0);
while(!init_recording_done)
sleep_thread(1);
@@ -2256,17 +2256,17 @@ void audio_record(const char *filename)
strncpy(recording_filename, filename, MAX_PATH - 1);
recording_filename[MAX_PATH - 1] = 0;
- queue_post(&mpeg_queue, MPEG_RECORD, NULL);
+ queue_post(&mpeg_queue, MPEG_RECORD, 0);
}
void audio_pause_recording(void)
{
- queue_post(&mpeg_queue, MPEG_PAUSE_RECORDING, NULL);
+ queue_post(&mpeg_queue, MPEG_PAUSE_RECORDING, 0);
}
void audio_resume_recording(void)
{
- queue_post(&mpeg_queue, MPEG_RESUME_RECORDING, NULL);
+ queue_post(&mpeg_queue, MPEG_RESUME_RECORDING, 0);
}
static void prepend_header(void)
@@ -2569,7 +2569,7 @@ void audio_new_file(const char *filename)
strncpy(recording_filename, filename, MAX_PATH - 1);
recording_filename[MAX_PATH - 1] = 0;
- queue_post(&mpeg_queue, MPEG_NEW_FILE, NULL);
+ queue_post(&mpeg_queue, MPEG_NEW_FILE, 0);
}
unsigned long audio_recorded_time(void)
@@ -2707,7 +2707,7 @@ void audio_play(long offset)
#else /* !SIMULATOR */
is_playing = true;
- queue_post(&mpeg_queue, MPEG_PLAY, (void*)offset);
+ queue_post(&mpeg_queue, MPEG_PLAY, offset);
#endif /* !SIMULATOR */
mpeg_errno = 0;
@@ -2717,7 +2717,7 @@ void audio_stop(void)
{
#ifndef SIMULATOR
mpeg_stop_done = false;
- queue_post(&mpeg_queue, MPEG_STOP, NULL);
+ queue_post(&mpeg_queue, MPEG_STOP, 0);
while(!mpeg_stop_done)
yield();
#else /* SIMULATOR */
@@ -2736,7 +2736,7 @@ void audio_stop_recording(void)
void audio_pause(void)
{
#ifndef SIMULATOR
- queue_post(&mpeg_queue, MPEG_PAUSE, NULL);
+ queue_post(&mpeg_queue, MPEG_PAUSE, 0);
#else /* SIMULATOR */
is_playing = true;
playing = false;
@@ -2747,7 +2747,7 @@ void audio_pause(void)
void audio_resume(void)
{
#ifndef SIMULATOR
- queue_post(&mpeg_queue, MPEG_RESUME, NULL);
+ queue_post(&mpeg_queue, MPEG_RESUME, 0);
#else /* SIMULATOR */
is_playing = true;
playing = true;
@@ -2759,7 +2759,7 @@ void audio_next(void)
{
#ifndef SIMULATOR
queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA);
- queue_post(&mpeg_queue, MPEG_NEXT, NULL);
+ queue_post(&mpeg_queue, MPEG_NEXT, 0);
#else /* SIMULATOR */
char* file;
int steps = 1;
@@ -2788,7 +2788,7 @@ void audio_prev(void)
{
#ifndef SIMULATOR
queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA);
- queue_post(&mpeg_queue, MPEG_PREV, NULL);
+ queue_post(&mpeg_queue, MPEG_PREV, 0);
#else /* SIMULATOR */
char* file;
int steps = -1;
@@ -2815,7 +2815,7 @@ void audio_prev(void)
void audio_ff_rewind(long newtime)
{
#ifndef SIMULATOR
- queue_post(&mpeg_queue, MPEG_FF_REWIND, (void *)newtime);
+ queue_post(&mpeg_queue, MPEG_FF_REWIND, newtime);
#else /* SIMULATOR */
(void)newtime;
#endif /* SIMULATOR */
@@ -2824,7 +2824,7 @@ void audio_ff_rewind(long newtime)
void audio_flush_and_reload_tracks(void)
{
#ifndef SIMULATOR
- queue_post(&mpeg_queue, MPEG_FLUSH_RELOAD, NULL);
+ queue_post(&mpeg_queue, MPEG_FLUSH_RELOAD, 0);
#endif /* !SIMULATOR*/
}
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index f03939bd3c..b826763370 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -249,7 +249,7 @@ static int pcm_rec_have_more(int status)
if (status == DMA_REC_ERROR_DMA)
{
/* Flush recorded data to disk and stop recording */
- queue_post(&pcmrec_queue, PCMREC_STOP, NULL);
+ queue_post(&pcmrec_queue, PCMREC_STOP, 0);
return -1;
}
/* else try again next transmission */
@@ -388,7 +388,7 @@ void pcm_rec_init(void)
void audio_init_recording(unsigned int buffer_offset)
{
logf("audio_init_recording");
- queue_send(&pcmrec_queue, PCMREC_INIT, NULL);
+ queue_send(&pcmrec_queue, PCMREC_INIT, 0);
logf("audio_init_recording done");
(void)buffer_offset;
} /* audio_init_recording */
@@ -399,7 +399,7 @@ void audio_init_recording(unsigned int buffer_offset)
void audio_close_recording(void)
{
logf("audio_close_recording");
- queue_send(&pcmrec_queue, PCMREC_CLOSE, NULL);
+ queue_send(&pcmrec_queue, PCMREC_CLOSE, 0);
logf("audio_close_recording done");
} /* audio_close_recording */
@@ -409,7 +409,7 @@ void audio_close_recording(void)
void audio_set_recording_options(struct audio_recording_options *options)
{
logf("audio_set_recording_options");
- queue_send(&pcmrec_queue, PCMREC_OPTIONS, (void *)options);
+ queue_send(&pcmrec_queue, PCMREC_OPTIONS, (intptr_t)options);
logf("audio_set_recording_options done");
} /* audio_set_recording_options */
@@ -419,7 +419,7 @@ void audio_set_recording_options(struct audio_recording_options *options)
void audio_record(const char *filename)
{
logf("audio_record: %s", filename);
- queue_send(&pcmrec_queue, PCMREC_RECORD, (void *)filename);
+ queue_send(&pcmrec_queue, PCMREC_RECORD, (intptr_t)filename);
logf("audio_record_done");
} /* audio_record */
@@ -429,7 +429,7 @@ void audio_record(const char *filename)
void audio_stop_recording(void)
{
logf("audio_stop_recording");
- queue_send(&pcmrec_queue, PCMREC_STOP, NULL);
+ queue_send(&pcmrec_queue, PCMREC_STOP, 0);
logf("audio_stop_recording done");
} /* audio_stop_recording */
@@ -439,7 +439,7 @@ void audio_stop_recording(void)
void audio_pause_recording(void)
{
logf("audio_pause_recording");
- queue_send(&pcmrec_queue, PCMREC_PAUSE, NULL);
+ queue_send(&pcmrec_queue, PCMREC_PAUSE, 0);
logf("audio_pause_recording done");
} /* audio_pause_recording */
@@ -449,7 +449,7 @@ void audio_pause_recording(void)
void audio_resume_recording(void)
{
logf("audio_resume_recording");
- queue_send(&pcmrec_queue, PCMREC_RESUME, NULL);
+ queue_send(&pcmrec_queue, PCMREC_RESUME, 0);
logf("audio_resume_recording done");
} /* audio_resume_recording */
@@ -1069,7 +1069,7 @@ static void pcmrec_new_stream(const char *filename, /* next file name */
flush will hang the screen for a bit otherwise */
strncpy(buf, filename, MAX_PATH);
filename = buf;
- queue_reply(&pcmrec_queue, NULL);
+ queue_reply(&pcmrec_queue, 0);
pcmrec_flush(-1);
}
@@ -1182,7 +1182,7 @@ static void pcmrec_set_recording_options(struct audio_recording_options *options
/* apply pcm settings to hardware */
pcm_apply_settings(true);
- queue_reply(&pcmrec_queue, NULL); /* Release sender */
+ queue_reply(&pcmrec_queue, 0); /* Release sender */
if (audio_load_encoder(enc_config.afmt))
{
@@ -1310,7 +1310,7 @@ static void pcmrec_stop(void)
}
dma_lock = true; /* lock dma write position */
- queue_reply(&pcmrec_queue, NULL);
+ queue_reply(&pcmrec_queue, 0);
/* flush all available data first to avoid overflow while waiting
for encoding to finish */
@@ -1470,7 +1470,7 @@ static void pcmrec_thread(void)
break;
} /* end switch */
- queue_reply(&pcmrec_queue, NULL);
+ queue_reply(&pcmrec_queue, 0);
} /* end while */
} /* pcmrec_thread */
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 90ac492fc8..6c7f96baad 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -784,7 +784,7 @@ static void power_thread_sleep(int ticks)
charger_input_state = CHARGER_PLUGGED;
return;
case CHARGER_PLUGGED:
- queue_broadcast(SYS_CHARGER_CONNECTED, NULL);
+ queue_broadcast(SYS_CHARGER_CONNECTED, 0);
charger_input_state = CHARGER;
break;
case CHARGER:
@@ -795,7 +795,7 @@ static void power_thread_sleep(int ticks)
case NO_CHARGER:
break;
case CHARGER_UNPLUGGED:
- queue_broadcast(SYS_CHARGER_DISCONNECTED, NULL);
+ queue_broadcast(SYS_CHARGER_DISCONNECTED, 0);
charger_input_state = NO_CHARGER;
break;
case CHARGER_PLUGGED:
@@ -1279,7 +1279,7 @@ void sys_poweroff(void)
shutdown_timeout += HZ*20;
}
- queue_post(&button_queue, SYS_POWEROFF, NULL);
+ queue_post(&button_queue, SYS_POWEROFF, 0);
}
void cancel_shutdown(void)
diff --git a/firmware/target/arm/ipod/3g/button-3g.c b/firmware/target/arm/ipod/3g/button-3g.c
index 25afd42095..e9b0c5e3b6 100644
--- a/firmware/target/arm/ipod/3g/button-3g.c
+++ b/firmware/target/arm/ipod/3g/button-3g.c
@@ -93,7 +93,7 @@ void handle_scroll_wheel(int new_scroll, int was_hold, int reverse)
}
}
if (wheel_keycode != BUTTON_NONE && queue_empty(&button_queue))
- queue_post(&button_queue, wheel_keycode, NULL);
+ queue_post(&button_queue, wheel_keycode, 0);
prev_scroll = new_scroll;
}
diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c
index 6cac037155..79107884c5 100644
--- a/firmware/target/arm/ipod/button-clickwheel.c
+++ b/firmware/target/arm/ipod/button-clickwheel.c
@@ -139,7 +139,7 @@ static inline int ipod_4g_button_read(void)
{
data = (wheel_delta << 16) | new_wheel_value;
queue_post(&button_queue, wheel_keycode | wheel_repeat,
- (void *)data);
+ data);
}
if (!wheel_repeat) wheel_repeat = BUTTON_REPEAT;
diff --git a/firmware/target/arm/ipod/button-mini1g.c b/firmware/target/arm/ipod/button-mini1g.c
index f979991141..4a9a9ee310 100644
--- a/firmware/target/arm/ipod/button-mini1g.c
+++ b/firmware/target/arm/ipod/button-mini1g.c
@@ -100,7 +100,7 @@ void handle_scroll_wheel(int new_scroll, int was_hold, int reverse)
}
}
if (wheel_keycode != BUTTON_NONE && queue_empty(&button_queue))
- queue_post(&button_queue, wheel_keycode, NULL);
+ queue_post(&button_queue, wheel_keycode, 0);
prev_scroll = new_scroll;
}
diff --git a/firmware/usb.c b/firmware/usb.c
index 5c800bde03..f585544024 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -235,7 +235,7 @@ static void usb_thread(void)
/* Tell all threads that they have to back off the ATA.
We subtract one for our own thread. */
num_acks_to_expect =
- queue_broadcast(SYS_USB_CONNECTED, NULL) - 1;
+ queue_broadcast(SYS_USB_CONNECTED, 0) - 1;
waiting_for_ack = true;
DEBUGF("USB inserted. Waiting for ack from %d threads...\n",
num_acks_to_expect);
@@ -290,7 +290,7 @@ static void usb_thread(void)
/* Tell all threads that we are back in business */
num_acks_to_expect =
- queue_broadcast(SYS_USB_DISCONNECTED, NULL) - 1;
+ queue_broadcast(SYS_USB_DISCONNECTED, 0) - 1;
waiting_for_ack = true;
DEBUGF("USB extracted. Waiting for ack from %d threads...\n",
num_acks_to_expect);
@@ -392,9 +392,9 @@ static void usb_tick(void)
if(countdown == 0)
{
if(current_status)
- queue_post(&usb_queue, USB_INSERTED, NULL);
+ queue_post(&usb_queue, USB_INSERTED, 0);
else
- queue_post(&usb_queue, USB_EXTRACTED, NULL);
+ queue_post(&usb_queue, USB_EXTRACTED, 0);
}
}
}
@@ -403,7 +403,7 @@ static void usb_tick(void)
{
usb_mmc_countdown--;
if (usb_mmc_countdown == 0)
- queue_post(&usb_queue, USB_REENABLE, NULL);
+ queue_post(&usb_queue, USB_REENABLE, 0);
}
#endif
}
@@ -411,7 +411,7 @@ static void usb_tick(void)
void usb_acknowledge(long id)
{
- queue_post(&usb_queue, id, NULL);
+ queue_post(&usb_queue, id, 0);
}
void usb_init(void)