draw via sprice (removed screen flickering), and pre-drawn charging graphs

This commit is contained in:
Lubos Petrovic
2020-11-25 12:35:27 +01:00
parent fcb3379d1e
commit 15b66c5636
5 changed files with 396 additions and 272 deletions

View File

@@ -4,10 +4,7 @@ Supported devices
1. LILYGO TTGO T4 v1.3 1. LILYGO TTGO T4 v1.3
2. M5STACK CORE1 IOT Development Kit 2. M5STACK CORE1 IOT Development Kit
Working with only with electric vehicles. Vgate iCar Pro Bluetooth 4.0 (BLE4) OBD2 adapter is required. Working only with electric vehicles (Kia e-NIRO (EV), Hyundai Kona EV, Hyundai Ioniq EV). Vgate iCar Pro Bluetooth 4.0 (BLE4) OBD2 adapter is required. See Release notes, quick installation via flash tool bellow.
- Kia e-NIRO (EV)
- Hyundai Kona EV
- Hyundai Ioniq EV
Use it at your own risk! Use it at your own risk!
Author: nick.n17@gmail.com (Lubos Petrovic / Slovakia) Author: nick.n17@gmail.com (Lubos Petrovic / Slovakia)
@@ -61,6 +58,13 @@ Screen list
## Release notes ## Release notes
### v1.8.2 2020-11-25
- Removed screen flickering. (via Sprites, esp32 with SRAM is now required!)
### v1.8.1 2020-11-23
- Pre-drawn charging graphs (based on coldgates)
- Show version in menu
### v1.8.0 2020-11-20 ### v1.8.0 2020-11-20
- Support for new device m5stack core1 iot development kit - Support for new device m5stack core1 iot development kit
- TTGO T4 is still supported device! - TTGO T4 is still supported device!

View File

@@ -97,4 +97,12 @@
#define TFT_TEMP 0x0000 // NAVY #define TFT_TEMP 0x0000 // NAVY
#define TFT_GREENYELLOW 0xB7E0 #define TFT_GREENYELLOW 0xB7E0
#define TFT_DARKRED 0x3800 /* 128, 0, 0 */ #define TFT_DARKRED 0x3800 /* 128, 0, 0 */
#define TFT_DARKRED2 0x1800 /* 128, 0, 0 */
#define TFT_DARKGREEN2 0x01E0 /* 128, 0, 0 */ #define TFT_DARKGREEN2 0x01E0 /* 128, 0, 0 */
// COLDGATE COLORS
#define TFT_GRAPH_COLDGATE0_5 0x4208
#define TFT_GRAPH_COLDGATE5_14 0x6000
#define TFT_GRAPH_COLDGATE15_24 0x0008
#define TFT_GRAPH_OPTIMAL25 0x0200
#define TFT_GRAPH_RAPIDGATE35 0x8300

File diff suppressed because it is too large Load Diff

8
menu.h
View File

@@ -8,7 +8,7 @@ typedef struct {
char serviceUUID[40]; char serviceUUID[40];
} MENU_ITEM; } MENU_ITEM;
#define menuItemsCount 61 #define menuItemsCount 66
bool menuVisible = false; bool menuVisible = false;
uint16_t menuCurrent = 0; uint16_t menuCurrent = 0;
uint8_t menuItemSelected = 0; uint8_t menuItemSelected = 0;
@@ -22,6 +22,7 @@ MENU_ITEM menuItems[menuItemsCount] = {
{4, 0, -1, "Units"}, {4, 0, -1, "Units"},
{8, 0, -1, "Factory reset"}, {8, 0, -1, "Factory reset"},
{9, 0, -1, "Save settings"}, {9, 0, -1, "Save settings"},
{10, 0, -1, "Version"},
{100, 1, 0, "<- parent menu"}, {100, 1, 0, "<- parent menu"},
{101, 1, -1, "Kia eNiro 2020 64kWh"}, {101, 1, -1, "Kia eNiro 2020 64kWh"},
@@ -37,6 +38,7 @@ MENU_ITEM menuItems[menuItemsCount] = {
{302, 3, -1, "Default screen"}, {302, 3, -1, "Default screen"},
{303, 3, -1, "Debug screen off/on"}, {303, 3, -1, "Debug screen off/on"},
{304, 3, -1, "LCD brightness"}, {304, 3, -1, "LCD brightness"},
{305, 3, -1, "Pre-drawn ch.graphs 0/1"},
{400, 4, 0, "<- parent menu"}, {400, 4, 0, "<- parent menu"},
{401, 4, -1, "Distance"}, {401, 4, -1, "Distance"},
@@ -64,6 +66,10 @@ MENU_ITEM menuItems[menuItemsCount] = {
{3043, 304, -1, "50%"}, {3043, 304, -1, "50%"},
{3044, 304, -1, "100%"}, {3044, 304, -1, "100%"},
{3050, 305, 3, "<- parent menu"},
{3051, 305, -1, "Off"},
{3052, 305, -1, "On"},
{4010, 401, 4, "<- parent menu"}, {4010, 401, 4, "<- parent menu"},
{4011, 401, -1, "Kilometers"}, {4011, 401, -1, "Kilometers"},
{4012, 401, -1, "Miles"}, {4012, 401, -1, "Miles"},

View File

@@ -118,7 +118,7 @@ typedef struct {
// Setting stored to flash // Setting stored to flash
typedef struct { typedef struct {
byte initFlag; // 183 value byte initFlag; // 183 value
byte settingsVersion; // current 2 byte settingsVersion; // current 3
uint16_t carType; // 0 - Kia eNiro 2020, 1 - Hyundai Kona 2020, 2 - Hyudai Ioniq 2018 uint16_t carType; // 0 - Kia eNiro 2020, 1 - Hyundai Kona 2020, 2 - Hyudai Ioniq 2018
char obdMacAddress[20]; char obdMacAddress[20];
char serviceUUID[40]; char serviceUUID[40];
@@ -132,6 +132,7 @@ typedef struct {
byte defaultScreen; // 1 .. 6 byte defaultScreen; // 1 .. 6
byte lcdBrightness; // 0 - auto, 1 .. 100% byte lcdBrightness; // 0 - auto, 1 .. 100%
byte debugScreen; // 0 - off, 1 - on byte debugScreen; // 0 - off, 1 - on
byte predrawnChargingGraphs; // 0 - off, 1 - on
} SETTINGS_STRUC; } SETTINGS_STRUC;
PARAMS_STRUC params; // Realtime sensor values PARAMS_STRUC params; // Realtime sensor values