diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 0c8131ef40..f3a578014e 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -37,11 +37,13 @@ float common_hal_mcu_processor_get_temperature(void) { tempmon_config_t config; TEMPMON_GetDefaultConfig(&config); + OCOTP_Init(OCOTP, CLOCK_GetFreq(kCLOCK_IpgClk)); TEMPMON_Init(TEMPMON, &config); TEMPMON_StartMeasure(TEMPMON); const float temp = TEMPMON_GetCurrentTemperature(TEMPMON); TEMPMON_Deinit(TEMPMON); + OCOTP_Deinit(OCOTP); return temp; }