Skip to content

Tab5: do not enable periodic RTC timer IRQs - #419

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:tab5_rtc_timer_irq
Oct 25, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:tab5_rtc_timer_irq

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

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_Class gets a constructor option, timer_irq (default true). RTC_Class::begin() creates the Tab5 RTC with it off.
  • With timer_irq off, hasTimerIRQ() returns false, and setTimerIRQ() with a positive period stops any running timer and returns false without changing applied_msec. This also applies when the driver is called through M5.Rtc.getRtcInstancePtr(). 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).
  • RX8130_Class::begin() stops the periodic timer (TE) on every board. The IRQ flags are left as they are, so getIRQstatus() still reports the wake reason.

Tested on a Tab5 by reading registers 0x1C / 0x1D / 0x1E after each call, without ever setting TIE:

  • setTimerIRQ(500), through M5.Rtc and through the driver: refused, TE and TIE stay 0
  • with TE running (TIE = 0): setTimerIRQ(0), disableIRQ() and Rtc.begin() stop it; begin() keeps TF
  • with an alarm set: timerSleep(60) returns without sleeping and the alarm stays enabled

Local builds for every ESP32 chip on Arduino and ESP-IDF, and the fork CI, pass.

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().
@lovyan03
lovyan03 merged commit 1811302 into m5stack:develop Oct 25, 2026
30 checks passed
@ainyan03 ainyan03 mentioned this pull request Oct 25, 2026
@ainyan03
ainyan03 deleted the tab5_rtc_timer_irq branch October 25, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants