diff options
Diffstat (limited to 'control')
-rw-r--r-- | control/application.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/control/application.c b/control/application.c index c14f5b1..ce14bf2 100644 --- a/control/application.c +++ b/control/application.c @@ -51,21 +51,26 @@ void tmp112_event_handler(bc_tmp112_t *self, bc_tmp112_event_t event, void *even bc_scheduler_plan_now(APPLICATION_TASK_ID); } -void on_lcd_button_click(void) { +int brightness = 0; + +void set_brightness() { + bc_radio_pub_int("led/brightness/set", &brightness); } void lcd_button_left_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) { if (event != BC_BUTTON_EVENT_CLICK) return; bc_led_pulse(&led_lcd_blue, 30); - on_lcd_button_click(); + brightness = 100; + set_brightness(); } void lcd_button_right_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) { if (event != BC_BUTTON_EVENT_CLICK) return; bc_led_pulse(&led_lcd_red, 30); - on_lcd_button_click(); + brightness = 0; + set_brightness(); } void battery_event_handler(bc_module_battery_event_t event, void *event_param) { |