diff --git a/src/main_views.cpp b/src/main_views.cpp index 6244bba61..a9c70a1e7 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -380,4 +380,8 @@ void menuMainView(uint8_t event) DISPLAY_PROGRESS_BAR(20*FW+1); #endif +#ifdef DSM2 + if (s_bind_mode) + lcd_putsAtt(15*FW, 0, PSTR("BIND"), 0); +#endif } diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index 53cfd94c4..e76386581 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -418,20 +418,27 @@ normal: */ -bool s_bind_allowed = true; +bool s_bind_mode = false; // For confirmation display of "BIND" in upper-right of main view screen +uint8_t s_bind_allowed = 255; // Counter allows trainer switch bind mode during 1st ~4 seconds, after power-on. + // This is needed to give time for DSM module to repliably complete power up. FORCEINLINE void setupPulsesDsm2() { uint16_t *ptr = (uint16_t *)pulses2MHz; - if (s_bind_allowed) { - *ptr++ = (keyState(SW_Trainer) ? BIND_BIT : 0x00); - s_bind_allowed = false; + if (s_bind_allowed) s_bind_allowed--; + if (s_bind_allowed && keyState(SW_Trainer)) + { + s_bind_mode = true; + *ptr++ = BIND_BIT; } - else { + else + { + s_bind_mode = false; *ptr++ = 0x00; } *ptr++ = g_model.modelId; - for (uint8_t i=0; i>5)+512,1023); *ptr++ = (i<<2) | ((pulse>>8)&0x03); *ptr++ = pulse & 0xff;