Skip to content

Commit da74cb9

Browse files
authored
Merge pull request #100 from makermelissa/master
Fix compiler warning for oscillator example
2 parents ff2457a + 7ee072e commit da74cb9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/oscillator/oscillator.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ uint32_t multiplier = 4096;
5656
volatile uint16_t interruptCounter = 0;
5757

5858
ICACHE_RAM_ATTR void handleInterrupt() {
59-
interruptCounter++;
59+
interruptCounter = interruptCounter + 1;
6060
}
6161

6262
void 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

Comments
 (0)