Commit 955f4d5
authored
fix: update ADMUX at end of ADC ISR to meet ATmega328P timing (#126)
* fix: update ADMUX at end of ADC ISR to meet ATmega328P timing
Move ADMUX write to the end of the ADC_vect ISR so at least 128 CPU cycles
have passed since the trigger event (per ATmega328P datasheet). Prevents
premature channel switching and ensures correct sampling timing.
* #126 (comment)1 parent cd32cb1 commit 955f4d5
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1193 | 1193 | | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | | - | |
1197 | | - | |
1198 | 1196 | | |
1199 | 1197 | | |
1200 | 1198 | | |
| |||
1206 | 1204 | | |
1207 | 1205 | | |
1208 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1209 | 1211 | | |
1210 | 1212 | | |
0 commit comments