forked from Mirror/GodMode9
parent
620e5061c5
commit
b5fca3bc7e
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#include "arm/timer.h"
|
#include "arm/timer.h"
|
||||||
|
|
||||||
#include "hw/gpio.h"
|
#include "hw/gpio.h"
|
||||||
@ -116,16 +118,13 @@ u32 mcuGetSpecialHID(void)
|
|||||||
|
|
||||||
void mcuSetStatusLED(u32 period_ms, u32 color)
|
void mcuSetStatusLED(u32 period_ms, u32 color)
|
||||||
{
|
{
|
||||||
u32 r, g, b;
|
u32 r, g, b, delay;
|
||||||
mcuStatusLED ledState;
|
mcuStatusLED ledState;
|
||||||
|
|
||||||
// handle proper non-zero periods
|
delay = clamp((period_ms * 0x200) / 1000, 1, 0xFF);
|
||||||
// so small the hardware can't handle it
|
|
||||||
if (period_ms != 0 && period_ms < 63)
|
|
||||||
period_ms = 63;
|
|
||||||
|
|
||||||
ledState.delay = (period_ms * 0x10) / 1000;
|
ledState.delay = delay;
|
||||||
ledState.smoothing = 0x40;
|
ledState.smoothing = delay;
|
||||||
ledState.loop_delay = 0x10;
|
ledState.loop_delay = 0x10;
|
||||||
ledState.unk = 0;
|
ledState.unk = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user