From 0b6c451fdf8eb59fecb4f6f51c24371b6a684ef5 Mon Sep 17 00:00:00 2001 From: mjs513 Date: Sat, 16 Apr 2022 11:01:50 -0400 Subject: [PATCH] Add Overclocking Warnings to Processor.c --- ports/mimxrt10xx/common-hal/microcontroller/Processor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index ac76c88330..96f1185b3b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -57,6 +57,15 @@ uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, if (frequency < 24000000 || frequency > 1008000000) { mp_raise_ValueError(translate("Frequency Out of Range Must be between 24Mhz and 1.008Ghz")); } + if (frequency <= 600000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz\n", frequency); + } + if (frequency > 600000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked\n", frequency); + } + if (frequency > 816000000) { + mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked, Cooling Required!\n", frequency); + } SystemCoreClock = setarmclock(frequency); return SystemCoreClock; }