code cleaning

This commit is contained in:
Lubos Petrovic
2020-12-28 22:57:58 +01:00
parent aa1f9943d1
commit ceec907c74
3 changed files with 28 additions and 31 deletions

View File

@@ -1170,7 +1170,17 @@ void Board320_240::menuItemClick() {
case 4031: liveData->settings.pressureUnit = 'b'; showParentMenu = true; break;
case 4032: liveData->settings.pressureUnit = 'p'; showParentMenu = true; break;
// Pair ble device
case 2: scanDevices = true; liveData->menuCurrent = 9999; commInterface->scanDevices(); return;
case 2:
if (liveData->settings.commType == COMM_TYPE_OBD2CAN) {
displayMessage("Not supported", "in CAN mode");
delay(3000);
hideMenu();
return;
}
scanDevices = true;
liveData->menuCurrent = 9999;
commInterface->scanDevices();
return;
// Reset settings
case 8: resetSettings(); hideMenu(); return;
// Save settings

View File

@@ -96,7 +96,7 @@ void BoardInterface::loadSettings() {
// Default settings
liveData->settings.initFlag = 183;
liveData->settings.settingsVersion = 5;
liveData->settings.settingsVersion = 6;
liveData->settings.carType = CAR_KIA_ENIRO_2020_64;
tmpStr = "00:00:00:00:00:00"; // Pair via menu (middle button)
tmpStr.toCharArray(liveData->settings.obdMacAddress, tmpStr.length() + 1);
@@ -198,7 +198,7 @@ void BoardInterface::loadSettings() {
if (liveData->tmpSettings.settingsVersion == 5) {
liveData->tmpSettings.settingsVersion = 6;
liveData->tmpSettings.serialConsolePort = 0; // hwuart0
liveData->tmpSettings.debugLevel = 1; // 1 - debug communication (BLE/CAN)
liveData->tmpSettings.debugLevel = 0; // show all
liveData->tmpSettings.sdcardLogIntervalSec = 2;
liveData->tmpSettings.gprsLogIntervalSec = 60;
}

17
menu.h
View File

@@ -29,7 +29,7 @@ MENU_ITEM menuItemsSource[100] = {
{MENU_ADAPTER_BLE4-1, MENU_ADAPTER_TYPE, 0, "<- parent menu"},
{MENU_ADAPTER_BLE4, MENU_ADAPTER_TYPE, -1, "Bluetooth 4 (BLE4)"},
{MENU_ADAPTER_CAN, MENU_ADAPTER_TYPE, -1, "CAN bus (MCP2515-1/SO)"},
{MENU_ADAPTER_BT3, MENU_ADAPTER_TYPE, -1, "Bluetooth 3 (dev)"},
//{MENU_ADAPTER_BT3, MENU_ADAPTER_TYPE, -1, "Bluetooth 3 (dev)"},
{300, 3, 0, "<- parent menu"},
// {MENU_WIFI, 3, -1, "[dev] WiFi network"},
@@ -47,19 +47,6 @@ MENU_ITEM menuItemsSource[100] = {
{MENU_HEADLIGHTS_REMINDER, 3, -1, "Headlight reminder"},
{MENU_SLEEP_MODE, 3, -1, "SleepMode"},
/*
// NTP
byte ntpEnabled; // 0/1
byte ntpTimezone;
byte ntpDaySaveTime; // 0/1
// GPRS SIM800L
byte gprsEnabled; // 0/1
char gprsApn[64];
// Remote upload
byte remoteUploadEnabled; // 0/1
char remoteApiUrl[64];
char remoteApiKey[32];*/
{400, 4, 0, "<- parent menu"},
{MENU_DISTANCE_UNIT, 4, -1, "Distance"},
{MENU_TEMPERATURE_UNIT, 4, -1, "Temperature"},
@@ -75,7 +62,7 @@ MENU_ITEM menuItemsSource[100] = {
{MENU_SDCARD_AUTOSTARTLOG, MENU_SDCARD, -1, "Autostart log enabled"},
{MENU_SDCARD_MOUNT_STATUS, MENU_SDCARD, -1, "Status"},
{MENU_SDCARD_REC, MENU_SDCARD, -1, "Record"},
{MENU_SDCARD_INTERVAL, MENU_SDCARD, -1, "Log interval sec."},
//{MENU_SDCARD_INTERVAL, MENU_SDCARD, -1, "Log interval sec."},
{3060, 306, 3, "<- parent menu"},
{3061, 306, -1, "Auto mode"},