Skip to content

Commit

Permalink
Correct splitting between OBP60 and OBP40 hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
norbert-walter committed Jan 20, 2025
1 parent 4c8ffae commit 5692735
Show file tree
Hide file tree
Showing 62 changed files with 74 additions and 200 deletions.
6 changes: 3 additions & 3 deletions boards/obp60_s3_light_n8r8.json → boards/obp40_s3_n8r8.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"-DBOARD_HAS_PSRAM",
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_CDC_ON_BOOT=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
Expand All @@ -24,7 +24,7 @@
]
],
"mcu": "esp32s3",
"variant": "obp60s3_light"
"variant": "obp40s3"
},
"connectivity": [
"bluetooth",
Expand All @@ -41,7 +41,7 @@
"arduino",
"espidf"
],
"name": "OBP60 Light ESP32-S3-N8R8 (8 MB QD, 8 MB PSRAM)",
"name": "OBP40 ESP32-S3-N8R8 (8 MB QD, 8 MB PSRAM)",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/AS5600.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

/****************************************************
AMS 5600 class for Arduino platform
Expand Down
4 changes: 2 additions & 2 deletions lib/obp60task/OBP60Extensions.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include <Arduino.h>
#include <PCF8574.h> // Driver for PCF8574 output modul from Horter
Expand Down Expand Up @@ -426,7 +426,7 @@ void displayFooter(CommonData &commonData) {
getdisplay().print("Press 1 and 6 fast to unlock keys");
}
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
// grapical page indicator
static const uint16_t r = 5;
static const uint16_t space = 4;
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/OBP60Formater.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include <Arduino.h>
#include "GwApi.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/obp60task/OBP60Hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
#define OBP_POWER_50 5 // 5.0V power rail
#endif

// Hardware configuration for OBP60 LIGHT
// Hardware configuration for OBP40

#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
// Direction pin for RS485 NMEA0183
#define OBP_DIRECTION_PIN 8
// I2C
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/OBP60Keypad.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void initKeys(CommonData &commonData) {
}
#endif

#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
int readSensorpads(){
// Read key code
if(digitalRead(UP) == LOW){
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/OBPSensorTask.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
#include <Adafruit_Sensor.h> // Adafruit Lib for sensors
#include <Adafruit_BME280.h> // Adafruit Lib for BME280
#include <Adafruit_BMP280.h> // Adafruit Lib for BMP280
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageBME280.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageBattery.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageBattery2.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageClock.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageDST810.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageFluid.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageFourValues.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageFourValues2.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageGenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageKeelPosition.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageOneValue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageRollPitch.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageRudderPosition.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageSolar.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageSystem.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageThreeValues.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageTwoValues.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageVoltage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageWhite.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageWind.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageWindRose.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageWindRoseFlex.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/PageXTETrack.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3

#include "Pagedata.h"
#include "OBP60Extensions.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/Pagedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Page{
commonData->keydata[5].label = "";
}
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
commonData->keydata[0].label = "";
commonData->keydata[1].label = "";

Expand Down
13 changes: 7 additions & 6 deletions lib/obp60task/obp60task.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
#include "obp60task.h"
#include "Pagedata.h" // Data exchange for pages
#include "OBP60Hardware.h" // PIN definitions
Expand All @@ -13,7 +13,7 @@
#include "OBP60Extensions.h" // Functions lib for extension board
#include "OBP60Keypad.h" // Functions for keypad

#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
#include <FS.h> // SD-Card access
#include <SD.h>
#include <SPI.h>
Expand Down Expand Up @@ -54,8 +54,9 @@ void OBP60Init(GwApi *api){
// Init hardware
hardwareInit(api);

#ifdef HARDWARE_LIGHT
String sdcard = config->getConfigItem(config->useSDCard, true)->asString();
#ifdef BOARD_OBP40S3
//String sdcard = config->getConfigItem(config->useSDCard, true)->asString();
String sdcard = "on";
if (sdcard == "on") {
setPortPin(OBP_POWER_SD, true); // Power on SD
delay(10);
Expand Down Expand Up @@ -88,15 +89,15 @@ void OBP60Init(GwApi *api){
#ifdef HARDWARE_V21
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
setPortPin(OBP_POWER_EPD, true);// Power on ePaper display
#endif
}
else{
#ifdef HARDWARE_V21
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
setPortPin(OBP_POWER_EPD, false);// Power off ePaper display
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions lib/obp60task/obp60task.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "GwApi.h"
//we only compile for some boards
#ifdef BOARD_OBP60S3
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
#define USBSerial Serial
#ifdef HARDWARE_V21
// CAN NMEA2000
Expand All @@ -14,7 +14,7 @@
#define GWSERIAL_RX 8
#define GWSERIAL_MODE "UNI"
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
// CAN NMEA2000
#define ESP32_CAN_TX_PIN 15
#define ESP32_CAN_RX_PIN 16
Expand All @@ -38,7 +38,7 @@
#ifdef HARDWARE_V21
DECLARE_CAPABILITY(obp60,true);
#endif
#ifdef HARDWARE_LIGHT
#ifdef BOARD_OBP40S3
DECLARE_CAPABILITY(obp40,true)
#endif
DECLARE_STRING_CAPABILITY(HELP_URL, "https://obp60-v2-docu.readthedocs.io/de/latest/"); // Link to help pages
Expand Down
11 changes: 3 additions & 8 deletions lib/obp60task/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ board_build.variants_dir = variants
#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series
#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM
board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
#board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone
#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
framework = arduino
Expand Down Expand Up @@ -39,15 +38,12 @@ lib_deps =
adafruit/Adafruit FRAM I2C@^2.0.3
build_flags=
#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_CDC_ON_BOOT=1 #0=JTAG, 1=CDC (serial 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 DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
# -D HARDWARE_V20 #OBP60 hardware revision V2.0
-D HARDWARE_V21 #OBP60 hardware revision V2.1
# -D HARDWARE_LIGHT #OBP60 hardware clone
# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
Expand All @@ -60,10 +56,10 @@ upload_protocol = esptool #firmware upload via USB OTG seriell, by fir
upload_speed = 230400
monitor_speed = 115200

[env:obp40]
[env:obp40_s3]
platform = [email protected]
board_build.variants_dir = variants
board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone
board = obp40_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone (CrowPanel 4.2)
board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
custom_config = config_obp40.json
framework = arduino
Expand Down Expand Up @@ -93,8 +89,7 @@ lib_deps =
adafruit/Adafruit FRAM I2C@^2.0.3
build_flags=
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
-D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3
-D HARDWARE_LIGHT #OBP60 hardware clone (OBP40)
-D BOARD_OBP40S3 #Board OBP40 V1.0 with ESP32S3 SKU:DIE07300S (CrowPanel 4.2)
-D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
${env.build_flags}
upload_port = /dev/ttyUSB0 #OBP60 clone
Expand Down
Loading

0 comments on commit 5692735

Please sign in to comment.