mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-15 06:53:07 +01:00
Add direction pin function for NMEA0183
This commit is contained in:
@@ -119,7 +119,7 @@ void OBP60Init(GwApi *api){
|
|||||||
GwLog *logger=api->getLogger();
|
GwLog *logger=api->getLogger();
|
||||||
|
|
||||||
// Define timer interrupts
|
// Define timer interrupts
|
||||||
// Timer1.attach_ms(1, underVoltageDetection); // Maximum speed with 1ms
|
Timer1.attach_ms(1, underVoltageDetection); // Maximum speed with 1ms
|
||||||
Timer2.attach_ms(40, readKeypad); // Timer value nust grater than 30ms
|
Timer2.attach_ms(40, readKeypad); // Timer value nust grater than 30ms
|
||||||
Timer3.attach_ms(500, blinkingFlashLED);
|
Timer3.attach_ms(500, blinkingFlashLED);
|
||||||
|
|
||||||
@@ -159,6 +159,17 @@ void OBP60Init(GwApi *api){
|
|||||||
else{
|
else{
|
||||||
LOG_DEBUG(GwLog::DEBUG,"1Wire Mode is Off");
|
LOG_DEBUG(GwLog::DEBUG,"1Wire Mode is Off");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Settings for NMEA0183
|
||||||
|
String nmea0183Mode = api->getConfig()->getConfigItem(api->getConfig()->serialDirection,true)->asString();
|
||||||
|
LOG_DEBUG(GwLog::DEBUG,"NMEA0183 Mode is: %s", nmea0183Mode);
|
||||||
|
pinMode(OBP_DIRECTION_PIN, OUTPUT);
|
||||||
|
if(String(nmea0183Mode) == "receive" || String(nmea0183Mode) == "off"){
|
||||||
|
digitalWrite(OBP_DIRECTION_PIN, false);
|
||||||
|
}
|
||||||
|
if(String(nmea0183Mode) == "send"){
|
||||||
|
digitalWrite(OBP_DIRECTION_PIN, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Settings for backlight
|
// Settings for backlight
|
||||||
String backlightMode = api->getConfig()->getConfigItem(api->getConfig()->backlight,true)->asString();
|
String backlightMode = api->getConfig()->getConfigItem(api->getConfig()->backlight,true)->asString();
|
||||||
|
|||||||
@@ -58,8 +58,9 @@ lib_deps = ${env.lib_deps}
|
|||||||
build_flags =
|
build_flags =
|
||||||
-D BOARD_M5ATOM_CANUNIT
|
-D BOARD_M5ATOM_CANUNIT
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
upload_port = /dev/esp32
|
upload_port = COM13
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
[env:m5stickc-atom-canunit]
|
[env:m5stickc-atom-canunit]
|
||||||
board = m5stick-c
|
board = m5stick-c
|
||||||
|
|||||||
Reference in New Issue
Block a user