Fix interrupt handler not handling multiprotocol (Pulses fix) (#3570)
* Fix interrupt handler not handling multiprotocol * Use proper Macros in driver, remove wrong comment about ppm
This commit is contained in:
committed by
Bertrand Songis
parent
36423db252
commit
b6d4442ba1
@@ -65,7 +65,7 @@ void setupPulses(uint8_t port)
|
||||
required_protocol = PROTO_PXX;
|
||||
break;
|
||||
#if defined(MULTIMODULE)
|
||||
case MODULE_TYPE_MULTIMODULE:
|
||||
case MODULE_TYPE_MULTIMODULE:
|
||||
required_protocol = PROTO_MULTIMODULE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -74,14 +74,8 @@ PACK(struct PxxUartPulsesData {
|
||||
/* 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 */
|
||||
#if defined(MULTIMODULE)
|
||||
#define NUM_TIMER_PULSES 300
|
||||
#else
|
||||
#define NUM_TIMER_PULSES 200
|
||||
#endif
|
||||
|
||||
PACK(struct PxxTimerPulsesData {
|
||||
pulse_duration_t pulses[NUM_TIMER_PULSES];
|
||||
pulse_duration_t pulses[200];
|
||||
pulse_duration_t * ptr;
|
||||
uint16_t rest;
|
||||
uint16_t pcmCrc;
|
||||
@@ -89,12 +83,15 @@ PACK(struct PxxTimerPulsesData {
|
||||
});
|
||||
|
||||
PACK(struct Dsm2TimerPulsesData {
|
||||
pulse_duration_t pulses[NUM_TIMER_PULSES];
|
||||
#if defined(MULTIMODULE)
|
||||
pulse_duration_t pulses[300];
|
||||
#else
|
||||
pulse_duration_t pulses[200];
|
||||
#endif
|
||||
pulse_duration_t * ptr;
|
||||
uint16_t rest;
|
||||
uint8_t index;
|
||||
});
|
||||
#undef NUM_TIMER_PULSES
|
||||
#endif
|
||||
|
||||
#define CROSSFIRE_BAUDRATE 400000
|
||||
|
||||
Reference in New Issue
Block a user