Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warning for oscillator example #100

Merged
merged 2 commits into from Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/oscillator/oscillator.ino
Expand Up @@ -56,7 +56,7 @@ uint32_t multiplier = 4096;
volatile uint16_t interruptCounter = 0;

ICACHE_RAM_ATTR void handleInterrupt() {
interruptCounter++;
interruptCounter = interruptCounter + 1;
}

void setup() {
Expand Down Expand Up @@ -86,7 +86,7 @@ void loop() {
{
// first freeze counters and adjust for new round
frozenCounter = interruptCounter; // first freeze counter
interruptCounter -= frozenCounter;
interruptCounter = interruptCounter - frozenCounter;
lastEvaluation += INTERVAL;

totalCounter += frozenCounter;
Expand All @@ -108,10 +108,10 @@ void loop() {

countDeviations++;
Serial.printf("%4u", countDeviations);
Serial.printf(" Timestamp: %4u ", totalTime);
Serial.printf(" Timestamp: %4" PRIu32 " ", totalTime);
Serial.printf(" Freq: %4u ", frozenCounter);
Serial.printf(" Counter: %6u ", totalCounter);
Serial.printf(" calc.osci.freq: %9u\n",realOsciFreq);
Serial.printf(" Counter: %6" PRIu32 " ", totalCounter);
Serial.printf(" calc.osci.freq: %9" PRIu32 "\n",realOsciFreq);
}
}

Expand Down