main: update RGB LED init
This commit is contained in:
parent
73d6c4917d
commit
75fb553172
14
main.c
14
main.c
|
@ -19,7 +19,7 @@
|
|||
// IR demodulator output pin
|
||||
#define IRM_OUT_PIN PC7 // TIM1_CH2
|
||||
#define IRM_OUT_PORT GPIO_PC
|
||||
// RGB LED pins (sink on)
|
||||
// RGB LED pins (sink controlled by nMOS)
|
||||
#define LED_RED_PIN PD3 // TIM2_CH2
|
||||
#define LED_RED_PORT GPIO_PD
|
||||
#define LED_GREEN_PIN PD2 // TIM2_CH3
|
||||
|
@ -128,14 +128,14 @@ void main(void)
|
|||
IRM_ON_PORT->DDR.reg |= IRM_ON_PIN; // switch pin to output
|
||||
|
||||
// configure RGB LED
|
||||
LED_RED_PORT->ODR.reg |= LED_RED_PIN; // switch LED off
|
||||
LED_RED_PORT->CR1.reg &= ~LED_RED_PIN; // use as open-drain
|
||||
LED_RED_PORT->ODR.reg &= ~LED_RED_PIN; // switch LED off
|
||||
LED_RED_PORT->CR1.reg |= LED_RED_PIN; // use as push-pull
|
||||
LED_RED_PORT->DDR.reg |= LED_RED_PIN; // use pin to output
|
||||
LED_GREEN_PORT->ODR.reg |= LED_GREEN_PIN; // switch LED off
|
||||
LED_GREEN_PORT->CR1.reg &= ~LED_GREEN_PIN; // use as open-drain
|
||||
LED_GREEN_PORT->ODR.reg &= ~LED_GREEN_PIN; // switch LED off
|
||||
LED_GREEN_PORT->CR1.reg |= LED_GREEN_PIN; // use as push-pull
|
||||
LED_GREEN_PORT->DDR.reg |= LED_GREEN_PIN; // use pin to output
|
||||
LED_BLUE_PORT->ODR.reg |= LED_BLUE_PIN; // switch LED off
|
||||
LED_BLUE_PORT->CR1.reg &= ~LED_BLUE_PIN; // use as open-drain
|
||||
LED_BLUE_PORT->ODR.reg &= ~LED_BLUE_PIN; // switch LED off
|
||||
LED_BLUE_PORT->CR1.reg |= LED_BLUE_PIN; // use as push-pull
|
||||
LED_BLUE_PORT->DDR.reg |= LED_BLUE_PIN; // use pin to output
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue