headlights reminder
This commit is contained in:
@@ -46,6 +46,9 @@ Screen list
|
|||||||
|
|
||||||
## Release notes
|
## Release notes
|
||||||
|
|
||||||
|
### v1.7.3 2020-11-11
|
||||||
|
- Headlights reminder (if drive mode & headlights are off)
|
||||||
|
|
||||||
### v1.7.2 2020-11-10
|
### v1.7.2 2020-11-10
|
||||||
- improved charging graph
|
- improved charging graph
|
||||||
|
|
||||||
|
|||||||
@@ -93,19 +93,15 @@ bool parseRowMergedKiaENiro() {
|
|||||||
// ABS / ESP + AHB 7D1
|
// ABS / ESP + AHB 7D1
|
||||||
if (currentAtshRequest.equals("ATSH7D1")) {
|
if (currentAtshRequest.equals("ATSH7D1")) {
|
||||||
if (commandRequest.equals("22C101")) {
|
if (commandRequest.equals("22C101")) {
|
||||||
params.driveMode = hexToDec(responseRowMerged.substring(22, 24).c_str(), 1, false);
|
uint8_t driveMode = hexToDec(responseRowMerged.substring(22, 24).c_str(), 1, false);
|
||||||
// 7 (val 128)
|
params.forwardDriveMode = (driveMode == 4);
|
||||||
// 6 (val 64)
|
params.reverseDriveMode = (driveMode == 2);
|
||||||
// 5 (val 32)
|
params.parkModeOrNeutral = (driveMode == 1);
|
||||||
// 4 (val 16)
|
// 2 (val 4) DRIVE mode // 1 (val 2) REVERSE mode // 0 (val 1) PARK mode / NEUTRAL
|
||||||
// 3 (val 8)
|
|
||||||
// 2 (val 4) DRIVE mode
|
|
||||||
// 1 (val 2) REVERSE mode
|
|
||||||
// 0 (val 1) PARK mode / NEUTRAL
|
|
||||||
/* params.espState = hexToDec(responseRowMerged.substring(42, 44).c_str(), 1, false);
|
/* params.espState = hexToDec(responseRowMerged.substring(42, 44).c_str(), 1, false);
|
||||||
// b6 (val 64) 1 - ESP OFF, 0 - ESP ON
|
// b6 (val 64) 1 - ESP OFF, 0 - ESP ON
|
||||||
*/
|
*/
|
||||||
/* params.xxx = hexToDec(responseRowMerged.substring(44, 46).c_str(), 1, false);
|
/* params.xxx = hexToDec(responseRowMerged.substring(44, 46).c_str(), 1, false);
|
||||||
// 5 (val 32) default 1
|
// 5 (val 32) default 1
|
||||||
// 4 (val 16) default 1
|
// 4 (val 16) default 1
|
||||||
// 2 (val 4) BRAKE PRESSED
|
// 2 (val 4) BRAKE PRESSED
|
||||||
@@ -117,17 +113,20 @@ bool parseRowMergedKiaENiro() {
|
|||||||
if (currentAtshRequest.equals("ATSH770")) {
|
if (currentAtshRequest.equals("ATSH770")) {
|
||||||
if (commandRequest.equals("22BC03")) {
|
if (commandRequest.equals("22BC03")) {
|
||||||
params.lightInfo = hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false);
|
params.lightInfo = hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false);
|
||||||
|
params.headLights = (bitRead(params.lightInfo, 5) == 1);
|
||||||
|
params.dayLights = (bitRead(params.lightInfo, 3) == 1);
|
||||||
|
// low beam 44, dimmed light only 12
|
||||||
// 7 (val 128)
|
// 7 (val 128)
|
||||||
// 6 (val 64)
|
// 6 (val 64)
|
||||||
// 5 (val 32)
|
// 5 (val 32) headlights on
|
||||||
// 4 (val 16)
|
// 4 (val 16)
|
||||||
// 3 (val 8)
|
// 3 (val 8) daylights on
|
||||||
// 2 (val 4
|
// 2 (val 4 daylights on
|
||||||
// 1 (val 2)
|
// 1 (val 2)
|
||||||
// 0 (val 1)
|
// 0 (val 1)
|
||||||
}
|
}
|
||||||
if (commandRequest.equals("22BC06")) {
|
if (commandRequest.equals("22BC06")) {
|
||||||
params.brakeLightInfo = hexToDec(responseRowMerged.substring(14, 18).c_str(), 1, false);
|
params.brakeLightInfo = hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false);
|
||||||
// 7 (val 128)
|
// 7 (val 128)
|
||||||
// 6 (val 64)
|
// 6 (val 64)
|
||||||
// 5 (val 32)
|
// 5 (val 32)
|
||||||
|
|||||||
BIN
dist/enirodashboard.ino.bin
vendored
BIN
dist/enirodashboard.ino.bin
vendored
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
KIA eNiro Dashboard 1.7.2, 2020-11-10
|
KIA eNiro Dashboard 1.7.3, 2020-11-11
|
||||||
!! working only with OBD BLE 4.0 adapters
|
!! working only with OBD BLE 4.0 adapters
|
||||||
!! Supported adapter is Vgate ICar Pro (must be BLE4.0 version)
|
!! Supported adapter is Vgate ICar Pro (must be BLE4.0 version)
|
||||||
!! Not working with standard BLUETOOTH 3 adapters
|
!! Not working with standard BLUETOOTH 3 adapters
|
||||||
@@ -107,6 +107,8 @@ byte displayScreenAutoMode = 0;
|
|||||||
bool btnLeftPressed = true;
|
bool btnLeftPressed = true;
|
||||||
bool btnMiddlePressed = true;
|
bool btnMiddlePressed = true;
|
||||||
bool btnRightPressed = true;
|
bool btnRightPressed = true;
|
||||||
|
bool nextFrameFullRedraw = true;
|
||||||
|
bool testDataMode = false;
|
||||||
|
|
||||||
// Menu id/parent/title
|
// Menu id/parent/title
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -277,8 +279,12 @@ bool initStructure() {
|
|||||||
|
|
||||||
params.chargingStartTime = params.currentTime = 0;
|
params.chargingStartTime = params.currentTime = 0;
|
||||||
params.lightInfo = 0;
|
params.lightInfo = 0;
|
||||||
|
params.headLights = false;
|
||||||
|
params.dayLights = false;
|
||||||
params.brakeLightInfo = 0;
|
params.brakeLightInfo = 0;
|
||||||
params.driveMode = 0;
|
params.forwardDriveMode = false;
|
||||||
|
params.reverseDriveMode = false;
|
||||||
|
params.parkModeOrNeutral = false;
|
||||||
params.espState = 0;
|
params.espState = 0;
|
||||||
params.speedKmh = -1;
|
params.speedKmh = -1;
|
||||||
params.odoKm = -1;
|
params.odoKm = -1;
|
||||||
@@ -707,11 +713,11 @@ bool drawSceneSpeed(bool force) {
|
|||||||
tft.setTextDatum(MR_DATUM);
|
tft.setTextDatum(MR_DATUM);
|
||||||
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
||||||
sprintf(tmpStr3, " %d", params.brakeLightInfo);
|
sprintf(tmpStr3, " %d", params.brakeLightInfo);
|
||||||
tft.drawString(tmpStr3, 250, 20, GFXFF);
|
|
||||||
sprintf(tmpStr3, " %d", params.lightInfo);
|
|
||||||
tft.drawString(tmpStr3, 250, 50, GFXFF);
|
tft.drawString(tmpStr3, 250, 50, GFXFF);
|
||||||
sprintf(tmpStr3, " %d", params.driveMode);
|
sprintf(tmpStr3, " %d", params.lightInfo);
|
||||||
tft.drawString(tmpStr3, 250, 80, GFXFF);
|
tft.drawString(tmpStr3, 250, 80, GFXFF);
|
||||||
|
//sprintf(tmpStr3, " %d", params.driveMode);
|
||||||
|
//tft.drawString(tmpStr3, 250, 80, GFXFF);
|
||||||
|
|
||||||
// Soc%, bat.kWh
|
// Soc%, bat.kWh
|
||||||
tft.setFreeFont(&Orbitron_Light_32);
|
tft.setFreeFont(&Orbitron_Light_32);
|
||||||
@@ -1189,6 +1195,7 @@ bool menuItemClick() {
|
|||||||
*/
|
*/
|
||||||
bool redrawScreen(bool force) {
|
bool redrawScreen(bool force) {
|
||||||
|
|
||||||
|
nextFrameFullRedraw = false;
|
||||||
if (menuVisible) {
|
if (menuVisible) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1198,6 +1205,17 @@ bool redrawScreen(bool force) {
|
|||||||
tft.fillScreen(TFT_BLACK);
|
tft.fillScreen(TFT_BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lights not enabled
|
||||||
|
if (!testDataMode && params.forwardDriveMode && !params.headLights && !params.dayLights) {
|
||||||
|
tft.fillScreen(TFT_RED);
|
||||||
|
tft.setFreeFont(&Orbitron_Light_32);
|
||||||
|
tft.setTextColor(TFT_WHITE, TFT_RED);
|
||||||
|
tft.setTextDatum(MC_DATUM);
|
||||||
|
tft.drawString("! LIGHTS OFF !", 160, 120, GFXFF);
|
||||||
|
nextFrameFullRedraw = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Auto mode = >5kpm Screen 3 - speed, other wise basic Screen2 - Main screen, if charging then Screen 5 Graph
|
// 1. Auto mode = >5kpm Screen 3 - speed, other wise basic Screen2 - Main screen, if charging then Screen 5 Graph
|
||||||
if (displayScreen == 1) {
|
if (displayScreen == 1) {
|
||||||
if (params.speedKmh > 5) {
|
if (params.speedKmh > 5) {
|
||||||
@@ -1262,7 +1280,7 @@ bool doNextAtCommand() {
|
|||||||
if (commandQueueIndex >= commandQueueCount) {
|
if (commandQueueIndex >= commandQueueCount) {
|
||||||
commandQueueIndex = commandQueueLoopFrom;
|
commandQueueIndex = commandQueueLoopFrom;
|
||||||
// Redraw only changed values
|
// Redraw only changed values
|
||||||
redrawScreen(false);
|
redrawScreen(nextFrameFullRedraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send AT command to obd
|
// Send AT command to obd
|
||||||
@@ -1331,6 +1349,7 @@ bool testData() {
|
|||||||
|
|
||||||
if (settings.carType == CAR_KIA_ENIRO_2020_64 || settings.carType == CAR_HYUNDAI_KONA_2020_64 ||
|
if (settings.carType == CAR_KIA_ENIRO_2020_64 || settings.carType == CAR_HYUNDAI_KONA_2020_64 ||
|
||||||
settings.carType == CAR_KIA_ENIRO_2020_39 || settings.carType == CAR_HYUNDAI_KONA_2020_39) {
|
settings.carType == CAR_KIA_ENIRO_2020_39 || settings.carType == CAR_HYUNDAI_KONA_2020_39) {
|
||||||
|
testDataMode = true;
|
||||||
testDataKiaENiro();
|
testDataKiaENiro();
|
||||||
}
|
}
|
||||||
if (settings.carType == CAR_HYUNDAI_IONIQ_2018) {
|
if (settings.carType == CAR_HYUNDAI_IONIQ_2018) {
|
||||||
|
|||||||
6
struct.h
6
struct.h
@@ -21,7 +21,11 @@ String currentAtshRequest = "";
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
time_t currentTime;
|
time_t currentTime;
|
||||||
time_t chargingStartTime;
|
time_t chargingStartTime;
|
||||||
uint8_t driveMode;
|
bool forwardDriveMode;
|
||||||
|
bool reverseDriveMode;
|
||||||
|
bool parkModeOrNeutral;
|
||||||
|
bool headLights;
|
||||||
|
bool dayLights;
|
||||||
uint8_t lightInfo;
|
uint8_t lightInfo;
|
||||||
uint8_t brakeLightInfo;
|
uint8_t brakeLightInfo;
|
||||||
uint8_t espState;
|
uint8_t espState;
|
||||||
|
|||||||
Reference in New Issue
Block a user