Skip to content

NanoC6 / NanoH2: switch the RGB LED power on when the LEDs are first used - #389

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:nano_rgb_power
Oct 5, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:nano_rgb_power

Conversation

@ainyan03

@ainyan03 ainyan03 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

On NanoC6 and NanoH2 the RGB LED is powered through a switch controlled by a GPIO (NanoC6: GPIO19, NanoH2: GPIO10, documented in the PinMap of each board). M5.Led only configured the WS2812 data pin, so the LED never lit on these boards.

The switch pin is a new field of the RMT bus config (pin_power). It is driven high in the bus init, which runs on the first LED access, so a sketch that does not use the LEDs keeps them unpowered (the WS2812 draws a quiescent current even when dark). release() turns the supply off again.

A frame sent right after switching the supply on is lost — measured on both boards: 0 ms between the switch and the first frame fails, 1 ms works — so the init waits 5 ms once.

Verification:

  • NanoC6 and NanoH2: with the enable low the LED stays dark although the data line carries a correct frame (checked by sampling the data pin; ~29 µs burst, T0H ≈ 0.3 µs / T1H ≈ 0.9 µs). With this change both boards light from M5.Led as expected, starting from the first frame.
  • Builds on the CI matrix (ESP-IDF 5.1–6.1, Arduino 2.0 / 3.0–3.3) pass with no new warnings.

…used

The RGB LED on these boards is powered through a switch controlled by a GPIO (NanoC6:
GPIO19, NanoH2: GPIO10). The LED driver only configured the data pin, so M5.Led never
lit anything.

The switch pin is a new field of the RMT bus config (pin_power) and is driven high in
the bus init, which runs on the first LED access, so a sketch that does not use the
LEDs keeps them unpowered. A frame sent right after switching the supply on is lost
(0 ms fails, 1 ms works on both boards), so the init waits 5 ms once. release() turns
the supply off again.
@ainyan03 ainyan03 changed the title NanoC6 / NanoH2: turn on the RGB LED power switch NanoC6 / NanoH2: switch the RGB LED power on when the LEDs are first used Oct 5, 2026
@lovyan03
lovyan03 merged commit 1d5852b into m5stack:develop Oct 5, 2026
30 checks passed
@ainyan03
ainyan03 deleted the nano_rgb_power branch October 5, 2026 14:01
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