Improve logic of passing channels data in simulated SBUS

Return the data the same way as on the real drone without touching channels global vairable
This commit is contained in:
Oleg Kalachev
2024-12-23 02:04:22 +03:00
parent b6286a50b2
commit 3cc3014ca0
2 changed files with 5 additions and 7 deletions

View File

@@ -14,12 +14,10 @@ public:
SBUS(HardwareSerial& bus, const bool inv = true) {};
SBUS(HardwareSerial& bus, const int8_t rxpin, const int8_t txpin, const bool inv = true) {};
void begin() {};
bool read() { return joystickGet(); };
bool read() { return true; };
SBUSData data() {
SBUSData data;
for (uint8_t i = 0; i < 16; i++) {
data.ch[i] = channels[i];
}
joystickGet(data.ch);
return data;
};
};