Skip to content

Commit 058a731

Browse files
committed
mimxrt10xx: Fix cpu.temperature crash
Fixes #2514
1 parent 2314f98 commit 058a731

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/mimxrt10xx/common-hal/microcontroller/Processor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ float common_hal_mcu_processor_get_temperature(void) {
3737
tempmon_config_t config;
3838
TEMPMON_GetDefaultConfig(&config);
3939

40+
OCOTP_Init(OCOTP, CLOCK_GetFreq(kCLOCK_IpgClk));
4041
TEMPMON_Init(TEMPMON, &config);
4142
TEMPMON_StartMeasure(TEMPMON);
4243

4344
const float temp = TEMPMON_GetCurrentTemperature(TEMPMON);
4445
TEMPMON_Deinit(TEMPMON);
46+
OCOTP_Deinit(OCOTP);
4547

4648
return temp;
4749
}

0 commit comments

Comments
 (0)