|
| 1 | +local template = assert(loadScript(radio.template))() |
| 2 | +local margin = template.margin |
| 3 | +local indent = template.indent |
| 4 | +local lineSpacing = template.lineSpacing |
| 5 | +local tableSpacing = template.tableSpacing |
| 6 | +local sp = template.listSpacing.field |
| 7 | +local yMinLim = radio.yMinLimit |
| 8 | +local x = margin |
| 9 | +local y = yMinLim - lineSpacing |
| 10 | +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } |
| 11 | +local labels = {} |
| 12 | +local fields = {} |
| 13 | + |
| 14 | +labels[#labels + 1] = { t = "Voltage Settings", x = x, y = inc.y(lineSpacing) } |
| 15 | +fields[#fields + 1] = { t = "Minimum Cell", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 500, vals = { 8, 9 }, scale = 100 } |
| 16 | +fields[#fields + 1] = { t = "Maximum Cell", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 500, vals = { 10, 11 }, scale = 100 } |
| 17 | +fields[#fields + 1] = { t = "Warning Cell", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 500, vals = { 12, 13 }, scale = 100 } |
| 18 | + |
| 19 | +labels[#labels + 1] = { t = "Capacity Settings", x = x, y = inc.y(lineSpacing) } |
| 20 | +fields[#fields + 1] = { t = "Battery Capacity", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, steps = 25, max = 10000, vals = { 4, 5 } } |
| 21 | + |
| 22 | +return { |
| 23 | + read = 32, -- MSP_BATTERY_CONFIG |
| 24 | + write = 33, -- MSP_SET_BATTERY_CONFIG |
| 25 | + title = "Battery", |
| 26 | + reboot = false, |
| 27 | + eepromWrite = true, |
| 28 | + minBytes = 13, |
| 29 | + labels = labels, |
| 30 | + fields = fields |
| 31 | +} |
0 commit comments