diff --git a/right/src/led_driver.c b/right/src/led_driver.c index dd81e9a..f9f4403 100644 --- a/right/src/led_driver.c +++ b/right/src/led_driver.c @@ -11,9 +11,16 @@ void LedDriver_InitAllLeds(char isEnabled) { CLOCK_EnableClock(LED_DRIVER_SDB_CLOCK); PORT_SetPinMux(LED_DRIVER_SDB_PORT, LED_DRIVER_SDB_PIN, kPORT_MuxAsGpio); - GPIO_PinInit(GPIOA, LED_DRIVER_SDB_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0}); + GPIO_PinInit(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0}); GPIO_WritePinOutput(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, 1); +#if UHK_PCB_MAJOR_VERSION == 7 + CLOCK_EnableClock(LED_DRIVER_PWM_CLOCK); + PORT_SetPinMux(LED_DRIVER_PWM_PORT, LED_DRIVER_PWM_PIN, kPORT_MuxAsGpio); + GPIO_PinInit(LED_DRIVER_PWM_GPIO, LED_DRIVER_PWM_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0}); + GPIO_WritePinOutput(LED_DRIVER_PWM_GPIO, LED_DRIVER_PWM_PIN, 1); +#endif + LedDriver_SetAllLedsTo(isEnabled ? 0xFF : 0x00); } diff --git a/right/src/led_driver.h b/right/src/led_driver.h index 84e9db5..aab8869 100644 --- a/right/src/led_driver.h +++ b/right/src/led_driver.h @@ -16,6 +16,11 @@ #define LED_DRIVER_SDB_CLOCK kCLOCK_PortA #define LED_DRIVER_SDB_PIN 2 + #define LED_DRIVER_PWM_PORT PORTD + #define LED_DRIVER_PWM_GPIO GPIOD + #define LED_DRIVER_PWM_CLOCK kCLOCK_PortD + #define LED_DRIVER_PWM_PIN 6 + #define LED_DRIVER_REGISTER_SHUTDOWN 0x0A #define LED_DRIVER_REGISTER_FRAME 0xFD