Make TX volatge for simu more flexible (#7124)
[opentx.git] / tools / eeprom_upgd_check / check.lua
blobeaf1bb8752cd47be1297927ce53240f848854a46
1 local function checktable(actual, reference)
2 for k, v in pairs( actual ) do
3 if v == reference[k] then
4 print("OK ", k, v, reference[k])
5 else
6 print("ISSUE ", k, v, reference[k])
7 end
8 end
9 end
11 local function run(event)
12 inputt= {name = "In1", source = 1, weight = 50, offset = 10, switch = 3}
13 mixt= {name = "Mix1", source = 1, weight = 50, offset = 10, curveType = 1, curveValue = 50, flightModes = 3, delayUp = 5, speedDown = 5, speedUp = 2, delayDown = 5, mixWarn = 1 , carryTrim = true , multiplex = 1, switch = 3}
14 outputt = {name = "Out1", min = -800, max = 800, offset = 10, ppmCenter = 10, symetrical = 1, revert = 1, switch = 3}
15 timert = {mode = 4, start = 0, countdownBeep = 2, persistent = 1, minuteBeep = true, value = 10 }
16 lst = {func = 2, v1 = 2, v2 = 2, v3 = 2, duration = 3, delay = 2, ["and"] = 2}
17 input = model.getInput(4,0)
18 mix = model.getMix(4,0)
19 output = model.getOutput(4)
20 ls = model.getLogicalSwitch(0)
21 timer = model.getTimer(0)
22 checktable(input,inputt)
23 checktable(mix, mixt)
24 checktable(output, outputt)
25 checktable(ls, lst)
26 checktable(timer, timert)
27 return 2
28 end
29 return {run=run}