door status
This commit is contained in:
@@ -1063,7 +1063,24 @@ void Board320_240::menuItemClick() {
|
|||||||
// Save settings
|
// Save settings
|
||||||
case 9: saveSettings(); break;
|
case 9: saveSettings(); break;
|
||||||
// Version
|
// Version
|
||||||
case 10: hideMenu(); return;
|
case 10:
|
||||||
|
/* commInterface->executeCommand("ATSH770");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("3E");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("1003");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("2FBC1003");
|
||||||
|
delay(5000);
|
||||||
|
commInterface->executeCommand("ATSH770");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("3E");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("1003");
|
||||||
|
delay(50);
|
||||||
|
commInterface->executeCommand("2FBC1103");
|
||||||
|
delay(5000);*/
|
||||||
|
hideMenu(); return;
|
||||||
// Shutdown
|
// Shutdown
|
||||||
case 11: shutdownDevice(); return;
|
case 11: shutdownDevice(); return;
|
||||||
default:
|
default:
|
||||||
@@ -1182,6 +1199,7 @@ void Board320_240::redrawScreen() {
|
|||||||
TFT_YELLOW /* failed to initialize sdcard */
|
TFT_YELLOW /* failed to initialize sdcard */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// GPS state
|
||||||
if (gpsHwUart != NULL && (displayScreen == SCREEN_SPEED || displayScreenAutoMode == SCREEN_SPEED)) {
|
if (gpsHwUart != NULL && (displayScreen == SCREEN_SPEED || displayScreenAutoMode == SCREEN_SPEED)) {
|
||||||
spr.drawCircle(160, 10, 5, (gps.location.isValid()) ? TFT_GREEN : TFT_RED);
|
spr.drawCircle(160, 10, 5, (gps.location.isValid()) ? TFT_GREEN : TFT_RED);
|
||||||
spr.setTextSize(1);
|
spr.setTextSize(1);
|
||||||
@@ -1189,9 +1207,22 @@ void Board320_240::redrawScreen() {
|
|||||||
spr.setTextDatum(TL_DATUM);
|
spr.setTextDatum(TL_DATUM);
|
||||||
sprintf(tmpStr1, "%d", liveData->params.gpsSat);
|
sprintf(tmpStr1, "%d", liveData->params.gpsSat);
|
||||||
spr.drawString(tmpStr1, 174, 2, 2);
|
spr.drawString(tmpStr1, 174, 2, 2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Door status
|
||||||
|
if (liveData->params.trunkDoorOpen)
|
||||||
|
spr.fillRect(20, 0, 320 - 40, 20, TFT_YELLOW);
|
||||||
|
if (liveData->params.leftFrontDoorOpen)
|
||||||
|
spr.fillRect(0, 20, 20, 98, TFT_YELLOW);
|
||||||
|
if (liveData->params.rightFrontDoorOpen)
|
||||||
|
spr.fillRect(0, 122, 20, 98, TFT_YELLOW);
|
||||||
|
if (liveData->params.leftRearDoorOpen)
|
||||||
|
spr.fillRect(320 - 20, 20, 20, 98, TFT_YELLOW);
|
||||||
|
if (liveData->params.rightRearDoorOpen)
|
||||||
|
spr.fillRect(320 - 20, 122, 20, 98, TFT_YELLOW);
|
||||||
|
if (liveData->params.hoodOpen)
|
||||||
|
spr.fillRect(20, 240 - 20, 320 - 40, 20, TFT_YELLOW);
|
||||||
|
|
||||||
// BLE not connected
|
// BLE not connected
|
||||||
if (!liveData->commConnected && liveData->bleConnect && liveData->tmpSettings.commType == COMM_TYPE_OBD2BLE4) {
|
if (!liveData->commConnected && liveData->bleConnect && liveData->tmpSettings.commType == COMM_TYPE_OBD2BLE4) {
|
||||||
// Print message
|
// Print message
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ void CarHyundaiIoniq::activateCommandQueue() {
|
|||||||
*/
|
*/
|
||||||
void CarHyundaiIoniq::parseRowMerged() {
|
void CarHyundaiIoniq::parseRowMerged() {
|
||||||
|
|
||||||
bool tempByte;
|
uint8_t tempByte;
|
||||||
float tempFloat;
|
float tempFloat;
|
||||||
String tmpStr;
|
String tmpStr;
|
||||||
|
|
||||||
@@ -112,13 +112,13 @@ void CarHyundaiIoniq::parseRowMerged() {
|
|||||||
int32_t secDiff = liveData->params.currentTime - liveData->params.currentTime;
|
int32_t secDiff = liveData->params.currentTime - liveData->params.currentTime;
|
||||||
if (liveData->commConnected && secDiff > 30 && secDiff < MONTH_SEC && !liveData->params.ignitionOn && !liveData->params.chargingOn)
|
if (liveData->commConnected && secDiff > 30 && secDiff < MONTH_SEC && !liveData->params.ignitionOn && !liveData->params.chargingOn)
|
||||||
liveData->params.automaticShutdownTimer = liveData->params.currentTime;
|
liveData->params.automaticShutdownTimer = liveData->params.currentTime;
|
||||||
liveData->params.lightInfo = liveData->hexToDecFromResponse(18, 20, 1, false);
|
tempByte = liveData->hexToDecFromResponse(18, 20, 1, false);
|
||||||
liveData->params.headLights = (bitRead(liveData->params.lightInfo, 5) == 1);
|
liveData->params.headLights = (bitRead(tempByte, 5) == 1);
|
||||||
liveData->params.dayLights = (bitRead(liveData->params.lightInfo, 3) == 1);
|
liveData->params.dayLights = (bitRead(tempByte, 3) == 1);
|
||||||
}
|
}
|
||||||
if (liveData->commandRequest.equals("22BC06")) {
|
if (liveData->commandRequest.equals("22BC06")) {
|
||||||
liveData->params.brakeLightInfo = liveData->hexToDecFromResponse(14, 16, 1, false);
|
tempByte = liveData->hexToDecFromResponse(14, 16, 1, false);
|
||||||
liveData->params.brakeLights = (bitRead(liveData->params.brakeLightInfo, 5) == 1);
|
liveData->params.brakeLights = (bitRead(tempByte, 5) == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* eNiro/Kona chargings limits depending on battery temperature (min.value of 01-04 battery module)
|
eNiro/Kona chargings limits depending on battery temperature (min.value of 01-04 battery module)
|
||||||
>= 35°C BMS allows max 180A
|
>= 35°C BMS allows max 180A
|
||||||
>= 25°C without limit (200A)
|
>= 25°C without limit (200A)
|
||||||
>= 15°C BMS allows max 120A
|
>= 15°C BMS allows max 120A
|
||||||
>= 5°C BMS allows max 90A
|
>= 5°C BMS allows max 90A
|
||||||
>= 1°C BMS allows max 60A
|
>= 1°C BMS allows max 60A
|
||||||
<= 0°C BMS allows max 40A
|
<= 0°C BMS allows max 40A
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
#define commandQueueLoopFromKiaENiro 8
|
#define commandQueueLoopFromKiaENiro 8
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* activateCommandQueue
|
activateCommandQueue
|
||||||
*/
|
*/
|
||||||
void CarKiaEniro::activateCommandQueue() {
|
void CarKiaEniro::activateCommandQueue() {
|
||||||
|
|
||||||
String commandQueueKiaENiro[commandQueueCountKiaENiro] = {
|
String commandQueueKiaENiro[commandQueueCountKiaENiro] = {
|
||||||
@@ -102,11 +102,11 @@ void CarKiaEniro::activateCommandQueue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseRowMerged
|
parseRowMerged
|
||||||
*/
|
*/
|
||||||
void CarKiaEniro::parseRowMerged() {
|
void CarKiaEniro::parseRowMerged() {
|
||||||
|
|
||||||
bool tempByte;
|
uint8_t tempByte;
|
||||||
float tempFloat;
|
float tempFloat;
|
||||||
String tmpStr;
|
String tmpStr;
|
||||||
|
|
||||||
@@ -123,21 +123,31 @@ void CarKiaEniro::parseRowMerged() {
|
|||||||
// IGPM
|
// IGPM
|
||||||
if (liveData->currentAtshRequest.equals("ATSH770")) {
|
if (liveData->currentAtshRequest.equals("ATSH770")) {
|
||||||
if (liveData->commandRequest.equals("22BC03")) {
|
if (liveData->commandRequest.equals("22BC03")) {
|
||||||
|
//
|
||||||
|
tempByte = liveData->hexToDecFromResponse(14, 16, 1, false);
|
||||||
|
liveData->params.trunkDoorOpen = (bitRead(tempByte, 7) == 1);
|
||||||
|
liveData->params.leftFrontDoorOpen = (bitRead(tempByte, 5) == 1);
|
||||||
|
liveData->params.rightFrontDoorOpen = (bitRead(tempByte, 4) == 1);
|
||||||
|
liveData->params.rightRearDoorOpen = (bitRead(tempByte, 2) == 1);
|
||||||
|
liveData->params.leftRearDoorOpen = (bitRead(tempByte, 0) == 1);
|
||||||
|
//
|
||||||
tempByte = liveData->hexToDecFromResponse(16, 18, 1, false);
|
tempByte = liveData->hexToDecFromResponse(16, 18, 1, false);
|
||||||
liveData->params.ignitionOn = (bitRead(tempByte, 5) == 1);
|
liveData->params.ignitionOn = (bitRead(tempByte, 5) == 1);
|
||||||
|
liveData->params.hoodOpen = (bitRead(tempByte, 0) == 1);
|
||||||
if (liveData->params.ignitionOn) {
|
if (liveData->params.ignitionOn) {
|
||||||
liveData->params.lastIgnitionOnTime = liveData->params.currentTime;
|
liveData->params.lastIgnitionOnTime = liveData->params.currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t secDiff = liveData->params.currentTime - liveData->params.currentTime;
|
int32_t secDiff = liveData->params.currentTime - liveData->params.currentTime;
|
||||||
if (liveData->commConnected && secDiff > 30 && secDiff < MONTH_SEC && !liveData->params.ignitionOn && !liveData->params.chargingOn)
|
if (liveData->commConnected && secDiff > 30 && secDiff < MONTH_SEC && !liveData->params.ignitionOn && !liveData->params.chargingOn)
|
||||||
liveData->params.automaticShutdownTimer = liveData->params.currentTime;
|
liveData->params.automaticShutdownTimer = liveData->params.currentTime;
|
||||||
liveData->params.lightInfo = liveData->hexToDecFromResponse(18, 20, 1, false);
|
tempByte = liveData->hexToDecFromResponse(18, 20, 1, false);
|
||||||
liveData->params.headLights = (bitRead(liveData->params.lightInfo, 5) == 1);
|
liveData->params.headLights = (bitRead(tempByte, 5) == 1);
|
||||||
liveData->params.dayLights = (bitRead(liveData->params.lightInfo, 3) == 1);
|
liveData->params.dayLights = (bitRead(tempByte, 3) == 1);
|
||||||
}
|
}
|
||||||
if (liveData->commandRequest.equals("22BC06")) {
|
if (liveData->commandRequest.equals("22BC06")) {
|
||||||
liveData->params.brakeLightInfo = liveData->hexToDecFromResponse(14, 16, 1, false);
|
tempByte = liveData->hexToDecFromResponse(14, 16, 1, false);
|
||||||
liveData->params.brakeLights = (bitRead(liveData->params.brakeLightInfo, 5) == 1);
|
liveData->params.brakeLights = (bitRead(tempByte, 5) == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,8 +315,8 @@ void CarKiaEniro::parseRowMerged() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loadTestData
|
loadTestData
|
||||||
*/
|
*/
|
||||||
void CarKiaEniro::loadTestData() {
|
void CarKiaEniro::loadTestData() {
|
||||||
|
|
||||||
// IGPM
|
// IGPM
|
||||||
|
|||||||
@@ -28,15 +28,18 @@ void LiveData::initParams() {
|
|||||||
params.operationTimeSec = 0;
|
params.operationTimeSec = 0;
|
||||||
params.chargingStartTime = params.currentTime = 0;
|
params.chargingStartTime = params.currentTime = 0;
|
||||||
params.chargingOn = false;
|
params.chargingOn = false;
|
||||||
params.lightInfo = 0;
|
|
||||||
params.headLights = false;
|
params.headLights = false;
|
||||||
params.dayLights = false;
|
params.dayLights = false;
|
||||||
params.brakeLights = false;
|
params.brakeLights = false;
|
||||||
params.brakeLightInfo = 0;
|
params.trunkDoorOpen = false;
|
||||||
|
params.leftFrontDoorOpen = false;
|
||||||
|
params.rightFrontDoorOpen = false;
|
||||||
|
params.leftRearDoorOpen = false;
|
||||||
|
params.rightRearDoorOpen = false;
|
||||||
|
params.hoodOpen = false;
|
||||||
params.forwardDriveMode = false;
|
params.forwardDriveMode = false;
|
||||||
params.reverseDriveMode = false;
|
params.reverseDriveMode = false;
|
||||||
params.parkModeOrNeutral = false;
|
params.parkModeOrNeutral = false;
|
||||||
params.espState = 0;
|
|
||||||
params.speedKmh = -1;
|
params.speedKmh = -1;
|
||||||
params.motorRpm = -1;
|
params.motorRpm = -1;
|
||||||
params.odoKm = -1;
|
params.odoKm = -1;
|
||||||
|
|||||||
10
LiveData.h
10
LiveData.h
@@ -68,9 +68,15 @@ typedef struct {
|
|||||||
bool headLights;
|
bool headLights;
|
||||||
bool dayLights;
|
bool dayLights;
|
||||||
bool brakeLights;
|
bool brakeLights;
|
||||||
uint8_t lightInfo;
|
bool trunkDoorOpen;
|
||||||
|
bool leftFrontDoorOpen;
|
||||||
|
bool rightFrontDoorOpen;
|
||||||
|
bool leftRearDoorOpen;
|
||||||
|
bool rightRearDoorOpen;
|
||||||
|
bool hoodOpen;
|
||||||
|
/* uint8_t lightInfo;
|
||||||
uint8_t brakeLightInfo;
|
uint8_t brakeLightInfo;
|
||||||
uint8_t espState;
|
uint8_t espState;*/
|
||||||
float batteryTotalAvailableKWh;
|
float batteryTotalAvailableKWh;
|
||||||
float speedKmh;
|
float speedKmh;
|
||||||
float motorRpm;
|
float motorRpm;
|
||||||
|
|||||||
Reference in New Issue
Block a user