优化中断向量地址设置
This commit is contained in:
@@ -84,7 +84,7 @@ void currentUpdate(void)
|
||||
static void filamentThread(void *arg)
|
||||
{
|
||||
int iWorkCmd = 0;
|
||||
int iCnt = 0;
|
||||
uint32_t ulLastTick = HAL_GetTick();
|
||||
|
||||
loadSysParam();
|
||||
if ((gptSysParam->usPreheatCurrent < 100) || (gptSysParam->usPreheatCurrent > 5000)) {
|
||||
@@ -123,8 +123,16 @@ static void filamentThread(void *arg)
|
||||
iWorkCmd = 3;
|
||||
if (gucWorkState == 1) {
|
||||
gucWorkState = 2;
|
||||
if (gusNormalDuty < gusPreheatDuty * 1.5 ) {
|
||||
gusNormalDuty = gusPreheatDuty * 1.5;
|
||||
// if (gusNormalDuty < gusPreheatDuty * 1.5 ) {
|
||||
// gusNormalDuty = gusPreheatDuty * 1.5;
|
||||
// }
|
||||
gusNormalDuty = gusPreheatDuty * 1.5;
|
||||
gusDuty = gusNormalDuty;
|
||||
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, gusDuty);
|
||||
osDelay(3);
|
||||
} else if (gucWorkState == 2) {
|
||||
if (gusNormalDuty < 750) {
|
||||
gusNormalDuty += 10;
|
||||
}
|
||||
gusDuty = gusNormalDuty;
|
||||
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, gusDuty);
|
||||
@@ -149,17 +157,17 @@ static void filamentThread(void *arg)
|
||||
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, gusDuty);
|
||||
}
|
||||
|
||||
iCnt++;
|
||||
|
||||
if (iCnt < 1000) {
|
||||
if (HAL_GetTick() - ulLastTick < 500) {
|
||||
continue;
|
||||
}
|
||||
iCnt = 0;
|
||||
ulLastTick = HAL_GetTick();
|
||||
|
||||
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
printf("ADC: %d,%d,%d\n", gausAdcBuf[0], gausAdcBuf[1], gausAdcBuf[2]);
|
||||
printf("workState:%d,duty:%d%%,I:%.3fA,V:%.2fV\n", gucWorkState, gusDuty * 100 / 2400, gusFilamentCurrent/1000.0, gusFilamentVoltage/1000.0);
|
||||
gusXrayCurrent = adc2Xray(gausAdcBuf[0]);
|
||||
printf("workState:%d,duty:%d%%,I:%.3fA,V:%.2fV,Xray:%.3fmA\n", gucWorkState, gusDuty * 100 / 2400, gusFilamentCurrent/1000.0, gusFilamentVoltage/1000.0, gusXrayCurrent/1000.0/1000.0/1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user