mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 09:15:38 +03:00
No PPM was sent on protocol change (PPMSIM => any other)
This commit is contained in:
parent
e84f291724
commit
f94a25b22e
1 changed files with 14 additions and 5 deletions
|
@ -693,11 +693,13 @@ static void setupPulsesPiccoZ(uint8_t chn)
|
||||||
|
|
||||||
void setupPulses()
|
void setupPulses()
|
||||||
{
|
{
|
||||||
if (s_current_protocol != g_model.protocol) {
|
uint8_t required_protocol = g_model.protocol;
|
||||||
|
|
||||||
s_current_protocol = g_model.protocol;
|
if (s_current_protocol != required_protocol) {
|
||||||
|
|
||||||
switch (g_model.protocol) {
|
s_current_protocol = required_protocol;
|
||||||
|
|
||||||
|
switch (required_protocol) {
|
||||||
|
|
||||||
#if defined(DSM2_PPM)
|
#if defined(DSM2_PPM)
|
||||||
case PROTO_DSM2:
|
case PROTO_DSM2:
|
||||||
|
@ -810,7 +812,7 @@ void setupPulses()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(g_model.protocol) {
|
switch(required_protocol) {
|
||||||
|
|
||||||
#ifdef PXX
|
#ifdef PXX
|
||||||
case PROTO_PXX:
|
case PROTO_PXX:
|
||||||
|
@ -996,8 +998,15 @@ ISR(TIMER3_COMPA_vect) //2MHz pulse generation
|
||||||
|
|
||||||
ISR(TIMER3_COMPB_vect) //2MHz pulse generation
|
ISR(TIMER3_COMPB_vect) //2MHz pulse generation
|
||||||
{
|
{
|
||||||
sei() ;
|
sei() ;
|
||||||
|
if (s_current_protocol != g_model.protocol) {
|
||||||
|
if (s_current_protocol == PROTO_PPMSIM) {
|
||||||
|
setupPulses();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
setupPulsesPPM16(g_model.protocol) ;
|
setupPulsesPPM16(g_model.protocol) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SIMU
|
#endif // SIMU
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue