Add direction pin function for NMEA0183
This commit is contained in:
		
							parent
							
								
									8a776d355b
								
							
						
					
					
						commit
						29c72d359d
					
				|  | @ -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);  | ||||||
| 
 | 
 | ||||||
|  | @ -160,6 +160,17 @@ void OBP60Init(GwApi *api){ | ||||||
|             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(); | ||||||
|         LOG_DEBUG(GwLog::DEBUG,"Backlight Mode is: %s", backlightMode); |         LOG_DEBUG(GwLog::DEBUG,"Backlight Mode is: %s", backlightMode); | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 norbert-walter
						norbert-walter