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