Simplify rc code

Utilize the new method for getting channel values.
This commit is contained in:
Oleg Kalachev
2026-06-14 04:45:42 +03:00
parent 17df1c5396
commit 518abf1555
2 changed files with 10 additions and 13 deletions
+6 -8
View File
@@ -27,14 +27,12 @@ void setupRC() {
bool readRC() {
if (rcRxPin < 0) return false;
if (rc.read()) {
SBUSData data = rc.data();
for (int i = 0; i < 16; i++) channels[i] = data.ch[i]; // copy channels data
normalizeRC();
controlTime = t;
return true;
}
return false;
if (!rc.read()) return false;
rc.getChannels(channels);
normalizeRC();
controlTime = t;
return true;
}
void normalizeRC() {