Skip to content

Commit 644d2ba

Browse files
tannewtjepler
authored andcommitted
Add more "extern" declarations for gcc10 compat
gcc has tightened the restrictions on forward declarations that lack "extern". Fix them up.
1 parent 5771be9 commit 644d2ba

File tree

23 files changed

+60
-58
lines changed

23 files changed

+60
-58
lines changed

ports/cxd56/common-hal/microcontroller/Processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ typedef struct {
3535
mp_obj_base_t base;
3636
} mcu_processor_obj_t;
3737

38-
const mp_obj_type_t mcu_processor_type;
38+
extern const mp_obj_type_t mcu_processor_type;
3939

4040
#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H

ports/mimxrt10xx/mphalport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) {
3939
return supervisor_ticks_ms32();
4040
}
4141
// Number of bytes in receive buffer
42-
volatile uint8_t usb_rx_count;
43-
volatile bool mp_cdc_enabled;
42+
extern volatile uint8_t usb_rx_count;
43+
extern volatile bool mp_cdc_enabled;
4444

4545
int receive_usb(void);
4646

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
2828
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
2929

30-
LPI2C_Type *mcu_i2c_banks[2];
30+
extern LPI2C_Type *mcu_i2c_banks[2];
3131

3232
extern const mcu_periph_obj_t mcu_i2c_sda_list[8];
3333
extern const mcu_periph_obj_t mcu_i2c_scl_list[8];
3434

35-
LPSPI_Type *mcu_spi_banks[2];
35+
extern LPSPI_Type *mcu_spi_banks[2];
3636

3737
extern const mcu_periph_obj_t mcu_spi_sck_list[4];
3838
extern const mcu_periph_obj_t mcu_spi_mosi_list[4];
3939
extern const mcu_periph_obj_t mcu_spi_miso_list[4];
4040

41-
LPUART_Type *mcu_uart_banks[4];
41+
extern LPUART_Type *mcu_uart_banks[4];
4242

4343
extern const mcu_periph_obj_t mcu_uart_rx_list[9];
4444
extern const mcu_periph_obj_t mcu_uart_tx_list[9];

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H
2929
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H
3030

31-
LPI2C_Type *mcu_i2c_banks[4];
31+
extern LPI2C_Type *mcu_i2c_banks[4];
3232

3333
extern const mcu_periph_obj_t mcu_i2c_sda_list[8];
3434
extern const mcu_periph_obj_t mcu_i2c_scl_list[8];
3535

36-
LPSPI_Type *mcu_spi_banks[4];
36+
extern LPSPI_Type *mcu_spi_banks[4];
3737

3838
extern const mcu_periph_obj_t mcu_spi_sck_list[8];
3939
extern const mcu_periph_obj_t mcu_spi_mosi_list[8];
4040
extern const mcu_periph_obj_t mcu_spi_miso_list[8];
4141

42-
LPUART_Type *mcu_uart_banks[8];
42+
extern LPUART_Type *mcu_uart_banks[8];
4343

4444
extern const mcu_periph_obj_t mcu_uart_rx_list[16];
4545
extern const mcu_periph_obj_t mcu_uart_tx_list[16];

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
2828
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
2929

30-
LPI2C_Type *mcu_i2c_banks[4];
30+
extern LPI2C_Type *mcu_i2c_banks[4];
3131

3232
extern const mcu_periph_obj_t mcu_i2c_sda_list[9];
3333
extern const mcu_periph_obj_t mcu_i2c_scl_list[9];
3434

35-
LPSPI_Type *mcu_spi_banks[4];
35+
extern LPSPI_Type *mcu_spi_banks[4];
3636

3737
extern const mcu_periph_obj_t mcu_spi_sck_list[8];
3838
extern const mcu_periph_obj_t mcu_spi_mosi_list[8];
3939
extern const mcu_periph_obj_t mcu_spi_miso_list[8];
4040

41-
LPUART_Type *mcu_uart_banks[8];
41+
extern LPUART_Type *mcu_uart_banks[8];
4242

4343
extern const mcu_periph_obj_t mcu_uart_rx_list[18];
4444
extern const mcu_periph_obj_t mcu_uart_tx_list[18];

ports/nrf/common-hal/_bleio/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ void check_sec_status(uint8_t sec_status) {
8787
}
8888
}
8989

90+
bool vm_used_ble;
91+
9092
// Turn off BLE on a reset or reload.
9193
void bleio_reset() {
9294
if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) {

ports/nrf/common-hal/_bleio/__init__.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ void check_gatt_status(uint16_t gatt_status);
4545
void check_sec_status(uint8_t sec_status);
4646

4747
// Track if the user code modified the BLE state to know if we need to undo it on reload.
48-
bool vm_used_ble;
48+
extern bool vm_used_ble;
4949

5050
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_INIT_H

ports/stm/common-hal/pulseio/PWMOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
9696
//if pin is same
9797
if (l_tim->pin == pin) {
9898
//check if the timer has a channel active, or is reserved by main timer system
99-
if (reserved_tim[l_tim_index] != 0) {
99+
if (l_tim_index < TIM_BANK_ARRAY_LEN && reserved_tim[l_tim_index] != 0) {
100100
// Timer has already been reserved by an internal module
101101
if (stm_peripherals_timer_is_reserved(mcu_tim_banks[l_tim_index])) {
102102
tim_taken_internal = true;

ports/stm/mphalport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) {
3838
return supervisor_ticks_ms32();
3939
}
4040
// Number of bytes in receive buffer
41-
volatile uint8_t usb_rx_count;
42-
volatile bool mp_cdc_enabled;
41+
extern volatile uint8_t usb_rx_count;
42+
extern volatile bool mp_cdc_enabled;
4343

4444
int receive_usb(void);
4545

ports/stm/peripherals/stm32f4/stm32f401xe/periph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[6];
5151
//Timers
5252
#define TIM_BANK_ARRAY_LEN 14
5353
#define TIM_PIN_ARRAY_LEN 44
54-
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
55-
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
54+
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
55+
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
5656

5757
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H

0 commit comments

Comments
 (0)