[X-Lite] Next round of changes (#5847)

* [X-Lite] PXX is now sent every 4ms
* New option PXX_FREQUENCY (HIGH / LOW)
* [X-Lite] It now sends 16 channels per 4ms
This commit is contained in:
Bertrand Songis
2018-04-27 08:45:00 +02:00
committed by GitHub
parent 7979401675
commit a0c1beb61f
6 changed files with 72 additions and 17 deletions
+16
View File
@@ -44,6 +44,16 @@ template<class T> struct PpmPulsesData {
T * ptr;
};
#if defined(PXX_FREQUENCY_HIGH)
#define EXTMODULE_USART_PXX_BAUDRATE 420000
#define INTMODULE_USART_PXX_BAUDRATE 450000
#define MODULES_TIMER_PXX_PERIOD 4 // 4ms
#else
#define EXTMODULE_USART_PXX_BAUDRATE 115200
#define INTMODULE_USART_PXX_BAUDRATE 115200
#define MODULES_TIMER_PXX_PERIOD 9 // 9ms
#endif
#if defined(PPM_PIN_SERIAL)
PACK(struct PxxSerialPulsesData {
uint8_t pulses[64];
@@ -75,11 +85,17 @@ PACK(struct PxxUartPulsesData {
#define MULTIMODULE_BAUDRATE 100000
#if defined(INTMODULE_PULSES) || defined(EXTMODULE_PULSES)
/* PXX uses 20 bytes (as of Rev 1.1 document) with 8 changes per byte + stop bit ~= 162 max pulses */
/* DSM2 uses 2 header + 12 channel bytes, with max 10 changes (8n2) per byte + 16 bits trailer ~= 156 max pulses */
/* Multimodule uses 3 bytes header + 22 channel bytes with max 11 changes per byte (8e2) + 16 bits trailer ~= 291 max pulses */
/* Multimodule reuses some of the DSM2 function and structs since the protocols are similar enough */
/* sbus is 1 byte header, 22 channel bytes (11bit * 16ch) + 1 byte flags */
#if defined(PXX_FREQUENCY_HIGH)
#error "Pulses array needs to be increased (PXX_FREQUENCY=HIGH)"
#endif
PACK(struct PxxTimerPulsesData {
pulse_duration_t pulses[200];
pulse_duration_t * ptr;