Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TimerAlarm fix
  • Loading branch information
P-R-O-C-H-Y committed Mar 17, 2023
commit d3c9393681f6e44ccc86387ddc54c2c1aeba7697
2 changes: 1 addition & 1 deletion libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void setup() {

// Set alarm to call onTimer function every second (value in microseconds).
// Repeat the alarm (third parameter) with unlimited count = 0 (fourth parameter).
timerAlarmWrite(timer, 1000000, true, 0);
timerAlarm(timer, 1000000, true, 0);
}

void loop() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void setup() {
pinMode(button, INPUT_PULLUP); //init control pin
timer = timerBegin(1000000); //timer 1Mhz resolution
timerAttachInterrupt(timer, &resetModule); //attach callback
timerAlarmWrite(timer, wdtTimeout * 1000, false, 0); //set time in us
timerAlarm(timer, wdtTimeout * 1000, false, 0); //set time in us
}

void loop() {
Expand Down
2 changes: 1 addition & 1 deletion tests/timer/timer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void timer_interrupt_test(void){

alarm_flag = false;
timerAttachInterrupt(timer, &onTimer);
timerAlarmWrite(timer, (1.2 * TIMER_FREQUENCY), true, 0);
timerAlarm(timer, (1.2 * TIMER_FREQUENCY), true, 0);
timerStart(timer);

delay(2000);
Expand Down