add power()

This commit is contained in:
suchmememanyskill 2021-07-28 00:31:36 +02:00
parent 192568b686
commit 74b6106f26
1 changed files with 6 additions and 0 deletions

View File

@ -456,6 +456,11 @@ ClassFunction(stdGetCwd){
return newStringVariablePtr(CpyStr(TConf.scriptCWD), 0, 1);
}
ClassFunction(stdPower){
power_set_state(MIN(0, (getIntValue(args[0]) % POWER_OFF_REBOOT)));
return &emptyClass;
}
#else
#define STUBBED(name) ClassFunction(name) { return newIntVariablePtr(0); }
@ -540,6 +545,7 @@ ClassFunctionTableEntry_t standardFunctionDefenitions[] = {
{"color", stdColor, 1, threeIntsStd},
{"menu", stdMenuFull, 3, menuArgsStd},
{"menu", stdMenuFull, 2, menuArgsStd},
{"power", stdPower, 1, threeIntsStd},
// System
{"mountsys", stdMountSysmmc, 1, twoStringArgStd},