1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-08-18 10:22:31 +02:00

Change defines

This commit is contained in:
norbert-walter
2026-03-20 11:43:35 +01:00
parent f7b1b56715
commit ba851d7e1b
5 changed files with 15 additions and 18 deletions
+4 -4
View File
@@ -230,7 +230,7 @@ void hardwareInit(GwApi *api)
void powerInit(String powermode) {
// Max Power | Only 5.0V | Min Power
if (powermode == "Max Power" || powermode == "Only 5.0V") {
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
#endif
#ifdef BOARD_OBP40S3
@@ -238,7 +238,7 @@ void powerInit(String powermode) {
setPortPin(OBP_POWER_SD, true); // Power on SD card
#endif
} else { // Min Power
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
#endif
#ifdef BOARD_OBP40S3
@@ -666,7 +666,7 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatVa
usbRxOld = commonData.status.usbRx;
usbTxOld = commonData.status.usbTx;
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
// Display key lock status
if (commonData.keylock) {
getdisplay().drawXBitmap(170, 1, lock_bits, icon_width, icon_height, commonData.fgcolor);
@@ -759,7 +759,7 @@ void displayFooter(CommonData &commonData) {
getdisplay().setFont(&Atari16px);
getdisplay().setTextColor(commonData.fgcolor);
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
// Frame around key icon area
if (! commonData.keylock) {
// horizontal elements
+1 -1
View File
@@ -126,7 +126,7 @@ class Page{
virtual void displayNew(PageData &pageData){}
virtual void leavePage(PageData &pageData){}
virtual void setupKeys() {
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
commonData->keydata[0].label = "";
commonData->keydata[1].label = "";
commonData->keydata[2].label = "#LEFT";
+4 -3
View File
@@ -323,7 +323,7 @@ inline bool underVoltageDetection(float voffset, float vslope) {
// Read supply voltage
#if defined VOLTAGE_SENSOR && defined LIPO_ACCU_1200
float actVoltage = (float(analogRead(OBP_ANALOG0)) * 3.3 / 4096 + 0.53) * 2; // Vin = 1/2 for OBP40
float minVoltage = 3.65; // Absolut minimum volatge for 3,7V LiPo accu
float minVoltage = 3.65; // Absolut minimum voltage for 3,7V LiPo accu
#else
float actVoltage = (float(analogRead(OBP_ANALOG0)) * 3.3 / 4096 + 0.17) * 20; // Vin = 1/20 for OBP60
float minVoltage = MIN_VOLTAGE;
@@ -332,6 +332,7 @@ inline bool underVoltageDetection(float voffset, float vslope) {
return (calVoltage < minVoltage);
}
// OBP60 Task
//####################################################################################
void OBP60Task(GwApi *api){
@@ -339,7 +340,7 @@ void OBP60Task(GwApi *api){
// return;
GwLog *logger=api->getLogger();
GwConfigHandler *config=api->getConfig();
#if defined HARDWARE_V20 || HARDWARE_V21
#ifdef BOARD_OBP60S3
startLedTask(api);
#endif
PageList allPages;
@@ -348,7 +349,7 @@ void OBP60Task(GwApi *api){
commonData.logger=logger;
commonData.config=config;
#if defined HARDWARE_V20 || HARDWARE_V21
#ifdef BOARD_OBP60S3
// Keyboard coordinates for page footer
initKeys(commonData);
#endif
+5 -5
View File
@@ -3,7 +3,7 @@
//we only compile for some boards
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
#define USBSerial Serial
#ifdef HARDWARE_V21
#ifdef BOARD_OBP60S3
// CAN NMEA2000
#define ESP32_CAN_TX_PIN 46
#define ESP32_CAN_RX_PIN 3
@@ -35,19 +35,19 @@
// OBP60 Task
void OBP60Task(GwApi *param);
DECLARE_USERTASK_PARAM(OBP60Task, 35000); // Need 35k RAM as stack size
#if defined(BOARD_OBP60S3) && defined(HARDWARE_V21) && defined(TFT_DISPLAY)
#if defined(BOARD_OBP60S3) && defined(TFT_DISPLAY)
DECLARE_CAPABILITY(obp70,true);
#endif
#if defined(BOARD_OBP60S3) && defined(HARDWARE_V21) && !defined(TFT_DISPLAY)
#if defined(BOARD_OBP60S3) && !defined(TFT_DISPLAY)
DECLARE_CAPABILITY(obp60,true);
#endif
#ifdef BOARD_OBP40S3
DECLARE_CAPABILITY(obp40,true)
#endif
#if defined(BOARD_OBP60S3) && defined(HARDWARE_V21) && defined(TFT_DISPLAY)
#if defined(BOARD_OBP60S3) && defined(TFT_DISPLAY)
DECLARE_STRING_CAPABILITY(HELP_URL, "https://obp60-v2-docu.readthedocs.io/en/latest/"); // Link to help pages
#endif
#if defined(BOARD_OBP60S3) && defined(HARDWARE_V21) && !defined(TFT_DISPLAY)
#if defined(BOARD_OBP60S3) && !defined(TFT_DISPLAY)
DECLARE_STRING_CAPABILITY(HELP_URL, "https://obp60-v2-docu.readthedocs.io/en/latest/"); // Link to help pages
#endif
#ifdef BOARD_OBP40S3
+1 -5
View File
@@ -11,11 +11,7 @@ default_envs =
[env:obp70_s3]
platform = espressif32@6.8.1
board_build.variants_dir = variants
#board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM
#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_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash
board = obp70_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series
board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash
custom_config = lib/obp60task/config_obp70.json
custom_script = lib/obp60task/extra_task.py