kopia lustrzana https://github.com/micropython/micropython
Merge af7470ad10
into 7b050b366b
commit
75f740eb5d
|
@ -76,6 +76,10 @@ int main(int argc, char **argv) {
|
|||
// This is a tickless port, interrupts should always trigger SEV.
|
||||
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
|
||||
|
||||
// set the MCU frequency and as a side effect the peripheral clock
|
||||
// to 48 MHz.
|
||||
set_sys_clock_khz(125000, false);
|
||||
|
||||
#if MICROPY_HW_ENABLE_UART_REPL
|
||||
bi_decl(bi_program_feature("UART REPL"))
|
||||
setup_default_uart();
|
||||
|
@ -227,6 +231,12 @@ int main(int argc, char **argv) {
|
|||
|
||||
gc_sweep_all();
|
||||
mp_deinit();
|
||||
// Reset the MCU frequency
|
||||
set_sys_clock_khz(125000, false);
|
||||
#if MICROPY_HW_ENABLE_UART_REPL
|
||||
setup_default_uart();
|
||||
mp_uart_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -95,6 +95,12 @@ static void mp_machine_set_freq(size_t n_args, const mp_obj_t *args) {
|
|||
if (!set_sys_clock_khz(freq / 1000, false)) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("cannot change frequency"));
|
||||
}
|
||||
// Option: Set PERI clock to system clock again
|
||||
// clock_configure(clk_peri,
|
||||
// 0,
|
||||
// CLOCKS_CLK_PERI_CTRL_AUXSRC_VALUE_CLK_SYS,
|
||||
// SYS_CLK_KHZ * KHZ,
|
||||
// SYS_CLK_KHZ * KHZ);
|
||||
#if MICROPY_HW_ENABLE_UART_REPL
|
||||
setup_default_uart();
|
||||
mp_uart_init();
|
||||
|
|
Ładowanie…
Reference in New Issue