Skip to content

Commit 698ad74

Browse files
committed
Fix oscillator issue, add button and LED pins
1 parent e28d244 commit 698ad74

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ports/stm32f4/boards/espruino_pico/pins.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
2525
{ MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) },
2626
{ MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) },
2727
{ MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) },
28+
29+
{ MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) },
30+
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) },
31+
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) },
2832
};
2933
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* THE SOFTWARE.
2626
*/
2727
#include "stm32f4xx_hal.h"
28+
#include "py/mpconfig.h"
2829

2930
void stm32f4_peripherals_clocks_init(void) {
3031
//System clock init
@@ -44,7 +45,7 @@ void stm32f4_peripherals_clocks_init(void) {
4445
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
4546
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
4647
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
47-
RCC_OscInitStruct.PLL.PLLM = 12;
48+
RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV;
4849
RCC_OscInitStruct.PLL.PLLN = 336;
4950
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
5051
RCC_OscInitStruct.PLL.PLLQ = 7;

ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void stm32f4_peripherals_gpio_init(void) {
3838
__HAL_RCC_GPIOH_CLK_ENABLE();
3939

4040
//Never reset pins
41-
never_reset_pin_number(2,13); //PC13 anti tamp
4241
never_reset_pin_number(2,14); //PC14 OSC32_IN
4342
never_reset_pin_number(2,15); //PC15 OSC32_OUT
4443
never_reset_pin_number(0,13); //PA13 SWDIO

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy