Reduced frequency of ms interrupt

This commit is contained in:
nedko 2022-10-25 19:47:28 +03:00
parent 81b8bab3b9
commit 82b33cb9f9

View File

@ -148,7 +148,7 @@ uint8_t extract_digit(uint32_t value, uint8_t digit_num);
ISR(TIMER1_OVF_vect)
{
cli();
++ms;
ms += 8;
sei();
}
@ -477,8 +477,8 @@ void simple_init()
PORTB = (1 << 1) | (1 << 3) | (1 << 4);
#endif
// Prescaler 4 (1 MHz / 256 / 4 ~ 1000)
TCCR1 = (1 << CS11) | (1 << CS10);
// Prescaler 32 (1MHz / 32 / 256 = 8,192 ms)
TCCR1 = (1 << CS12) | (1 << CS11);
// Enable Interrupt on overflow
TIMSK = (1 << TOIE1);