added comments

This commit is contained in:
Sean 2022-04-06 23:16:05 -04:00
parent ad9de1e1e4
commit 4f7736b055

View file

@ -602,7 +602,7 @@ int maxTimer = 6250; // 100ms delay / 16uS interrupt time
int nextState(int state) { return (state+1)%2; } int nextState(int state) { return (state+1)%2; }
// the interrupt function to display the leds // the interrupt function to display the leds (T2 = 8 bit timer)
ISR(TIMER2_OVF_vect) { ISR(TIMER2_OVF_vect) {
if (not timerReset){ if (not timerReset){
currentTimer++; currentTimer++;
@ -642,7 +642,7 @@ ISR(TIMER2_OVF_vect) {
} }
} }
/******************************************************************************\ /**************************Applies to T2 (8 bit timer) only********************\
| Some helpfull info for overflowing timers with different prescaler values | | Some helpfull info for overflowing timers with different prescaler values |
| 16000000 / ( 1*256) = 16000000 / 256 = 62500 Hz | | 16000000 / ( 1*256) = 16000000 / 256 = 62500 Hz |
| 16000000 / ( 8*256) = 16000000 / 2048 = ~7812 Hz | | 16000000 / ( 8*256) = 16000000 / 2048 = ~7812 Hz |
@ -656,7 +656,7 @@ ISR(TIMER2_OVF_vect) {
int animationTimer = 0; int animationTimer = 0;
int animationMax = 0; int animationMax = 0;
// T1 = 16 bit timer
ISR(TIMER1_OVF_vect) { ISR(TIMER1_OVF_vect) {
animationTimer++; animationTimer++;
if (animationTimer >= animationMax) { if (animationTimer >= animationMax) {