Backlight support. TOUCH events feed backlight_keepalive(); After a timeout, we fade the backlight to 0 using timers. When the backlight is not active, TOUCH events are not passed to widgets, but the backlight is re-enabled; Add some flags to mos.yml to drive timeout and PWM pin for the backlight on Featherwing
This commit is contained in:
17
include/backlight.h
Normal file
17
include/backlight.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef __BACKLIGHT_H
|
||||
#define __BACKLIGHT_H
|
||||
|
||||
#include "mgos.h"
|
||||
#include "mgos_pwm.h"
|
||||
#include "mgos_config.h"
|
||||
#include "mgos_timers.h"
|
||||
|
||||
#define BACKLIGHT_PWM_HZ 10000
|
||||
#define BACKLIGHT_STEP_USEC 10000 // 10ms per step.
|
||||
|
||||
void backlight_init(void);
|
||||
void backlight_set(float new_duty, int fader_msec);
|
||||
void backlight_keepalive();
|
||||
bool backlight_active();
|
||||
|
||||
#endif // __BACKLIGHT_H
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "widget.h"
|
||||
#include "screen.h"
|
||||
#include "backlight.h"
|
||||
|
||||
void widget_time_ev(int ev, struct widget_t *w, void *ev_data);
|
||||
|
||||
|
Reference in New Issue
Block a user