Skip to content

Conversation

@iOsnaaente
Copy link

Was added the following lines in the VescUart.h file to keep the firmwares compatible with ESP32/ESP8266 and Teensy4.0:

// When using Arduino boards 
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_MEGA2560) 
  #include <SoftwareSerial.h>
  #define SERIAL_PORT_TYPE SoftwareSerial 
// When using ESP32 or ESP8266 boards 
#elif defined(ESP32) || defined(ESP8266)
  #define SERIAL_PORT_TYPE HardwareSerial
// When using Teensy 4.0 board 
#elif defined( __IMXRT1062__ ) 
  #define SERIAL_PORT_TYPE HardwareSerialIMXRT 
// Other boards can be defined below
#else 
  #define SERIAL_PORT_TYPE HardwareSerial 
#endif

In the VescUart.cpp I just change the lines void VescUart::setSerialPort( Stream* port) to void VescUart::setSerialPort( SERIAL_PORT_TYPE* port) where the SERIAL_PORT_TYPE is chosen by the .h file. The VescUart::setDebugPort was modified as the same.

The librarie works well. The code was tested with ESP32 and Teensy4.0 with the Mini FSESC6.7 Pro.

I hope the changes bring new ideias 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant