Преглед изворни кода

优化跳转时多段波形逻辑

feature/PLSR功能
1923777848 пре 1 дан
родитељ
комит
0d58029f71
1 измењених фајлова са 12 додато и 16 уклоњено
  1. +12
    -16
      TrainCamp_zhangcheng_PLSR/app/src/plsr.c

+ 12
- 16
TrainCamp_zhangcheng_PLSR/app/src/plsr.c Прегледај датотеку

@@ -161,11 +161,11 @@ void PlsrModuleTask(void *pArg)
continue;
}

if (plsr.segment[currentSegment].pulseFreq <= 5000)
pulseFreq = 3360 - 1;
else if ((plsr.segment[currentSegment].pulseFreq > 5000)
if (plsr.segment[currentSegment].pulseFreq <= 1000)
pulseFreq = 2625 - 1;
else if ((plsr.segment[currentSegment].pulseFreq > 1000)
&& (plsr.segment[currentSegment].pulseFreq <= 100000))
pulseFreq = 2 - 1;
pulseFreq = 4 - 1;
else
continue;

@@ -435,23 +435,19 @@ static void FirstSegmentProc(SEGMENT_PART *segmentPart)
incAll += segmentPart->inc;
if (plsr.segment[currentSegment].pulseFreq <= 5000)
{
tim10.setPsc(&tim10, 3360 - 1);
if (currentSpeed != 0)
tim10.setPer(&tim10, 50000 / currentSpeed);
else
tim10.setPer(&tim10, 1000);
tim10.registerIrq(&tim10, TimCallBack, &currentSeg.currentPart);
tim10.open(&tim10);
tim10.openIrq(&tim10);
tim10.setPsc(&tim10, 2625 - 1);
}
else
{
tim10.setPsc(&tim10, 168 - 1);
tim10.setPer(&tim10, 1000000 / currentSpeed);
tim10.registerIrq(&tim10, TimCallBack, &currentSeg.currentPart);
tim10.open(&tim10);
tim10.openIrq(&tim10);
}
if (currentSpeed != 0)
tim10.setPer(&tim10, 168000000 / (TIM10->PSC + 1) / currentSpeed);
else
tim10.setPer(&tim10, 1000);
tim10.registerIrq(&tim10, TimCallBack, &currentSeg.currentPart);
tim10.open(&tim10);
tim10.openIrq(&tim10);
}
}


Loading…
Откажи
Сачувај