mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 09:06:11 +00:00
Use FlixPeriph library for SBUS
This commit is contained in:
@@ -5,13 +5,20 @@
|
||||
|
||||
#include "joystick.h"
|
||||
|
||||
struct SBUSData {
|
||||
int16_t ch[16];
|
||||
};
|
||||
|
||||
class SBUS {
|
||||
public:
|
||||
SBUS(HardwareSerial& bus) {};
|
||||
void begin() {};
|
||||
bool read(int16_t *channels, bool *failsafe, bool *lostFrame) { // NOTE: on the hardware channels is uint16_t
|
||||
*failsafe = false;
|
||||
*lostFrame = false;
|
||||
return joystickGet();
|
||||
bool read() { return joystickGet(); };
|
||||
SBUSData data() {
|
||||
SBUSData data;
|
||||
for (uint8_t i = 0; i < 16; i++) {
|
||||
data.ch[i] = channels[i];
|
||||
}
|
||||
return data;
|
||||
};
|
||||
};
|
||||
|
@@ -23,7 +23,7 @@ float t = NAN;
|
||||
float dt;
|
||||
float loopFreq;
|
||||
float motors[4];
|
||||
int16_t channels[16]; // raw rc channels WARNING: unsigned on hardware
|
||||
int16_t channels[16]; // raw rc channels
|
||||
float controls[RC_CHANNELS];
|
||||
Vector acc;
|
||||
Vector rates;
|
||||
|
Reference in New Issue
Block a user