diff --git a/firmware/backlight.c b/firmware/backlight.c index 72042b748a..32a222929b 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -30,7 +30,8 @@ #define BACKLIGHT_OFF 2 static void backlight_thread(void); -static char backlight_stack[0x400]; +static char backlight_stack[DEFAULT_STACK_SIZE]; +static char backlight_thread_name[] = "backlight"; static struct event_queue backlight_queue; static int backlight_timer; @@ -111,6 +112,7 @@ void backlight_init(void) rtc_write(0x0a, 0x40); /* Enable square wave */ #endif queue_init(&backlight_queue); - create_thread(backlight_thread, backlight_stack, sizeof(backlight_stack)); + create_thread(backlight_thread, backlight_stack, + sizeof(backlight_stack), backlight_thread_name); backlight_on(); } diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index d8a097214a..e85d79f038 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c @@ -112,7 +112,8 @@ struct scrollinfo { }; static void scroll_thread(void); -static char scroll_stack[0x800]; +static char scroll_stack[DEFAULT_STACK_SIZE]; +static char scroll_name[] = "scroll"; static char scroll_speed = 8; /* updates per second */ static char scroll_spacing = 3; /* spaces between end and start of text */ @@ -381,7 +382,8 @@ void lcd_double_height(bool on) #if defined(HAVE_LCD_CHARCELLS) || defined(SIMULATOR) /* not BITMAP */ void lcd_init (void) { - create_thread(scroll_thread, scroll_stack, sizeof(scroll_stack)); + create_thread(scroll_thread, scroll_stack, + sizeof(scroll_stack), scroll_name); } #endif @@ -439,7 +441,8 @@ void lcd_init (void) lcd_clear_display(); lcd_update(); - create_thread(scroll_thread, scroll_stack, sizeof(scroll_stack)); + create_thread(scroll_thread, scroll_stack, + sizeof(scroll_stack), scroll_name); } /* diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 4d6113176b..85e7ccc4fe 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -33,7 +33,6 @@ #include "file.h" #endif -#define MPEG_STACK_SIZE 0x2000 #define MPEG_CHUNKSIZE 0x20000 #define MPEG_LOW_WATER 0x30000 @@ -260,7 +259,8 @@ static unsigned char fliptable[] = static unsigned short big_fliptable[65536]; static struct event_queue mpeg_queue; -static int mpeg_stack[MPEG_STACK_SIZE/sizeof(int)]; +static char mpeg_stack[DEFAULT_STACK_SIZE + 0x1000]; +static char mpeg_thread_name[] = "mpeg"; /* defined in linker script */ extern unsigned char mp3buf[]; @@ -984,7 +984,8 @@ void mpeg_init(int volume, int bass, int treble) create_fliptable(); queue_init(&mpeg_queue); - create_thread(mpeg_thread, mpeg_stack, sizeof(mpeg_stack)); + create_thread(mpeg_thread, mpeg_stack, + sizeof(mpeg_stack), mpeg_thread_name); mas_poll_start(2); #ifndef ARCHOS_RECORDER diff --git a/firmware/usb.c b/firmware/usb.c index 3732d83df6..d7112b971f 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -59,7 +59,8 @@ static int countdown; static int usb_state; -static char usb_stack[0x800]; +static char usb_stack[DEFAULT_STACK_SIZE]; +static char usb_thread_name[] = "usb"; static struct event_queue usb_queue; static bool last_usb_status; static bool usb_monitor_enabled; @@ -269,7 +270,7 @@ void usb_init(void) last_usb_status = false; queue_init(&usb_queue); - create_thread(usb_thread, usb_stack, sizeof(usb_stack)); + create_thread(usb_thread, usb_stack, sizeof(usb_stack), usb_thread_name); tick_add_task(usb_tick); }