#2894 - Crossfire (inverted serial) sent on S.PORT pin in the module bay (ported from master f7044a20ec)

16 channels sent every 2.5ms now @ 200KBauds with CRC
This commit is contained in:
Damjan Adamic
2015-12-20 17:10:32 +01:00
parent e8983250ca
commit 91e80d446a
31 changed files with 435 additions and 92 deletions
+8 -9
View File
@@ -35,28 +35,27 @@
*/
#include "opentx.h"
#include "sbus.h"
#define SBUS_MIN_FRAME_SIZE 23
#define SBUS_MAX_FRAME_SIZE 28
#define SBUS_FRAME_GAP_DELAY 1000 // 500uS
#define SBUS_FRAME_GAP_DELAY 1000 // 500uS
#define SBUS_START_BYTE 0x0F
#define SBUS_FLAGS_IDX 23
#define SBUS_START_BYTE 0x0F
#define SBUS_FLAGS_IDX 23
#define SBUS_FRAMELOST_BIT 2
#define SBUS_FAILSAFE_BIT 3
#define SBUS_CH_BITS 11
#define SBUS_CH_MASK ((1<<SBUS_CH_BITS)-1)
#define SBUS_CH_MASK ((1<<SBUS_CH_BITS)-1)
#define SBUS_CH_CENTER 0x3E0
#define SBUS_CH_CENTER 0x3E0
Fifo<32> sbusFifo;
uint8_t SbusFrame[SBUS_MAX_FRAME_SIZE];
uint16_t SbusTimer ;
uint8_t SbusIndex = 0 ;
void processSbusFrame(uint8_t *sbus, int16_t *pulses, uint32_t size)
// Range for pulses (ppm input) is [-512:+512]
void processSbusFrame(uint8_t * sbus, int16_t * pulses, uint32_t size)
{
uint32_t inputbitsavailable = 0;
uint32_t inputbits = 0;