mirror of
https://github.com/okalachev/flix.git
synced 2026-09-06 00:10:58 +00:00
Simplify rc code
Utilize the new method for getting channel values.
This commit is contained in:
+6
-8
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user