@@ -56,7 +56,7 @@ uint32_t multiplier = 4096;
56
56
volatile uint16_t interruptCounter = 0 ;
57
57
58
58
ICACHE_RAM_ATTR void handleInterrupt () {
59
- interruptCounter++ ;
59
+ interruptCounter = interruptCounter + 1 ;
60
60
}
61
61
62
62
void setup () {
@@ -86,7 +86,7 @@ void loop() {
86
86
{
87
87
// first freeze counters and adjust for new round
88
88
frozenCounter = interruptCounter; // first freeze counter
89
- interruptCounter -= frozenCounter;
89
+ interruptCounter = interruptCounter - frozenCounter;
90
90
lastEvaluation += INTERVAL;
91
91
92
92
totalCounter += frozenCounter;
@@ -108,10 +108,10 @@ void loop() {
108
108
109
109
countDeviations++;
110
110
Serial.printf (" %4u" , countDeviations);
111
- Serial.printf (" Timestamp: %4u " , totalTime);
111
+ Serial.printf (" Timestamp: %4 " PRIu32 " " , totalTime);
112
112
Serial.printf (" Freq: %4u " , frozenCounter);
113
- Serial.printf (" Counter: %6u " , totalCounter);
114
- Serial.printf (" calc.osci.freq: %9u \n " ,realOsciFreq);
113
+ Serial.printf (" Counter: %6 " PRIu32 " " , totalCounter);
114
+ Serial.printf (" calc.osci.freq: %9 " PRIu32 " \n " ,realOsciFreq);
115
115
}
116
116
}
117
117
0 commit comments