From 74b6106f263af78465590646b09790495df50d9a Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Wed, 28 Jul 2021 00:31:36 +0200 Subject: [PATCH] add power() --- source/script/standardLibrary.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/script/standardLibrary.c b/source/script/standardLibrary.c index a6eb608..6ce7421 100644 --- a/source/script/standardLibrary.c +++ b/source/script/standardLibrary.c @@ -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},