From: Thomas Martitz Date: Sat, 15 May 2010 20:20:57 +0000 (+0200) Subject: Minor changes and fix HAVE_LCD_FLIP X-Git-Url: https://repo.or.cz/w/kugel-rb.git/commitdiff_plain/c6ce89ce2b0e180364999566bd4f8890eca567e4 Minor changes and fix HAVE_LCD_FLIP --- diff --git a/firmware/SOURCES b/firmware/SOURCES index b1e102583..47249a2d6 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -310,7 +310,9 @@ drivers/audio/uda1341.c #endif /* defined(HAVE_*) */ #elif defined(HAVE_SDL_AUDIO) drivers/audio/sdl.c +#if CONFIG_CODEC == SWCODEC target/hosted/sdl/pcm-sdl.c +#endif #endif /* !defined(SIMULATOR) && !defined(BOOTLOADER) */ /* USB Stack */ diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c index 9bf3d2883..c06319287 100644 --- a/firmware/drivers/audio/sdl.c +++ b/firmware/drivers/audio/sdl.c @@ -32,8 +32,12 @@ extern void pcm_set_mixer_volume(int); void audiohw_set_volume(int volume) { +#if CONFIG_CODEC == SWCODEC pcm_set_mixer_volume( SDL_MIX_MAXVOLUME * ((volume - VOLUME_MIN) / 10) / (VOLUME_RANGE / 10)); +#else + (void)volume; +#endif } const struct sound_settings_info audiohw_settings[] = { diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 100957b77..f116ad646 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -429,7 +429,6 @@ void button_init(void) tick_add_task(button_tick); } -#ifndef SIMULATOR #ifdef BUTTON_DRIVER_CLOSE void button_close(void) { @@ -443,9 +442,10 @@ void button_close(void) */ static int button_flip(int button) { - int newbutton; + int newbutton = button; - newbutton = button & +#ifndef SIMULATOR + newbutton &= ~(BUTTON_LEFT | BUTTON_RIGHT #if defined(BUTTON_UP) && defined(BUTTON_DOWN) | BUTTON_UP | BUTTON_DOWN @@ -503,7 +503,7 @@ static int button_flip(int button) if (button & BUTTON_PREV) newbutton |= BUTTON_NEXT; #endif - +#endif /* !SIMULATOR */ return newbutton; } @@ -523,7 +523,6 @@ void button_set_flip(bool flip) } } #endif /* HAVE_LCD_FLIP */ -#endif /* SIMULATOR */ #ifdef HAVE_BACKLIGHT void set_backlight_filter_keypress(bool value) diff --git a/firmware/export/config/sim.h b/firmware/export/config/sim.h index 06acd5a44..d65b0fbbf 100644 --- a/firmware/export/config/sim.h +++ b/firmware/export/config/sim.h @@ -80,6 +80,8 @@ #undef HAVE_SPEAKER +#undef BUTTON_DRIVER_CLOSE + #if CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG #undef CONFIG_BACKLIGHT_FADING /* simulate SW_SETTING, as we handle sdl very similary */ diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index a32872d68..51ba8cff9 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c @@ -173,7 +173,6 @@ static void gui_message_loop(void) case SDL_QUIT: { - printf("EXIT\n"); exit(EXIT_SUCCESS); break; } diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index adac839af..d4a9af126 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c @@ -314,11 +314,6 @@ void cpu_sleep(bool enabled) (void)enabled; } -void button_set_flip(bool yesno) -{ - (void)yesno; -} - #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING void touchpad_set_sensitivity(int level) {