@@ -56,7 +56,7 @@ uint32_t multiplier = 4096;
5656volatile uint16_t interruptCounter = 0 ;
5757
5858ICACHE_RAM_ATTR void handleInterrupt () {
59- interruptCounter++ ;
59+ interruptCounter = interruptCounter + 1 ;
6060}
6161
6262void setup () {
@@ -86,7 +86,7 @@ void loop() {
8686 {
8787 // first freeze counters and adjust for new round
8888 frozenCounter = interruptCounter; // first freeze counter
89- interruptCounter -= frozenCounter;
89+ interruptCounter = interruptCounter - frozenCounter;
9090 lastEvaluation += INTERVAL;
9191
9292 totalCounter += frozenCounter;
@@ -108,10 +108,10 @@ void loop() {
108108
109109 countDeviations++;
110110 Serial.printf (" %4u" , countDeviations);
111- Serial.printf (" Timestamp: %4u " , totalTime);
111+ Serial.printf (" Timestamp: %4 " PRIu32 " " , totalTime);
112112 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);
115115 }
116116 }
117117
0 commit comments