From 3107bbb88b898ef57838424f9b15166d05b70633 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 17 Sep 2016 21:50:25 +0200 Subject: [PATCH] Insert a calibration complete step and move bmp to folder (#3819) --- radio/sdcard/taranis/S6R/S6R.lua | 31 ++++++++++-------- radio/sdcard/taranis/S6R/{ => bmp}/back.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/delta.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/down.bmp | Bin .../sdcard/taranis/S6R/{ => bmp}/forward.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/horz-r.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/horz.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/left.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/plane.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/right.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/up.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/vert-r.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/vert.bmp | Bin radio/sdcard/taranis/S6R/{ => bmp}/vtail.bmp | Bin 14 files changed, 18 insertions(+), 13 deletions(-) rename radio/sdcard/taranis/S6R/{ => bmp}/back.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/delta.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/down.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/forward.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/horz-r.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/horz.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/left.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/plane.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/right.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/up.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/vert-r.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/vert.bmp (100%) rename radio/sdcard/taranis/S6R/{ => bmp}/vtail.bmp (100%) diff --git a/radio/sdcard/taranis/S6R/S6R.lua b/radio/sdcard/taranis/S6R/S6R.lua index c8cd1edf5..4ebe0290f 100644 --- a/radio/sdcard/taranis/S6R/S6R.lua +++ b/radio/sdcard/taranis/S6R/S6R.lua @@ -158,7 +158,7 @@ local function refreshNext() if fieldId == 0x9D then refreshState = 0 calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 6 + calibrationStep = (calibrationStep + 1) % 7 end else local field = fields[refreshIndex + 1] @@ -230,8 +230,8 @@ local function runFieldsPage(event) return 0 end -local wingBitmaps = { "plane.bmp", "delta.bmp", "vtail.bmp" } -local mountBitmaps = { "horz.bmp", "horz-r.bmp", "vert.bmp", "vert-r.bmp" } +local wingBitmaps = { "bmp/plane.bmp", "bmp/delta.bmp", "bmp/vtail.bmp" } +local mountBitmaps = { "bmp/horz.bmp", "bmp/horz-r.bmp", "bmp/vert.bmp", "bmp/vert-r.bmp" } local function runConfigPage(event) fields = configFields @@ -259,17 +259,22 @@ local function runCalibrationPage(event) end lcd.clear() lcd.drawScreenTitle("S6R", page, #pages) - local position = calibrationPositions[1 + calibrationStep] - lcd.drawText(0, 9, "Turn the S6R " .. position, 0) - lcd.drawPixmap(10, 19, position .. ".bmp") - for index = 1, 3, 1 do - local field = fields[index] - lcd.drawText(80, 12+10*index, field[1], 0) - lcd.drawNumber(90, 12+10*index, field[4]/10, LEFT+PREC2) - end + if(calibrationStep < 6) then + local position = calibrationPositions[1 + calibrationStep] + lcd.drawText(0, 9, "Turn the S6R " .. position, 0) + lcd.drawPixmap(10, 19, "bmp/"..position .. ".bmp") + for index = 1, 3, 1 do + local field = fields[index] + lcd.drawText(80, 12+10*index, field[1], 0) + lcd.drawNumber(90, 12+10*index, field[4]/10, LEFT+PREC2) + end - local attr = calibrationState == 0 and INVERS or 0 - lcd.drawText(0, 56, "Press [Enter] when ready", attr) + local attr = calibrationState == 0 and INVERS or 0 + lcd.drawText(0, 56, "Press [Enter] when ready", attr) + else + lcd.drawText(0, 9, "Calibration completed", 0) + lcd.drawText(0, 56, "Press [Enter] when ready", attr) + end if event == EVT_ENTER_BREAK then calibrationState = 1 elseif event == EVT_EXIT_BREAK then diff --git a/radio/sdcard/taranis/S6R/back.bmp b/radio/sdcard/taranis/S6R/bmp/back.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/back.bmp rename to radio/sdcard/taranis/S6R/bmp/back.bmp diff --git a/radio/sdcard/taranis/S6R/delta.bmp b/radio/sdcard/taranis/S6R/bmp/delta.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/delta.bmp rename to radio/sdcard/taranis/S6R/bmp/delta.bmp diff --git a/radio/sdcard/taranis/S6R/down.bmp b/radio/sdcard/taranis/S6R/bmp/down.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/down.bmp rename to radio/sdcard/taranis/S6R/bmp/down.bmp diff --git a/radio/sdcard/taranis/S6R/forward.bmp b/radio/sdcard/taranis/S6R/bmp/forward.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/forward.bmp rename to radio/sdcard/taranis/S6R/bmp/forward.bmp diff --git a/radio/sdcard/taranis/S6R/horz-r.bmp b/radio/sdcard/taranis/S6R/bmp/horz-r.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/horz-r.bmp rename to radio/sdcard/taranis/S6R/bmp/horz-r.bmp diff --git a/radio/sdcard/taranis/S6R/horz.bmp b/radio/sdcard/taranis/S6R/bmp/horz.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/horz.bmp rename to radio/sdcard/taranis/S6R/bmp/horz.bmp diff --git a/radio/sdcard/taranis/S6R/left.bmp b/radio/sdcard/taranis/S6R/bmp/left.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/left.bmp rename to radio/sdcard/taranis/S6R/bmp/left.bmp diff --git a/radio/sdcard/taranis/S6R/plane.bmp b/radio/sdcard/taranis/S6R/bmp/plane.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/plane.bmp rename to radio/sdcard/taranis/S6R/bmp/plane.bmp diff --git a/radio/sdcard/taranis/S6R/right.bmp b/radio/sdcard/taranis/S6R/bmp/right.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/right.bmp rename to radio/sdcard/taranis/S6R/bmp/right.bmp diff --git a/radio/sdcard/taranis/S6R/up.bmp b/radio/sdcard/taranis/S6R/bmp/up.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/up.bmp rename to radio/sdcard/taranis/S6R/bmp/up.bmp diff --git a/radio/sdcard/taranis/S6R/vert-r.bmp b/radio/sdcard/taranis/S6R/bmp/vert-r.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/vert-r.bmp rename to radio/sdcard/taranis/S6R/bmp/vert-r.bmp diff --git a/radio/sdcard/taranis/S6R/vert.bmp b/radio/sdcard/taranis/S6R/bmp/vert.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/vert.bmp rename to radio/sdcard/taranis/S6R/bmp/vert.bmp diff --git a/radio/sdcard/taranis/S6R/vtail.bmp b/radio/sdcard/taranis/S6R/bmp/vtail.bmp similarity index 100% rename from radio/sdcard/taranis/S6R/vtail.bmp rename to radio/sdcard/taranis/S6R/bmp/vtail.bmp