From 69cfc9e5fa19ade366543e4d3d194a60a54a3f42 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 26 Jan 2024 13:46:13 +0300 Subject: [PATCH] Utilize internal ESP32 UART invertor for SBUS --- flix/rc.ino | 3 +++ gazebo/Arduino.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/flix/rc.ino b/flix/rc.ino index a4b59a5..ce7e439 100644 --- a/flix/rc.ino +++ b/flix/rc.ino @@ -5,6 +5,8 @@ #include +#define INVERT_SERIAL true // false if external SBUS invertor is used + // NOTE: use `cr` command and replace with the actual values int channelNeutral[] = {995, 883, 200, 972, 512, 512}; int channelMax[] = {1651, 1540, 1713, 1630, 1472, 1472}; @@ -14,6 +16,7 @@ SBUS RC(Serial2); void setupRC() { Serial.println("Setup RC"); RC.begin(); + Serial2.setRxInvert(INVERT_SERIAL); } void readRC() { diff --git a/gazebo/Arduino.h b/gazebo/Arduino.h index 9d35e6d..16e0808 100644 --- a/gazebo/Arduino.h +++ b/gazebo/Arduino.h @@ -122,6 +122,8 @@ public: } return -1; } + + void setRxInvert(bool invert) {}; }; HardwareSerial Serial, Serial2;