Compare commits

..

No commits in common. "9af781318f79664355b6cd36b4f115460cf9b4d9" and "2fd11c72b6711a04e9e97edf7d514b7055cde893" have entirely different histories.

5 changed files with 30 additions and 77 deletions

View File

@ -10,7 +10,7 @@
"-DBOARD_HAS_PSRAM", "-DBOARD_HAS_PSRAM",
"-DARDUINO_ESP32S3_DEV", "-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1", "-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=0", "-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1", "-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1" "-DARDUINO_EVENT_RUNNING_CORE=1"
], ],

View File

@ -9,27 +9,3 @@ THIS BRANCH IS NOT INTENDED TO MERGE INTO "master"!
platformio.ini adapted to compile directly platformio.ini adapted to compile directly
Differences to OBP60
--------------------
- no GPS
- no RTC
- no LEDs
- no environment sensor
- no key lock
- no swipe
- only 5 keys
+ SD card interface
Keyboard
--------
Keycode Key Function
-------- ---------------- -------------------------
1 Menu key Key 1 of OBP60 (left)
2 Exit key Key 2 of OBP60
3 Jog-Dial press
9 Jog-Dial down Next page
10 Jog-Dial up Previous page

View File

@ -297,7 +297,7 @@
"name": "useRTC", "name": "useRTC",
"label": "RTC Modul", "label": "RTC Modul",
"type": "list", "type": "list",
"default": "off", "default": "DS1388",
"description": "Use internal RTC module type [off|DS1388]", "description": "Use internal RTC module type [off|DS1388]",
"list": [ "list": [
"off", "off",
@ -312,7 +312,7 @@
"name": "useGPS", "name": "useGPS",
"label": "GPS Sensor", "label": "GPS Sensor",
"type": "list", "type": "list",
"default": "off", "default": "ATGM336H",
"description": "Use internal GPS module type [off|NEO-6M|NEO-M8N|ATGM336H]", "description": "Use internal GPS module type [off|NEO-6M|NEO-M8N|ATGM336H]",
"list": [ "list": [
"off", "off",
@ -343,7 +343,7 @@
"name": "useEnvSensor", "name": "useEnvSensor",
"label": "Env. Sensor", "label": "Env. Sensor",
"type": "list", "type": "list",
"default": "off", "default": "BMP280",
"description": "Use internal or external environment sensor via I2C bus [off|BME280|BMP280|BMP180|BMP085|HTU21|SHT21]", "description": "Use internal or external environment sensor via I2C bus [off|BME280|BMP280|BMP180|BMP085|HTU21|SHT21]",
"list": [ "list": [
"off", "off",
@ -573,21 +573,6 @@
"obp60":"true" "obp60":"true"
} }
}, },
{
"name": "useSDCard",
"label": "SD Card",
"type": "boolean",
"default": "off",
"description": "Use internal SD card interface [off|on]",
"list": [
"off",
"on"
],
"category": "OBP60 Hardware",
"capabilities": {
"obp60":"true"
}
},
{ {
"name": "powerMode", "name": "powerMode",
"label": "Power Mode", "label": "Power Mode",
@ -933,7 +918,7 @@
"name": "page1type", "name": "page1type",
"label": "Type", "label": "Type",
"type": "list", "type": "list",
"default": "Clock", "default": "Voltage",
"description": "Type of page for page 1", "description": "Type of page for page 1",
"list": [ "list": [
"BME280", "BME280",
@ -1193,7 +1178,7 @@
"name": "page2type", "name": "page2type",
"label": "Type", "label": "Type",
"type": "list", "type": "list",
"default": "Wind", "default": "WindRose",
"description": "Type of page for page 2", "description": "Type of page for page 2",
"list": [ "list": [
"BME280", "BME280",
@ -2691,7 +2676,7 @@
"name": "page8type", "name": "page8type",
"label": "Type", "label": "Type",
"type": "list", "type": "list",
"default": "Fluid", "default": "Clock",
"description": "Type of page for page 8", "description": "Type of page for page 8",
"list": [ "list": [
"BME280", "BME280",

View File

@ -27,6 +27,8 @@
#include "OBP60QRWiFi.h" // Functions lib for WiFi QR code #include "OBP60QRWiFi.h" // Functions lib for WiFi QR code
#include "OBPSensorTask.h" // Functions lib for sensor data #include "OBPSensorTask.h" // Functions lib for sensor data
#include "LedSpiTask.h"
// Global vars // Global vars
bool initComplete = false; // Initialization complete bool initComplete = false; // Initialization complete
int taskRunCounter = 0; // Task couter for loop section int taskRunCounter = 0; // Task couter for loop section
@ -35,9 +37,6 @@ int taskRunCounter = 0; // Task couter for loop section
//#################################################################################### //####################################################################################
void OBP60Init(GwApi *api){ void OBP60Init(GwApi *api){
GwLog *logger = api->getLogger();
GwConfigHandler *config = api->getConfig();
// Set a new device name and hidden the original name in the main config // Set a new device name and hidden the original name in the main config
String devicename = api->getConfig()->getConfigItem(api->getConfig()->deviceName,true)->asString(); String devicename = api->getConfig()->getConfigItem(api->getConfig()->deviceName,true)->asString();
api->getConfig()->setValue(GwConfigDefinitions::systemName, devicename, GwConfigInterface::ConfigType::HIDDEN); api->getConfig()->setValue(GwConfigDefinitions::systemName, devicename, GwConfigInterface::ConfigType::HIDDEN);
@ -50,31 +49,6 @@ void OBP60Init(GwApi *api){
// Init hardware // Init hardware
hardwareInit(api); hardwareInit(api);
String sdcard = config->getConfigItem(config->useSDCard, true)->asString();
if (sdcard == "on") {
setPortPin(OBP_POWER_SD, true); // Power on SD
delay(10);
SPIClass SD_SPI = SPIClass(HSPI);
SD_SPI.begin(SD_SPI_CLK, SD_SPI_MISO, SD_SPI_MOSI);
if (SD.begin(SD_SPI_CS, SD_SPI, 80000000)) {
String sdtype = "unknown";
uint8_t cardType = SD.cardType();
switch (cardType) {
case CARD_MMC:
sdtype = "MMC";
break;
case CARD_SD:
sdtype = "SDSC";
break;
case CARD_SDHC:
sdtype = "SDHC";
break;
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
LOG_DEBUG(GwLog::LOG,"SD card type %s of size %d MB detected", sdtype, cardSize);
}
}
// Init power rail 5.0V // Init power rail 5.0V
String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString(); String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString();
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str()); api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
@ -318,9 +292,7 @@ void OBP60Task(GwApi *api){
// return; // return;
GwLog *logger=api->getLogger(); GwLog *logger=api->getLogger();
GwConfigHandler *config=api->getConfig(); GwConfigHandler *config=api->getConfig();
#ifdef HARDWARE_V21
startLedTask(api); startLedTask(api);
#endif
PageList allPages; PageList allPages;
registerAllPages(allPages); registerAllPages(allPages);
CommonData commonData; CommonData commonData;
@ -442,6 +414,26 @@ void OBP60Task(GwApi *api){
doImageRequest(api, &pageNumber, pages, request); doImageRequest(api, &pageNumber, pages, request);
}); });
// SD-Card: init an check
SPI.begin(SD_SPI_CLK, SD_SPI_MISO, SD_SPI_MOSI, SD_SPI_CS);
if (SD.begin(SD_SPI_CS)) {
String sdtype = "unknown";
uint8_t cardType = SD.cardType();
switch (cardType) {
case CARD_MMC:
sdtype = "MMC";
break;
case CARD_SD:
sdtype = "SDSC";
break;
case CARD_SDHC:
sdtype = "SDHC";
break;
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
LOG_DEBUG(GwLog::DEBUG,"SD card type %s of size %d MB detected", sdtype, cardSize);
}
//now we have prepared the page data //now we have prepared the page data
//we start a separate task that will fetch our keys... //we start a separate task that will fetch our keys...
MyData allParameters; MyData allParameters;

View File

@ -41,7 +41,7 @@ lib_deps =
build_flags= build_flags=
#https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL #https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL
# -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device) # -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device)
# -D ARDUINO_USB_CDC_ON_BOOT=0 #0=JTAG, 1=CDC (serial device) -D ARDUINO_USB_CDC_ON_BOOT=0 #0=JTAG, 1=CDC (serial device)
# -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device) # -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device)
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC) # -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib -D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib