Fix visualizer crash at startup

Visualizer and serial link initialized in the wrong order.
The LED_ENABLED define wasn't set properly
uGfx is always initialized
This commit is contained in:
Fred Sundvik 2016-07-07 14:01:20 +03:00
parent 07d0d5cbe4
commit 7229751ba9
3 changed files with 5 additions and 6 deletions

View File

@ -456,9 +456,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
} }
void visualizer_init(void) { void visualizer_init(void) {
#ifdef LCD_ENABLE
gfxInit(); gfxInit();
#endif
#ifdef LCD_BACKLIGHT_ENABLE #ifdef LCD_BACKLIGHT_ENABLE
lcd_backlight_init(); lcd_backlight_init();

View File

@ -42,7 +42,7 @@ endif
ifdef LED_ENABLE ifdef LED_ENABLE
SRC += $(VISUALIZER_DIR)/led_test.c SRC += $(VISUALIZER_DIR)/led_test.c
UDEFS += -DLED_ENABLE OPT_DEFS += -DLED_ENABLE
endif endif
include $(GFXLIB)/gfx.mk include $(GFXLIB)/gfx.mk

View File

@ -104,13 +104,14 @@ int main(void) {
/* init printf */ /* init printf */
init_printf(NULL,sendchar_pf); init_printf(NULL,sendchar_pf);
#ifdef SERIAL_LINK_ENABLE
init_serial_link();
#endif
#ifdef VISUALIZER_ENABLE #ifdef VISUALIZER_ENABLE
visualizer_init(); visualizer_init();
#endif #endif
#ifdef SERIAL_LINK_ENABLE
init_serial_link();
#endif
host_driver_t* driver = NULL; host_driver_t* driver = NULL;