Initial migration of software PWM backlight (#6709)
* Initial migration of software PWM backlight * First pass at backlight driver docs * Correct driver name in docs * Run backlight_task when using BACKLIGHT_PINS * Resolve backlight docs TODOs
This commit is contained in:
parent
ff8d436946
commit
4531cc874e
6 changed files with 173 additions and 61 deletions
|
@ -159,7 +159,7 @@
|
|||
# define BACKLIGHT_ON_STATE 0
|
||||
# endif
|
||||
|
||||
void backlight_on(uint8_t backlight_pin) {
|
||||
void backlight_on(pin_t backlight_pin) {
|
||||
# if BACKLIGHT_ON_STATE == 0
|
||||
writePinLow(backlight_pin);
|
||||
# else
|
||||
|
@ -167,7 +167,7 @@ void backlight_on(uint8_t backlight_pin) {
|
|||
# endif
|
||||
}
|
||||
|
||||
void backlight_off(uint8_t backlight_pin) {
|
||||
void backlight_off(pin_t backlight_pin) {
|
||||
# if BACKLIGHT_ON_STATE == 0
|
||||
writePinHigh(backlight_pin);
|
||||
# else
|
||||
|
@ -191,16 +191,16 @@ void backlight_off(uint8_t backlight_pin) {
|
|||
|
||||
# define FOR_EACH_LED(x) \
|
||||
for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \
|
||||
uint8_t backlight_pin = backlight_pins[i]; \
|
||||
pin_t backlight_pin = backlight_pins[i]; \
|
||||
{ x } \
|
||||
}
|
||||
|
||||
static const uint8_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PIN_INIT;
|
||||
static const pin_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PIN_INIT;
|
||||
|
||||
# else // full hardware PWM
|
||||
|
||||
// we support only one backlight pin
|
||||
static const uint8_t backlight_pin = BACKLIGHT_PIN;
|
||||
static const pin_t backlight_pin = BACKLIGHT_PIN;
|
||||
# define FOR_EACH_LED(x) x
|
||||
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue