improved menu (added scroll support), m5stack speaker fix
This commit is contained in:
@@ -61,10 +61,10 @@ Screen list
|
||||
|
||||
[](https://www.youtube.com/watch?v=Jg5VP2P58Yg&)
|
||||
|
||||
## Release notes
|
||||
|
||||
- Fixed menu
|
||||
### v1.8.3 2020-11-28
|
||||
- Automatic shutdown when car goes off
|
||||
- Fixed M5stack speaker noise
|
||||
- Fixed menu, added scroll support
|
||||
|
||||
### v1.8.2 2020-11-25
|
||||
- Removed screen flickering. (via Sprites, esp32 with SRAM is now required!)
|
||||
|
||||
30
config.h
30
config.h
@@ -2,39 +2,52 @@
|
||||
// SELECT HARDWARE !!!!
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
//#define BOARD_TTGO_T4
|
||||
#define BOARD_M5STACK_CORE
|
||||
#define BOARD_TTGO_T4
|
||||
//#define BOARD_M5STACK_CORE
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#define USER_SETUP_LOADED 1
|
||||
#define SPI_FREQUENCY 27000000
|
||||
//#define SPI_READ_FREQUENCY 20000000
|
||||
#define SPI_TOUCH_FREQUENCY 2500000
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// BOARD LILYGO TTGO T4 v1.3
|
||||
/////////////////////////////////////////////////////////////
|
||||
#ifdef BOARD_TTGO_T4
|
||||
|
||||
#define ILI9341_DRIVER
|
||||
#define TFT_MISO 12
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 27
|
||||
#define TFT_DC 26
|
||||
#define TFT_DC 32
|
||||
#define TFT_RST 5
|
||||
//#define TFT_BACKLIGHT_ON HIGH
|
||||
#define TFT_BL 4
|
||||
|
||||
#define USE_HSPI_PORT
|
||||
//#define SPI_FREQUENCY 40000000 // Maximum for ILI9341
|
||||
#define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V
|
||||
|
||||
#define SD_CS 13
|
||||
#define SD_MOSI 15
|
||||
#define SD_MISO 2
|
||||
#define SD_SCLK 14
|
||||
|
||||
#define BUTTON_LEFT 38
|
||||
#define BUTTON_MIDDLE 37
|
||||
#define BUTTON_RIGHT 39
|
||||
|
||||
#endif // BOARD_TTGO_T4
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// BOARD M5STACK CORE IOT (M5-K001)
|
||||
/////////////////////////////////////////////////////////////
|
||||
#ifdef BOARD_M5STACK_CORE
|
||||
|
||||
#define USER_SETUP_LOADED 1
|
||||
#define ILI9341_DRIVER
|
||||
#define M5STACK
|
||||
@@ -47,11 +60,18 @@
|
||||
#define TFT_BL 32 // LED back-light
|
||||
#define SPI_FREQUENCY 27000000
|
||||
#define SPI_READ_FREQUENCY 5000000
|
||||
#define SPEAKER_PIN 25
|
||||
#define INVERT_DISPLAY
|
||||
|
||||
#define BUTTON_LEFT 37
|
||||
#define BUTTON_MIDDLE 38
|
||||
#define BUTTON_RIGHT 39
|
||||
#define SPEAKER 25
|
||||
#define INVERT_DISPLAY
|
||||
|
||||
#define SD_CS 4
|
||||
#define SD_MOSI 23
|
||||
#define SD_MISO 19
|
||||
#define SD_SCLK 18
|
||||
|
||||
#endif // BOARD_M5STACK_CORE
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
BIN
dist/m5stack_core1/enirodashboard.ino.bin
vendored
BIN
dist/m5stack_core1/enirodashboard.ino.bin
vendored
Binary file not shown.
BIN
dist/ttgo_t4_v13/enirodashboard.ino.bin
vendored
BIN
dist/ttgo_t4_v13/enirodashboard.ino.bin
vendored
Binary file not shown.
@@ -27,28 +27,31 @@
|
||||
<= 0°C BMS allows max 40A
|
||||
*/
|
||||
|
||||
#define APP_VERSION "v1.8.2b"
|
||||
#define APP_VERSION "v1.8.3b"
|
||||
|
||||
#include "SPI.h"
|
||||
#include "TFT_eSPI.h"
|
||||
#include "BLEDevice.h"
|
||||
#include <SPI.h>
|
||||
#include <TFT_eSPI.h>
|
||||
#include <BLEDevice.h>
|
||||
#include "./config.h"
|
||||
#include <mySD.h>
|
||||
//#include <SD.h>
|
||||
#include <EEPROM.h>
|
||||
#include <sys/time.h>
|
||||
#include <analogWrite.h>
|
||||
#include "config.h"
|
||||
#include "struct.h"
|
||||
#include "menu.h"
|
||||
#include "car_kia_eniro.h"
|
||||
#include "car_hyundai_ioniq.h"
|
||||
#include "car_renault_zoe.h"
|
||||
#include "car_debug_obd2_kia.h"
|
||||
#include "./struct.h"
|
||||
#include "./menu.h"
|
||||
#include "./car_kia_eniro.h"
|
||||
#include "./car_hyundai_ioniq.h"
|
||||
#include "./car_renault_zoe.h"
|
||||
#include "./car_debug_obd2_kia.h"
|
||||
|
||||
// PLEASE CHANGE THIS SETTING for your BLE4
|
||||
uint32_t PIN = 1234;
|
||||
|
||||
// TFT
|
||||
// TFT, SD SPI
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
TFT_eSprite spr = TFT_eSprite(&tft);
|
||||
//SPIClass spiSD(HSPI);
|
||||
|
||||
// BLUETOOTH4
|
||||
static boolean bleConnect = true;
|
||||
@@ -176,7 +179,7 @@ bool loadSettings() {
|
||||
|
||||
// Init
|
||||
settings.initFlag = 183;
|
||||
settings.settingsVersion = 2;
|
||||
settings.settingsVersion = 3;
|
||||
settings.carType = CAR_KIA_ENIRO_2020_64;
|
||||
|
||||
// Default OBD adapter MAC and UUID's
|
||||
@@ -1830,6 +1833,7 @@ void setup(void) {
|
||||
Serial.println("");
|
||||
Serial.println("Booting device...");
|
||||
|
||||
//
|
||||
initStructure();
|
||||
loadSettings();
|
||||
|
||||
@@ -1840,9 +1844,9 @@ void setup(void) {
|
||||
|
||||
#ifdef BOARD_M5STACK_CORE
|
||||
// mute speaker
|
||||
dacWrite(25, 0);
|
||||
Serial.println("Mute speaker for m5stack");
|
||||
dacWrite(SPEAKER_PIN, 0);
|
||||
#endif // BOARD_M5STACK_C
|
||||
|
||||
// Init display
|
||||
Serial.println("Init TFT display");
|
||||
tft.begin();
|
||||
@@ -1860,11 +1864,6 @@ void setup(void) {
|
||||
if (psramFound())
|
||||
psramUsed = true;
|
||||
#endif
|
||||
// if (!psramUsed) {
|
||||
// displayMessage("SRAM support required", "Compile with ESP32 Wrover CPU");
|
||||
// delay(60000);
|
||||
// ESP.restart();
|
||||
// }
|
||||
spr.setColorDepth((psramUsed) ? 16 : 8);
|
||||
spr.createSprite(320, 240);
|
||||
redrawScreen();
|
||||
@@ -1884,6 +1883,19 @@ void setup(void) {
|
||||
testData();
|
||||
}
|
||||
|
||||
// Init SDCARD
|
||||
if (!SD.begin(SD_CS, SD_MOSI, SD_MISO, SD_SCLK)) {
|
||||
Serial.println("SDCARD initialization failed!");
|
||||
} else {
|
||||
Serial.println("SDCARD initialization done.");
|
||||
}
|
||||
/*spiSD.begin(SD_SCLK,SD_MISO,SD_MOSI,SD_CS);
|
||||
if(!SD.begin( SD_CS, spiSD, 27000000)){
|
||||
Serial.println("SDCARD initialization failed!");
|
||||
} else {
|
||||
Serial.println("SDCARD initialization done.");
|
||||
}*/
|
||||
|
||||
// Start BLE connection
|
||||
line = "";
|
||||
Serial.println("Start BLE with PIN auth");
|
||||
|
||||
16
menu.h
16
menu.h
@@ -8,7 +8,7 @@ typedef struct {
|
||||
char serviceUUID[40];
|
||||
} MENU_ITEM;
|
||||
|
||||
#define menuItemsCount 67
|
||||
#define menuItemsCount 79
|
||||
bool menuVisible = false;
|
||||
uint16_t menuCurrent = 0;
|
||||
uint8_t menuItemSelected = 0;
|
||||
@@ -41,6 +41,8 @@ MENU_ITEM menuItems[menuItemsCount] = {
|
||||
{303, 3, -1, "Debug screen off/on"},
|
||||
{304, 3, -1, "LCD brightness"},
|
||||
{305, 3, -1, "Pre-drawn ch.graphs 0/1"},
|
||||
{306, 3, -1, "[DEV] WiFi network"},
|
||||
{307, 3, -1, "[DEV] SD card"},
|
||||
|
||||
{400, 4, 0, "<- parent menu"},
|
||||
{401, 4, -1, "Distance"},
|
||||
@@ -72,6 +74,18 @@ MENU_ITEM menuItems[menuItemsCount] = {
|
||||
{3051, 305, -1, "Off"},
|
||||
{3052, 305, -1, "On"},
|
||||
|
||||
{3060, 306, 3, "<- parent menu"},
|
||||
{3061, 306, -1, "WiFi off/on"},
|
||||
{3062, 306, -1, "SSID"},
|
||||
{3063, 306, -1, "Password"},
|
||||
|
||||
{3070, 307, 3, "<- parent menu"},
|
||||
{3071, 307, -1, "Info:"},
|
||||
{3072, 307, -1, "Mount manually"},
|
||||
{3073, 307, -1, "Record now"},
|
||||
{3074, 307, -1, "Stop recording"},
|
||||
{3075, 307, -1, "Record on boot off/on"},
|
||||
|
||||
{4010, 401, 4, "<- parent menu"},
|
||||
{4011, 401, -1, "Kilometers"},
|
||||
{4012, 401, -1, "Miles"},
|
||||
|
||||
Reference in New Issue
Block a user