Use default 8 MHz clock, disable PLL
Reducing the frequency to one sixth increases flickering somewhat, but it's not too bad. More importantly, the current draw (at 5 V) at the lowest brightness settings (all LEDs white) is reduced from 13 mA to about 3 mA.
This commit is contained in:
parent
8c3bc4222c
commit
19a78f2527
3 changed files with 2 additions and 16 deletions
|
|
@ -49,7 +49,7 @@ void LightSensor_Init(void)
|
|||
TIM14->CCMR1 = TIM_CCMR1_CC1S_0;
|
||||
TIM14->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P;
|
||||
// Set up TIM14 for an oveflow interrupt at the configured interval
|
||||
TIM14->PSC = 48000 * LIGHTSENSOR_INTERVAL / 65535;
|
||||
TIM14->PSC = 8000 * LIGHTSENSOR_INTERVAL / 65535;
|
||||
TIM14->ARR = 65535;
|
||||
TIM14->DIER = TIM_DIER_UIE;
|
||||
NVIC_EnableIRQ(TIM14_IRQn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue