GodMode9
GodMode9 copied to clipboard
[BUG] Info LED code making the LED pulse 32 times faster than intended
trafficstars
3dbrew and by extension GodMode9 are wrong about the notification LED data format and units
The color data is u8[32] per color component, each index representing a "frame". The MCU runs the periodic task of updating that LED at a 512Hz rate.
delayis the delay/period in "task" (512Hz) ticks between two array elements, not counting the current task tick. Which means it'sclamp((512 * delayMs / 1000) - 1, 1, 255). 0 will cause an underflow. This limits the period to 500ms exactly.smoothingis the fade-out time. Same unit and range asdelay(1..255). You usually put the same value asdelay(smooth transition), or 1 (blink).loop_timeis the amount of time to wait before restarting the pattern, not counting the current tick. It can be 0 (restart immediately), or 255 ("don't restart")
See here: https://github.com/SciresM/boot9strap/blob/master/stage2/arm9/source/utils.c#L89
Hope this helps.
Thanks @TuxSH, great find! @Wolfvak - since you did all the hardware stuff, do you know which places we will need to fix?
All that needs changing is this code https://github.com/d0k3/GodMode9/blob/master/arm11/source/hw/mcu.c#L117-L151