fix(soc): Fix wrong efuse register on esp32c61

This commit is contained in:
C.S.M
2025-06-16 10:58:53 +08:00
parent caf1a18188
commit bdf4dafe56
12 changed files with 60 additions and 89 deletions
@@ -155,18 +155,15 @@ static inline void temperature_sensor_ll_set_clk_div(uint8_t clk_div)
/**
* @brief Retrieve and calculate the temperature sensor calibration value.
*
* @param[out] tsens_cal Pointer to a float where the calculated calibration value will be stored.
* The output is a signed floating-point value based on the efuse data.
*
* @return returns true to indicate successful retrieval. false for calibration failed.
* @return Temperature calibration value.
*/
static inline bool temperature_sensor_ll_calib_get_tsens_val(float* tsens_cal)
static inline int temperature_sensor_ll_load_calib_param(void)
{
uint32_t cal_temp = 0;
cal_temp = EFUSE.rd_blk2_data2.temp_calib;
// BIT(8) stands for sign: 1: negative, 0: positive
*tsens_cal = ((cal_temp & BIT(8)) != 0)? -(uint8_t)cal_temp: (uint8_t)cal_temp;
return true;
int tsens_cal = ((cal_temp & BIT(8)) != 0)? -(uint8_t)cal_temp: (uint8_t)cal_temp;
return tsens_cal;
}
#ifdef __cplusplus