Skip to content

Commit 208bfb3

Browse files
committed
Deleted Warnings Chanaged ValueError Method
1 parent 0b6c451 commit 208bfb3

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

locale/circuitpython.pot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,8 @@ msgid "Framebuffer requires %d bytes"
11081108
msgstr ""
11091109

11101110
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
1111-
msgid "Frequency Out of Range Must be between 24Mhz and 1.008Ghz"
1111+
msgid ""
1112+
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
11121113
msgstr ""
11131114

11141115
#: shared-bindings/pwmio/PWMOut.c

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,10 @@ float common_hal_mcu_processor_get_temperature(void) {
5454

5555
uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self,
5656
uint32_t frequency) {
57-
if (frequency < 24000000 || frequency > 1008000000) {
58-
mp_raise_ValueError(translate("Frequency Out of Range Must be between 24Mhz and 1.008Ghz"));
59-
}
60-
if (frequency <= 600000000) {
61-
mp_printf(&mp_plat_print, "System Clock is set to %d hz\n", frequency);
62-
}
63-
if (frequency > 600000000) {
64-
mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked\n", frequency);
65-
}
66-
if (frequency > 816000000) {
67-
mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked, Cooling Required!\n", frequency);
57+
uint32_t freq = frequency / 1000000;
58+
if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 &&
59+
freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) {
60+
mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"));
6861
}
6962
SystemCoreClock = setarmclock(frequency);
7063
return SystemCoreClock;

0 commit comments

Comments
 (0)