Skip to content

Commit bab5a22

Browse files
committed
Fix build issues
H7 compatibility problems in port.c and peripherals/exti NRF build failures due to new use of const for PinAlarm pin objects Isolated board flash overage on blackpill_with_flash, remove audio modules
1 parent 9fe8d61 commit bab5a22

File tree

7 files changed

+22
-3
lines changed

7 files changed

+22
-3
lines changed

ports/nrf/common-hal/alarm/pin/PinAlarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static bool pins_configured = false;
5050
extern uint32_t reset_reason_saved;
5151
extern void dbg_dump_GPIOregs(void);
5252

53-
void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, mcu_pin_obj_t *pin, bool value, bool edge, bool pull) {
53+
void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, const mcu_pin_obj_t *pin, bool value, bool edge, bool pull) {
5454
if (edge) {
5555
mp_raise_ValueError(translate("Cannot wake on pin edge. Only level."));
5656
}
@@ -62,7 +62,7 @@ void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, mcu
6262
self->pull = pull;
6363
}
6464

65-
mcu_pin_obj_t *common_hal_alarm_pin_pinalarm_get_pin(alarm_pin_pinalarm_obj_t *self) {
65+
const mcu_pin_obj_t *common_hal_alarm_pin_pinalarm_get_pin(alarm_pin_pinalarm_obj_t *self) {
6666
return self->pin;
6767
}
6868

ports/nrf/common-hal/alarm/pin/PinAlarm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
typedef struct {
3131
mp_obj_base_t base;
32-
mcu_pin_obj_t *pin;
32+
const mcu_pin_obj_t *pin;
3333
bool value;
3434
bool pull;
3535
} alarm_pin_pinalarm_obj_t;

ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ MCU_PACKAGE = UFQFPN48
1717
LD_COMMON = boards/common_default.ld
1818
LD_FILE = boards/STM32F411_nvm_nofs.ld
1919

20+
# Too big for the flash
21+
CIRCUITPY_AUDIOCORE = 0
22+
CIRCUITPY_AUDIOPWMIO = 0
2023
CIRCUITPY_SYNTHIO = 0

ports/stm/common-hal/alarm/pin/PinAlarm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H
28+
#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H
29+
2730
#include "py/obj.h"
2831
#include "py/objtuple.h"
2932

@@ -39,3 +42,5 @@ void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ob
3942
void alarm_pin_pinalarm_prepare_for_deep_sleep(void);
4043
mp_obj_t alarm_pin_pinalarm_get_wakeup_alarm(size_t n_alarms, const mp_obj_t *alarms);
4144
bool alarm_pin_pinalarm_woke_us_up(void);
45+
46+
#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H

ports/stm/common-hal/alarm/time/TimeAlarm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H
28+
#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H
2729

2830
#include "py/obj.h"
2931

@@ -40,3 +42,5 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_
4042
void alarm_time_timealarm_reset(void);
4143

4244
void alarm_time_timealarm_prepare_for_deep_sleep(void);
45+
46+
#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H

ports/stm/peripherals/exti.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#include "peripherals/exti.h"
3434

35+
#if !(CPY_STM32H7)
36+
3537
STATIC bool stm_exti_reserved[STM32_GPIO_PORT_SIZE];
3638
STATIC bool stm_exti_never_reset[STM32_GPIO_PORT_SIZE];
3739
STATIC void (*stm_exti_callback[STM32_GPIO_PORT_SIZE])(uint8_t num);
@@ -145,3 +147,5 @@ void EXTI15_10_IRQHandler(void)
145147
}
146148
}
147149
}
150+
151+
#endif

ports/stm/supervisor/port.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ safe_mode_t port_init(void) {
175175
HAL_Init(); // Turns on SysTick
176176
__HAL_RCC_SYSCFG_CLK_ENABLE();
177177

178+
#if CPY_STM32F4
178179
__HAL_RCC_PWR_CLK_ENABLE();
179180
HAL_PWR_EnableBkUpAccess();
180181

@@ -194,6 +195,8 @@ safe_mode_t port_init(void) {
194195
__HAL_RCC_BACKUPRESET_FORCE();
195196
__HAL_RCC_BACKUPRESET_RELEASE();
196197

198+
#endif
199+
197200
stm32_peripherals_clocks_init();
198201
stm32_peripherals_gpio_init();
199202
stm32_peripherals_rtc_init();

0 commit comments

Comments
 (0)