1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 16:25:16 +03:00

Fix pulse timing issue

This commit is contained in:
3djc 2021-06-22 10:49:50 +02:00
parent 32e098b6ec
commit 3d41e4739d
2 changed files with 3 additions and 2 deletions

View file

@ -487,7 +487,7 @@ static void enablePulsesInternalModule(uint8_t protocol)
#if defined(INTMODULE_HEARTBEAT)
// use backup trigger (1 ms later)
init_intmodule_heartbeat();
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_PERIOD + 1000/*us*/);
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_HEARTBEAT_PERIOD);
#else
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_PERIOD);
#endif
@ -547,7 +547,7 @@ bool setupPulsesInternalModule(uint8_t protocol)
else {
#if defined(INTMODULE_HEARTBEAT)
mixerSchedulerResetTimer();
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_PERIOD + 2000 /* backup */);
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_HEARTBEAT_PERIOD);
#else
mixerSchedulerSetPeriod(INTERNAL_MODULE, PXX2_PERIOD);
#endif

View file

@ -30,6 +30,7 @@
#define PXX2_LOWSPEED_BAUDRATE 230400
#define PXX2_HIGHSPEED_BAUDRATE 450000
#define PXX2_PERIOD 4000/*us*/
#define PXX2_HEARTBEAT_PERIOD 8000/*us 7ms frame rate + 1ms heartbeat backup*/
#define PXX2_TOOLS_PERIOD 1000/*us*/
#define PXX2_FRAME_MAXLENGTH 64