mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-22 Flight/PiOS: fix for 11ms framerate, Spektrum supervisor timer must have atleast one interrupt between frames
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3134 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
cdfbf8614c
commit
dabc33c71c
@ -356,7 +356,7 @@ const struct pios_spektrum_cfg pios_spektrum_cfg = {
|
||||
.TIM_Prescaler = (PIOS_MASTER_CLOCK / 1000000) - 1, /* For 1 uS accuracy */
|
||||
.TIM_ClockDivision = TIM_CKD_DIV1,
|
||||
.TIM_CounterMode = TIM_CounterMode_Up,
|
||||
.TIM_Period = ((1000000 / 60) - 1), //60hz
|
||||
.TIM_Period = ((1000000 / 120) - 1), //11ms-10*16b/115200bps atleast one interrupt between frames
|
||||
.TIM_RepetitionCounter = 0x0000,
|
||||
},
|
||||
.gpio_init = { //used for bind feature
|
||||
|
@ -512,7 +512,7 @@ const struct pios_spektrum_cfg pios_spektrum_cfg = {
|
||||
.TIM_Prescaler = (PIOS_MASTER_CLOCK / 1000000) - 1, /* For 1 uS accuracy */
|
||||
.TIM_ClockDivision = TIM_CKD_DIV1,
|
||||
.TIM_CounterMode = TIM_CounterMode_Up,
|
||||
.TIM_Period = ((1000000 / 60) - 1), //60hz
|
||||
.TIM_Period = ((1000000 / 120) - 1), //11ms-10*16b/115200bps, atleast one interrupt between frames
|
||||
.TIM_RepetitionCounter = 0x0000,
|
||||
},
|
||||
.gpio_init = { //used for bind feature
|
||||
|
@ -299,7 +299,7 @@ void PIOS_SPEKTRUM_irq_handler() {
|
||||
frame_error=0;
|
||||
sync_of++;
|
||||
/* watchdog activated */
|
||||
if (sync_of > 6) {
|
||||
if (sync_of > 12) {
|
||||
/* signal lost */
|
||||
sync_of = 0;
|
||||
for (int i = 0; i < 12; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user