|
简单的修改,64000后面先添加几个0测试就行:- /* Fixed timeout value for ADC calibration. */
- /* Values defined to be higher than worst cases: low clock frequency, */
- /* maximum prescalers. */
- /* Ex of profile low frequency : f_ADC at 0.35 MHz (minimum value */
- /* according to Data sheet), calibration_time MAX = 112 / f_ADC */
- /* 112 / 350,000 = 0.32 ms */
- /* At maximum CPU speed (200 MHz), this means */
- /* 0.8 ms * 200 MHz = 64000 CPU cycles */
- #define ADC_CALIBRATION_TIMEOUT ((uint32_t) 64000) /*!< ADC calibration time-out value */
复制代码
偏移校准没问题:
- if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
- {
- Error_Handler(__FILE__, __LINE__);
- }
复制代码
但是线性度校准,这个溢出时间小了:
- if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED) != HAL_OK)
- {
- Error_Handler(__FILE__, __LINE__);
- }
复制代码
|
评分
-
查看全部评分
|