Rename backlight level pins

This commit is contained in:
hubmartin 2021-08-04 14:43:04 +02:00
parent b3e6da7514
commit abd8f343e4
2 changed files with 18 additions and 18 deletions

View file

@ -5,9 +5,9 @@
using namespace Pinetime::Controllers;
void BrightnessController::Init() {
nrf_gpio_cfg_output(PinMap::LcdBacklight1);
nrf_gpio_cfg_output(PinMap::LcdBacklight2);
nrf_gpio_cfg_output(PinMap::LcdBacklight3);
nrf_gpio_cfg_output(PinMap::LcdBacklightLow);
nrf_gpio_cfg_output(PinMap::LcdBacklightMedium);
nrf_gpio_cfg_output(PinMap::LcdBacklightHigh);
Set(level);
}
@ -16,24 +16,24 @@ void BrightnessController::Set(BrightnessController::Levels level) {
switch (level) {
default:
case Levels::High:
nrf_gpio_pin_clear(PinMap::LcdBacklight1);
nrf_gpio_pin_clear(PinMap::LcdBacklight2);
nrf_gpio_pin_clear(PinMap::LcdBacklight3);
nrf_gpio_pin_clear(PinMap::LcdBacklightLow);
nrf_gpio_pin_clear(PinMap::LcdBacklightMedium);
nrf_gpio_pin_clear(PinMap::LcdBacklightHigh);
break;
case Levels::Medium:
nrf_gpio_pin_clear(PinMap::LcdBacklight1);
nrf_gpio_pin_clear(PinMap::LcdBacklight2);
nrf_gpio_pin_set(PinMap::LcdBacklight3);
nrf_gpio_pin_clear(PinMap::LcdBacklightLow);
nrf_gpio_pin_clear(PinMap::LcdBacklightMedium);
nrf_gpio_pin_set(PinMap::LcdBacklightHigh);
break;
case Levels::Low:
nrf_gpio_pin_clear(PinMap::LcdBacklight1);
nrf_gpio_pin_set(PinMap::LcdBacklight2);
nrf_gpio_pin_set(PinMap::LcdBacklight3);
nrf_gpio_pin_clear(PinMap::LcdBacklightLow);
nrf_gpio_pin_set(PinMap::LcdBacklightMedium);
nrf_gpio_pin_set(PinMap::LcdBacklightHigh);
break;
case Levels::Off:
nrf_gpio_pin_set(PinMap::LcdBacklight1);
nrf_gpio_pin_set(PinMap::LcdBacklight2);
nrf_gpio_pin_set(PinMap::LcdBacklight3);
nrf_gpio_pin_set(PinMap::LcdBacklightLow);
nrf_gpio_pin_set(PinMap::LcdBacklightMedium);
nrf_gpio_pin_set(PinMap::LcdBacklightHigh);
break;
}
}

View file

@ -20,9 +20,9 @@ namespace Pinetime {
static constexpr uint8_t Motor = 16;
static constexpr uint8_t LcdBacklight1 = 14;
static constexpr uint8_t LcdBacklight2 = 22;
static constexpr uint8_t LcdBacklight3 = 23;
static constexpr uint8_t LcdBacklightLow = 14;
static constexpr uint8_t LcdBacklightMedium = 22;
static constexpr uint8_t LcdBacklightHigh = 23;
static constexpr uint8_t SpiSck = 2;
static constexpr uint8_t SpiMosi = 3;