Move SBUS RC declaration to the top

This commit is contained in:
Oleg Kalachev 2025-02-28 22:25:27 +03:00
parent add03482aa
commit 41b5932a5d

View File

@ -6,13 +6,13 @@
#include <SBUS.h> #include <SBUS.h>
#include "util.h" #include "util.h"
SBUS RC(Serial2); // NOTE: Use RC(Serial2, 16, 17) if you use the old UART2 pins
// NOTE: use 'cr' command to calibrate the RC and put the values here // NOTE: use 'cr' command to calibrate the RC and put the values here
int channelNeutral[] = {995, 883, 200, 972, 512, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int channelNeutral[] = {995, 883, 200, 972, 512, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int channelMax[] = {1651, 1540, 1713, 1630, 1472, 1472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int channelMax[] = {1651, 1540, 1713, 1630, 1472, 1472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
float controlsTime; // time of the last controls update float controlsTime; // time of the last controls update
SBUS RC(Serial2); // NOTE: Use RC(Serial2, 16, 17) if you use the old UART2 pins
void setupRC() { void setupRC() {
Serial.println("Setup RC"); Serial.println("Setup RC");
RC.begin(); RC.begin();