Fix oscillator issue, add button and LED pins
This commit is contained in:
parent
e28d244a0d
commit
698ad745f6
@ -25,5 +25,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) },
|
||||
};
|
||||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
||||
|
@ -25,6 +25,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "py/mpconfig.h"
|
||||
|
||||
void stm32f4_peripherals_clocks_init(void) {
|
||||
//System clock init
|
||||
@ -44,7 +45,7 @@ void stm32f4_peripherals_clocks_init(void) {
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 12;
|
||||
RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV;
|
||||
RCC_OscInitStruct.PLL.PLLN = 336;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||
|
@ -38,7 +38,6 @@ void stm32f4_peripherals_gpio_init(void) {
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
|
||||
//Never reset pins
|
||||
never_reset_pin_number(2,13); //PC13 anti tamp
|
||||
never_reset_pin_number(2,14); //PC14 OSC32_IN
|
||||
never_reset_pin_number(2,15); //PC15 OSC32_OUT
|
||||
never_reset_pin_number(0,13); //PA13 SWDIO
|
||||
|
Loading…
Reference in New Issue
Block a user