Skip to content

Commit

Permalink
Correct timer divider.
Browse files Browse the repository at this point in the history
  • Loading branch information
breaker27 committed Feb 3, 2023
1 parent 326aaec commit 9bd7417
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions firmware/shc_rgb_dimmer/shc_rgb_dimmer.c
Expand Up @@ -54,21 +54,18 @@ uint32_t station_packetcounter;
uint16_t send_status_timeout = 15;
uint8_t version_status_cycle = SEND_VERSION_STATUS_CYCLE - 1; // send promptly after startup

uint8_t timer1_tick_divider = 16;

ISR (TIMER2_OVF_vect)
{
//rgb_led_animation_tick();
}
#define TIMER1_TICK_DIVIDER 8 // 244 Hz / 8 = 32ms per animation_tick
uint8_t timer1_tick_divider = TIMER1_TICK_DIVIDER;

ISR (TIMER0_OVF_vect)
{
timer1_tick_divider--;

if (timer1_tick_divider == 0)
{
timer1_tick_divider = 16;
timer1_tick_divider = TIMER1_TICK_DIVIDER;
animation_tick(true);
animation_tick(false);
}
}

Expand Down

0 comments on commit 9bd7417

Please sign in to comment.