Add externs. GCC10 complains about duplicate defines
This commit is contained in:
parent
d22283c9c4
commit
2bd6d05663
2
main.c
2
main.c
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user