修改ADC采样时间

This commit is contained in:
草团君 2024-04-22 11:51:26 +08:00
parent 922d376bcc
commit 290fe0f827
5 changed files with 493 additions and 490 deletions

View File

@ -145,7 +145,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-US -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(0BC11477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32L0xx_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32L072RBTx$CMSIS\Flash\STM32L0xx_128.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2</Name>
<Name>-US -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(0BC11477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32L0xx_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32L072RBTx$CMSIS\Flash\STM32L0xx_128.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>

View File

@ -138,7 +138,7 @@
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2V8M.DLL</Flash2>
<Flash3></Flash3>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@
extern __IO app_t app;
extern motor_t *motor;
extern uint8_t detect_result;
static struct flow fl_adc_inspection; // ADC
static struct flow fl_systom_inspection; // 系统
@ -17,6 +18,7 @@ static uint8_t adc_inspection(struct flow *fl)
FL_HEAD(fl);
for (;;)
{
detect_result = ST_DEV_NORMAL;
// 扭力
app.adc.torsion_in13.original_value = get_sensor_adc(GET_TORSION_VALUE);
app.adc.torsion_in13.calibration_value = torsion_detect();
@ -38,7 +40,7 @@ static uint8_t adc_inspection(struct flow *fl)
app.adc.oflow_in10.calibration_value = flow_detect(GET_OUTPUT_FLOW_VALUE);
sensor_adc[GET_OUTPUT_FLOW_VALUE] = S2B_UINT16(app.adc.oflow_in10.original_value);
FL_LOCK_DELAY(fl, FL_CLOCK_100MSEC); /* 延时100毫秒 */
FL_LOCK_DELAY(fl, FL_CLOCK_10MSEC); /* 延时10毫秒 */
}
FL_TAIL(fl);
}

View File

@ -339,7 +339,7 @@ float32 pressure_detect(uint8_t id)
adc = get_sensor_adc(id);
val = adc / 4096 * 3000;
if (val < 600 || val > 3000)
if (val < 500 || val > 3000)
{
detect_result = ST_DEV_MISS;
}
@ -354,7 +354,7 @@ float32 flow_detect(uint8_t id)
adc = get_sensor_adc(id);
val = adc / 4096 * 3000;
if (val < 600 || val > 3000)
if (val < 500 || val > 3000)
{
detect_result = ST_DEV_MISS;
}