Merge pull request #3194 from tannewt/gcc10

Prep for GCC10
This commit is contained in:
Scott Shawcroft 2020-07-23 14:39:21 -07:00 committed by GitHub
commit 060ab8a1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 27 additions and 20 deletions

2
main.c
View File

@ -331,6 +331,8 @@ bool run_code_py(safe_mode_t safe_mode) {
}
}
FIL* boot_output_file;
void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
// If not in safe mode, run boot before initing USB and capture output in a
// file.

View File

@ -37,8 +37,8 @@
#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32())
// Number of bytes in receive buffer
volatile uint8_t usb_rx_count;
volatile bool mp_cdc_enabled;
extern volatile uint8_t usb_rx_count;
extern volatile bool mp_cdc_enabled;
int receive_usb(void);

View File

@ -77,8 +77,8 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
mp_obj_t index, bool is_slice);
const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction);
const char nibble_to_hex_upper[16];
const char nibble_to_hex_lower[16];
extern const char nibble_to_hex_upper[16];
extern const char nibble_to_hex_lower[16];
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj);
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj);

View File

@ -346,6 +346,11 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/
$(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h
# Standard C functions like memset need to be compiled with special flags so
# the compiler does not optimise these functions in terms of themselves.
CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto
$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)
# Force nlr code to always be compiled with space-saving optimisation so
# that the function preludes are of a minimal and predictable form.
$(PY_BUILD)/nlr%.o: CFLAGS += -Os

View File

@ -29,7 +29,7 @@
#include "shared-module/_pixelbuf/PixelBuf.h"
const mp_obj_type_t pixelbuf_pixelbuf_type;
extern const mp_obj_type_t pixelbuf_pixelbuf_type;
void common_hal__pixelbuf_pixelbuf_construct(pixelbuf_pixelbuf_obj_t *self, size_t n,
pixelbuf_byteorder_details_t* byteorder, mp_float_t brightness, bool auto_write, uint8_t* header,

View File

@ -37,7 +37,7 @@ typedef struct {
mp_obj_base_t base;
} digitalio_direction_obj_t;
const mp_obj_type_t digitalio_direction_type;
extern const mp_obj_type_t digitalio_direction_type;
extern const digitalio_direction_obj_t digitalio_direction_input_obj;
extern const digitalio_direction_obj_t digitalio_direction_output_obj;

View File

@ -38,7 +38,7 @@ typedef struct {
mp_obj_base_t base;
} digitalio_drive_mode_obj_t;
const mp_obj_type_t digitalio_drive_mode_type;
extern const mp_obj_type_t digitalio_drive_mode_type;
extern const digitalio_drive_mode_obj_t digitalio_drive_mode_push_pull_obj;
extern const digitalio_drive_mode_obj_t digitalio_drive_mode_open_drain_obj;

View File

@ -35,7 +35,7 @@ typedef enum _digitalio_pull_t {
PULL_DOWN
} digitalio_pull_t;
const mp_obj_type_t digitalio_pull_type;
extern const mp_obj_type_t digitalio_pull_type;
typedef struct {
mp_obj_base_t base;

View File

@ -31,7 +31,7 @@
#include "common-hal/microcontroller/Processor.h"
const mp_obj_type_t mcu_processor_type;
extern const mp_obj_type_t mcu_processor_type;
uint32_t common_hal_mcu_processor_get_frequency(void);
float common_hal_mcu_processor_get_temperature(void);

View File

@ -35,7 +35,7 @@ typedef enum {
RUNMODE_BOOTLOADER
} mcu_runmode_t;
const mp_obj_type_t mcu_runmode_type;
extern const mp_obj_type_t mcu_runmode_type;
typedef struct {
mp_obj_base_t base;

View File

@ -29,7 +29,7 @@
#include "common-hal/nvm/ByteArray.h"
const mp_obj_type_t nvm_bytearray_type;
extern const mp_obj_type_t nvm_bytearray_type;
uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self);

View File

@ -32,7 +32,7 @@
#include "py/objtuple.h"
const mp_rom_obj_tuple_t common_hal_os_uname_info_obj;
extern const mp_rom_obj_tuple_t common_hal_os_uname_info_obj;
mp_obj_t common_hal_os_uname(void);
void common_hal_os_chdir(const char* path);

View File

@ -31,7 +31,7 @@
#include "py/obj.h"
const mp_obj_type_t supervisor_runtime_type;
extern const mp_obj_type_t supervisor_runtime_type;
bool common_hal_get_serial_connected(void);

View File

@ -29,7 +29,7 @@
#include "shared-module/usb_hid/Device.h"
const mp_obj_type_t usb_hid_device_type;
extern const mp_obj_type_t usb_hid_device_type;
void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* report, uint8_t len);
uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self);

View File

@ -35,7 +35,7 @@
#ifdef CIRCUITPY_BOOT_OUTPUT_FILE
#include "lib/oofatfs/ff.h"
FIL* boot_output_file;
extern FIL* boot_output_file;
#endif
void serial_early_init(void);

View File

@ -539,14 +539,14 @@ h_file.write("""\
#include <stdint.h>
const uint8_t usb_desc_dev[{device_length}];
extern const uint8_t usb_desc_dev[{device_length}];
// Make sure the control buffer is big enough to fit the descriptor.
#define CFG_TUD_ENUM_BUFFER_SIZE {max_configuration_length}
const uint8_t usb_desc_cfg[{configuration_length}];
uint16_t usb_serial_number[{serial_number_length}];
uint16_t const * const string_desc_arr [{string_descriptor_length}];
extern const uint8_t usb_desc_cfg[{configuration_length}];
extern uint16_t usb_serial_number[{serial_number_length}];
extern uint16_t const * const string_desc_arr [{string_descriptor_length}];
const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
#define USB_HID_NUM_DEVICES {hid_num_devices}