Added LED toggling from the Rosalina misc. menu

This commit is contained in:
Hikari-chin
2017-07-04 23:13:48 -04:00
parent 817475257e
commit 2538769f3a
5 changed files with 94 additions and 5 deletions

View File

@@ -28,6 +28,7 @@
#include "menu.h"
#include "draw.h"
#include "fmt.h"
#include "mcu.h"
#include "memory.h"
#include "ifile.h"
#include "menus.h"
@@ -125,11 +126,10 @@ u32 waitCombo(void)
static Result _MCUHWC_GetBatteryLevel(u8 *out)
{
#define TRY(expr) if(R_FAILED(res = (expr))) { svcCloseHandle(mcuhwcHandle); return res; }
#define TRY(expr) if(R_FAILED(res = (expr))) { mcuExit(); return res; }
Result res;
Handle mcuhwcHandle;
TRY(srvGetServiceHandle(&mcuhwcHandle, "mcu::HWC"));
TRY(mcuInit());
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = 0x50000;