Skip to content

Commit

Permalink
Serial config fix and available func call
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Dec 30, 2023
1 parent e94e6e4 commit 04141e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions VortexEngine/src/Serial/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include <stdio.h>
#endif

#ifdef VORTEX_EMBEDDED
#include <Arduino.h>
#endif

bool SerialComs::m_serialConnected = false;
uint32_t SerialComs::m_lastCheck = 0;

Expand Down Expand Up @@ -51,15 +55,15 @@ bool SerialComs::checkSerial()
if (!Vortex::vcallbacks()->serialCheck()) {
return false;
}
Vortex::vcallbacks()->serialBegin(9600);
Vortex::vcallbacks()->serialBegin(SERIAL_BAUD_RATE);
#else
// This will check if the serial communication is open
if (!Serial) {
if (!Serial.available()) {
// serial is not connected
return false;
}
// Begin serial communications
Serial.begin(9600);
Serial.begin(SERIAL_BAUD_RATE);
#endif
#endif
// serial is now connected
Expand Down
5 changes: 5 additions & 0 deletions VortexEngine/src/VortexConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
#define VAL_OPTION_3 170
#define VAL_OPTION_4 255

// Serial Baud Rate
//
// The serial connection baud rate for the editor and anything else serial
#define SERIAL_BAUD_RATE 9600

// ===================================================================
// Boolean Configurations (0 or 1)

Expand Down

0 comments on commit 04141e9

Please sign in to comment.