feat(lua): Add getSourceValue (#2316)
* Moved getFieldInfo and getValue up right after related functions * Modified getValue to return a valid status, so Lua can see if it got zero because of invalid source id * Added new getSourceValue Lua function per Issue #781 Also added alias getSourceInfo for getFieldInfo * Updated according to comment https://github.com/EdgeTX/edgetx/pull/2175#issuecomment-1245605114 * Replaced isFresh() by !isOld() as requested in https://github.com/EdgeTX/edgetx/pull/2316#issuecomment-1246759370 * Clean up `lua_pushtablenil` - tables cannot hold nil values * Changed isFresh() to !isOld() ... AGAIN * Return both `!isOld()` and `isFresh()` * Return nil for all values if the item does not exist * Return 0 instead of pushing three nil values * Update documentation
This commit is contained in:
+1
-1
@@ -489,7 +489,7 @@ extern uint8_t currentBacklightBright;
|
||||
void perMain();
|
||||
void per10ms();
|
||||
|
||||
getvalue_t getValue(mixsrc_t i);
|
||||
getvalue_t getValue(mixsrc_t i, bool* valid = nullptr);
|
||||
|
||||
#define GETSWITCH_MIDPOS_DELAY 1
|
||||
bool getSwitch(swsrc_t swtch, uint8_t flags=0);
|
||||
|
||||
Reference in New Issue
Block a user