From 3d815406f49e22c492b9e0d4c18d457144fa7ca7 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 17 Sep 2017 00:27:10 +0200 Subject: Don't call touchscreen functions when we don't have a touchscreen Change-Id: Ia8c05f45c289729031d6333445d932bb5ac242ca --- firmware/target/arm/imx233/debug-imx233.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'firmware/target/arm/imx233/debug-imx233.c') diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index f65d881ea3..bfc38b20dc 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c @@ -1091,7 +1091,9 @@ bool dbg_hw_info_button(void) int vddio_val = orig_vddio_val; int vddio_brownout = orig_vddio_brownout; #endif +#ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(TOUCHSCREEN_POINT); +#endif while(1) { @@ -1115,14 +1117,18 @@ bool dbg_hw_info_button(void) imx233_power_set_regulator(REGULATOR_VDDIO, orig_vddio_val, orig_vddio_brownout); #endif lcd_setfont(FONT_UI); +#ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(TOUCHSCREEN_BUTTON); +#endif return true; case ACT_CANCEL: #if IMX233_SUBTARGET >= 3700 imx233_power_set_regulator(REGULATOR_VDDIO, orig_vddio_val, orig_vddio_brownout); #endif lcd_setfont(FONT_UI); +#ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(TOUCHSCREEN_BUTTON); +#endif return false; } @@ -1483,8 +1489,10 @@ bool dbg_hw_info(void) int len = ARRAYLEN(debug_screens); int top_visible = 0; int highlight = 0; +#ifdef HAVE_TOUCHSCREEN enum touchscreen_mode old_mode = touchscreen_get_mode(); touchscreen_set_mode(TOUCHSCREEN_BUTTON); +#endif while(1) { int button = my_get_action(HZ / 10); @@ -1503,7 +1511,9 @@ bool dbg_hw_info(void) lcd_setfont(FONT_UI); break; case ACT_CANCEL: +#ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(old_mode); +#endif return false; } // adjust top visible if needed @@ -1534,7 +1544,9 @@ bool dbg_hw_info(void) lcd_update(); yield(); } +#ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(old_mode); +#endif return false; } -- cgit