Deleted Warnings Chanaged ValueError Method
This commit is contained in:
parent
0b6c451fdf
commit
208bfb33aa
@ -1108,7 +1108,8 @@ msgid "Framebuffer requires %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
|
||||
msgid "Frequency Out of Range Must be between 24Mhz and 1.008Ghz"
|
||||
msgid ""
|
||||
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/pwmio/PWMOut.c
|
||||
|
@ -54,17 +54,10 @@ float common_hal_mcu_processor_get_temperature(void) {
|
||||
|
||||
uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self,
|
||||
uint32_t frequency) {
|
||||
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);
|
||||
uint32_t freq = frequency / 1000000;
|
||||
if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 &&
|
||||
freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) {
|
||||
mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"));
|
||||
}
|
||||
SystemCoreClock = setarmclock(frequency);
|
||||
return SystemCoreClock;
|
||||
|
Loading…
Reference in New Issue
Block a user