-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Initial support for RGB led as Status indicator, fixes #1382 #1925
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.
8000By 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
Conversation
It sounds like the output is being reset even though never reset is used. I'd suggest breaking on |
Hi, thanks for the reply, i will debug it later today and let yall know any information i get. I tried to upload a video to YT for you to see it but i wasn't able to do so (until now). I am not sure if i'm missing something on the other configuration files, my mpconfigboard.mk, board.c and pins.c files are the same as the Bast Pro Mini M0 board, should i modify something on those too? |
Hi, Thanks for your patience, I did a quick debug session for this and noticed a couple of things:
Sorry for the dumb question, how can i do this? |
Try commenting out the I use this https://github.com/bnahill/PyCortexMDebug to inspect the TC registers and the PORT to check the mux settings. |
I only got a SAMD21 device and if I comment out the -flto line the flash isn't enough :/. I will check the repo, thanks for the link. |
@C47D Please email me, scott@adafruit.com and we'll get you more boards. Thanks! |
Just did @tannewt :-) |
Ok, I think the two remaining things are:
|
In fae1039 I have added a new symbol |
Yes please. It should be inverted any time it is written to the PWM. |
In regard of adjusting the colors brightness, i think it's enough just to add
|
Yup! Looks like it. |
Done!, you should add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
Fixes #1382
Tested with custom board definition based on the Bast Pro Mini M0 (SAMD21).
Below is the mpconfigboard.h file, notice the CP_RGB_STATUS_R, CP_RGB_STATUS_G and CP_RGB_STATUS_B symbols, i connected there my RGB led, those pins were used because those have PWM capability on my board:
So far i check if those pins are free, if so i construct the pwmout object on three static
pulseio_pwmout_obj_t
variables and set the duty cycle to 0 and freq to 50000.What i think i haven't been able to do is make the
new_status_color
function work properly, i'm taking thergb
(uint32_t) parameter and get the correspondingr
,g
andb
values from it, then i calculate the equivalent porcentage on a uint16_t variable to i can then use it to set the duty cycle withcommon_hal_pulseio_pwmout_set_duty_cycle
. I'm checking the behaviour with gdb but most of the times the rgb parameter is being optimized, so i have to check it seeing the value on ther0
register of the cpu.I can only see the RGB LED turn on green at startup, after that it remains off.