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

RGB backlighting doesn't work without USB #28

Closed
joric opened this issue Feb 24, 2020 · 2 comments
Closed

RGB backlighting doesn't work without USB #28

joric opened this issue Feb 24, 2020 · 2 comments

Comments

@joric
Copy link

joric commented Feb 24, 2020

Can you please help enabling RGB on battery power (I have a large Li-Po and enough current to keep it running for a while)? Looks like RGB stops working without USB but for gods sake I can't find the culprit, rgblight_task seems to be called normally and there are no RGB disabling calls in the usbd.c. Video:

https://youtu.be/H9Vw5rEFeG4

Firmware in question: https://github.com/joric/qmk/wiki/jorne_ble (mostly taken from helix_ble).

Also there's no sync between halves, slave LED's don't work, even with RGBLIGHT_SPLIT enabled.

@joric
Copy link
Author

joric commented May 5, 2020

OK I got it! How could I overlook it? It was an explicit condition in ws2812 driver:

diff --git a/drivers/nrf52/ws2812.c b/drivers/nrf52/ws2812.c
index 048f020ff..57b5f8ec5 100644
--- a/drivers/nrf52/ws2812.c
+++ b/drivers/nrf52/ws2812.c
@@ -38,10 +38,7 @@ void pwm_handler(nrfx_pwm_evt_type_t event_type) {
 }
 
 void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) {
-  if (nrfx_power_usbstatus_get() == NRFX_POWER_USB_STATE_CONNECTED ||
-      nrfx_power_usbstatus_get() == NRFX_POWER_USB_STATE_READY) {
-    ws2812_setleds_pin(ledarray, number_of_leds, RGB_DI_PIN);
-  }
+  ws2812_setleds_pin(ledarray, number_of_leds, RGB_DI_PIN);
 }
 
 void ws2812_setleds_pin (LED_TYPE *ledarray, uint16_t number_of_leds,uint8_t pinmask){

RGB sync doesn't work just yet and there's no eeprom support but that thing above was the worst.

Will upload patched firmware here https://github.com/joric/qmk/wiki/jorne_ble

Also the signal undershoots a little bit (maybe at 3.3V), so DUMMY_SIGNAL_LEN 16 fixes that.

Upd. Added eeprom support here joric@e9f004b and fixed RGB sync here: joric@b636360.

@elfmimi
Copy link

elfmimi commented May 5, 2020

How could you overlook it?

@joric joric closed this as completed May 5, 2020
otomon10 added a commit to otomon10/qmk_firmware that referenced this issue Nov 22, 2020
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

No branches or pull requests

2 participants