|
@@ -21,6 +21,7 @@
|
21
|
21
|
#include "config.h"
|
22
|
22
|
#include "buttons.h"
|
23
|
23
|
#include "text.h"
|
|
24
|
+#include "lcd.h"
|
24
|
25
|
#include "menu.h"
|
25
|
26
|
|
26
|
27
|
static char prev_buff[MENU_MAX_LEN] = {0};
|
|
@@ -31,10 +32,18 @@ static void (*exit_callback)(void) = NULL;
|
31
|
32
|
|
32
|
33
|
static void menu_buttons(enum buttons btn, bool state) {
|
33
|
34
|
if (state && (btn == BTN_LEFT)) {
|
34
|
|
- // TODO brightness down
|
|
35
|
+ uint16_t backlight_value = lcd_get_backlight();
|
|
36
|
+ if (backlight_value > 0x00FF) {
|
|
37
|
+ backlight_value = backlight_value >> 1;
|
|
38
|
+ }
|
|
39
|
+ lcd_set_backlight(backlight_value);
|
35
|
40
|
return;
|
36
|
41
|
} else if (state && (btn == BTN_RIGHT)) {
|
37
|
|
- // TODO brightness up
|
|
42
|
+ uint16_t backlight_value = lcd_get_backlight();
|
|
43
|
+ if (backlight_value < 0xFF00) {
|
|
44
|
+ backlight_value = backlight_value << 1;
|
|
45
|
+ }
|
|
46
|
+ lcd_set_backlight(backlight_value);
|
38
|
47
|
return;
|
39
|
48
|
} else if (state && ((btn == BTN_ENTER) || (btn == BTN_A))) {
|
40
|
49
|
if (enter_callback) {
|