Repository navigation
Tab5: do not enable periodic RTC timer IRQs - #419
Merged
Merged
Conversation
On Tab5 the interrupt output of the built-in RX8130 is connected to the power management controller. Periodic timer IRQs are not supported there. - The built-in RX8130 on Tab5 is created with periodic timer IRQs disabled (new RX8130_Class constructor argument timer_irq, default true). hasTimerIRQ() returns false. A positive period passed to setTimerIRQ(), through M5.Rtc or the driver, stops any running timer and returns false without changing applied_msec. setTimerIRQ(0) still stops the timer. - Power::timerSleep(int seconds) returns false without sleeping on Tab5, also when the RTC is disabled. Use timerSleep(time) or timerSleep(date, time) instead. RX8130 (all boards): begin() stops the periodic timer. The IRQ flags are kept for getIRQstatus().
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Tab5 the interrupt output of the built-in RX8130 is connected to the power management controller. This PR stops M5Unified from enabling periodic RTC timer IRQs there. Alarm IRQs (
timerSleep(time)) are unchanged.Changes:
RX8130_Classgets a constructor option,timer_irq(defaulttrue).RTC_Class::begin()creates the Tab5 RTC with it off.timer_irqoff,hasTimerIRQ()returns false, andsetTimerIRQ()with a positive period stops any running timer and returns false without changingapplied_msec. This also applies when the driver is called throughM5.Rtc.getRtcInstancePtr().setTimerIRQ(0)still stops the timer.Power.timerSleep(int seconds)returns false without sleeping on Tab5, also when the RTC is disabled. UsetimerSleep(time)ortimerSleep(date, time).RX8130_Class::begin()stops the periodic timer (TE) on every board. The IRQ flags are left as they are, sogetIRQstatus()still reports the wake reason.Tested on a Tab5 by reading registers 0x1C / 0x1D / 0x1E after each call, without ever setting TIE:
setTimerIRQ(500), throughM5.Rtcand through the driver: refused, TE and TIE stay 0setTimerIRQ(0),disableIRQ()andRtc.begin()stop it;begin()keeps TFtimerSleep(60)returns without sleeping and the alarm stays enabledLocal builds for every ESP32 chip on Arduino and ESP-IDF, and the fork CI, pass.