summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugin.h2
-rw-r--r--firmware/backlight.c4
-rw-r--r--firmware/export/backlight.h2
-rw-r--r--uisimulator/common/stubs.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index be08091eba..2bcdffb344 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -203,7 +203,7 @@ struct plugin_api {
203 void (*bitswap)(unsigned char *data, int length); 203 void (*bitswap)(unsigned char *data, int length);
204#endif 204#endif
205 struct user_settings* global_settings; 205 struct user_settings* global_settings;
206 void (*backlight_set_timeout)(unsigned int index); 206 void (*backlight_set_timeout)(int index);
207}; 207};
208 208
209/* defined by the plugin loader (plugin.c) */ 209/* defined by the plugin loader (plugin.c) */
diff --git a/firmware/backlight.c b/firmware/backlight.c
index d3b4580daa..1e8ef3d3ab 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -126,9 +126,9 @@ int backlight_get_timeout(void)
126 return backlight_timeout; 126 return backlight_timeout;
127} 127}
128 128
129void backlight_set_timeout(unsigned int index) 129void backlight_set_timeout(int index)
130{ 130{
131 if(index >= sizeof(backlight_timeout_value)) 131 if(index >= sizeof(backlight_timeout_value) || index < 0)
132 /* if given a weird value, use 0 */ 132 /* if given a weird value, use 0 */
133 index=0; 133 index=0;
134 backlight_timeout = index; /* index in the backlight_timeout_value table */ 134 backlight_timeout = index; /* index in the backlight_timeout_value table */
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index d0bfc62e2e..d80f2bbe61 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -24,7 +24,7 @@ void backlight_on(void);
24void backlight_off(void); 24void backlight_off(void);
25void backlight_tick(void); 25void backlight_tick(void);
26int backlight_get_timeout(void); 26int backlight_get_timeout(void);
27void backlight_set_timeout(int seconds); 27void backlight_set_timeout(int index);
28bool backlight_get_on_when_charging(void); 28bool backlight_get_on_when_charging(void);
29void backlight_set_on_when_charging(bool yesno); 29void backlight_set_on_when_charging(bool yesno);
30extern const char backlight_timeout_value[]; 30extern const char backlight_timeout_value[];
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 533b909786..23a6728db4 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -114,9 +114,9 @@ bool simulate_usb(void)
114 return false; 114 return false;
115} 115}
116 116
117void backlight_set_timeout(int seconds) 117void backlight_set_timeout(int index)
118{ 118{
119 (void)seconds; 119 (void)index;
120} 120}
121 121
122void backlight_set_on_when_charging(bool beep) 122void backlight_set_on_when_charging(bool beep)