diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c index bb6b8788b6..0d87f03ae3 100644 --- a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c @@ -33,6 +33,7 @@ #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" +#include "shared-bindings/_bleio/CharacteristicBuffer.h" #include "supervisor/shared/tick.h" #include "common-hal/_bleio/CharacteristicBuffer.h" diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index 2933bb87a5..185a8b3517 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -85,5 +85,6 @@ typedef struct { uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection); bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle); +void bleio_connection_clear(bleio_connection_internal_t *self); #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index b0fc884e00..ff3294a865 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -857,20 +857,6 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl } } -int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) { - struct __packed req { - struct bt_att_hdr h; - struct bt_att_find_info_req r; - } req = { { - .code = BT_ATT_OP_FIND_INFO_REQ, - }, { - .start_handle = start_handle, - .end_handle = end_handle, - }}; - - return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *)&req, response_buffer); -} - STATIC void process_find_info_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 2) { return; // invalid, drop @@ -925,7 +911,7 @@ STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl } } -void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { +STATIC void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { struct bt_att_read_group_req *req = (struct bt_att_read_group_req *)data; uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8); @@ -1009,25 +995,6 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui } } -int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) { - - typedef struct __packed { - struct bt_att_hdr h; - struct bt_att_read_group_req r; - } req_t; - - uint8_t req_bytes[sizeof(req_t) + sizeof(uuid)]; - req_t *req = (req_t *)req_bytes; - - req->h.code = BT_ATT_OP_READ_GROUP_REQ; - req->r.start_handle = start_handle; - req->r.end_handle = end_handle; - req->r.uuid[0] = uuid & 0xff; - req->r.uuid[1] = uuid >> 8; - - return send_req_wait_for_rsp(conn_handle, sizeof(req_bytes), req_bytes, response_buffer); -} - STATIC void process_read_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 2) { return; // invalid, drop @@ -1305,24 +1272,6 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl } } -int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) { - typedef struct __packed { - struct bt_att_hdr h; - struct bt_att_read_type_req r; - } req_t; - - uint8_t req_bytes[sizeof(req_t) + sizeof(type)]; - req_t *req = (req_t *)req_bytes; - - req->h.code = BT_ATT_OP_READ_TYPE_REQ; - req->r.start_handle = start_handle; - req->r.end_handle = end_handle; - req->r.uuid[0] = type & 0xff; - req->r.uuid[1] = type >> 8; - - return send_req_wait_for_rsp(conn_handle, sizeof(req_bytes), req_bytes, response_buffer); -} - STATIC void process_read_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 1) { return; // invalid, drop @@ -1713,77 +1662,3 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { break; } } - -// FIX Do we need all of these? -void check_att_err(uint8_t err) { - const compressed_string_t *msg = NULL; - switch (err) { - case 0: - return; - case BT_ATT_ERR_INVALID_HANDLE: - msg = translate("Invalid handle"); - break; - case BT_ATT_ERR_READ_NOT_PERMITTED: - msg = translate("Read not permitted"); - break; - case BT_ATT_ERR_WRITE_NOT_PERMITTED: - msg = translate("Write not permitted"); - break; - case BT_ATT_ERR_INVALID_PDU: - msg = translate("Invalid PDU"); - break; - case BT_ATT_ERR_NOT_SUPPORTED: - msg = translate("Not supported"); - break; - case BT_ATT_ERR_INVALID_OFFSET: - msg = translate("Invalid offset"); - break; - case BT_ATT_ERR_PREPARE_QUEUE_FULL: - msg = translate("Prepare queue full"); - break; - case BT_ATT_ERR_ATTRIBUTE_NOT_FOUND: - msg = translate("Attribute not found"); - break; - case BT_ATT_ERR_ATTRIBUTE_NOT_LONG: - msg = translate("Attribute not long"); - break; - case BT_ATT_ERR_ENCRYPTION_KEY_SIZE: - msg = translate("Encryption key size"); - break; - case BT_ATT_ERR_INVALID_ATTRIBUTE_LEN: - msg = translate("Invalid attribute length"); - break; - case BT_ATT_ERR_UNLIKELY: - msg = translate("Unlikely"); - break; - case BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE: - msg = translate("Unsupported group type"); - break; - case BT_ATT_ERR_INSUFFICIENT_RESOURCES: - msg = translate("Insufficient resources"); - break; - case BT_ATT_ERR_DB_OUT_OF_SYNC: - msg = translate("DB out of sync"); - break; - case BT_ATT_ERR_VALUE_NOT_ALLOWED: - msg = translate("Value not allowed"); - break; - } - if (msg) { - mp_raise_bleio_BluetoothError(msg); - } - - switch (err) { - case BT_ATT_ERR_AUTHENTICATION: - msg = translate("Insufficient authentication"); - break; - case BT_ATT_ERR_INSUFFICIENT_ENCRYPTION: - msg = translate("Insufficient encryption"); - break; - } - if (msg) { - mp_raise_bleio_SecurityError(msg); - } - - mp_raise_bleio_BluetoothError(translate("Unknown ATT error: 0x%02x"), err); -} diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 721cfd4f0a..045f3741eb 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -291,7 +291,7 @@ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno endif SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) -$(patsubst $(SRC_ASF),%.c,%.o): CFLAGS += -Wno-missing-prototypes +$(patsubst %.c,$(BUILD)/%.o,$(SRC_ASF)): CFLAGS += -Wno-missing-prototypes SRC_PERIPHERALS := \ peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \ @@ -310,7 +310,7 @@ SRC_PERIPHERALS := \ peripherals/samd/sercom.c \ peripherals/samd/timers.c \ -$(patsubst $(SRC_PERIPHERALS),%.c,%.o): CFLAGS += -Wno-missing-prototypes +$(patsubst %.c,$(BUILD)/%.o,$(SRC_PERIPHERALS)): CFLAGS += -Wno-missing-prototypes SRC_C += \ audio_dma.c \ diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index e00d69c848..e6363395a6 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -485,6 +485,3 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se return values_output; } - -void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t* self, uint8_t* buffer, uint32_t length) { -} diff --git a/ports/atmel-samd/common-hal/busio/__init__.c b/ports/atmel-samd/common-hal/busio/__init__.c index 8ec549e931..8d1f085ffa 100644 --- a/ports/atmel-samd/common-hal/busio/__init__.c +++ b/ports/atmel-samd/common-hal/busio/__init__.c @@ -25,6 +25,7 @@ */ #include "samd/sercom.h" +#include "common-hal/busio/__init__.h" static bool never_reset_sercoms[SERCOM_INST_NUM]; diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c index 4531a4ed8c..e4df55eba6 100644 --- a/ports/atmel-samd/common-hal/countio/Counter.c +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -1,5 +1,6 @@ #include "common-hal/countio/Counter.h" +#include "shared-bindings/countio/Counter.h" #include "atmel_start_pins.h" diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index e9831c953a..29d6612ad8 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -65,6 +65,7 @@ #include "py/mphal.h" #include "common-hal/microcontroller/Processor.h" +#include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" #include "samd/adc.h" diff --git a/ports/atmel-samd/common-hal/nvm/ByteArray.c b/ports/atmel-samd/common-hal/nvm/ByteArray.c index 9d711d3413..e6f77bb048 100644 --- a/ports/atmel-samd/common-hal/nvm/ByteArray.c +++ b/ports/atmel-samd/common-hal/nvm/ByteArray.c @@ -25,6 +25,7 @@ */ #include "common-hal/nvm/ByteArray.h" +#include "shared-bindings/nvm/ByteArray.h" #include "hal_flash.h" @@ -33,11 +34,11 @@ #include #include -uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { +uint32_t common_hal_nvm_bytearray_get_length(const nvm_bytearray_obj_t *self) { return self->len; } -bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, +bool common_hal_nvm_bytearray_set_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) { // We don't use features that use any advanced NVMCTRL features so we can fake the descriptor // whenever we need it instead of storing it long term. @@ -49,7 +50,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, } // NVM memory is memory mapped so reading it is easy. -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, +void common_hal_nvm_bytearray_get_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t *values) { memcpy(values, self->start_address + start_index, len); } diff --git a/ports/atmel-samd/common-hal/os/__init__.c b/ports/atmel-samd/common-hal/os/__init__.c index 6c554bff30..f0e20bdfcf 100644 --- a/ports/atmel-samd/common-hal/os/__init__.c +++ b/ports/atmel-samd/common-hal/os/__init__.c @@ -30,6 +30,8 @@ #include "py/objtuple.h" #include "py/qstr.h" +#include "shared-bindings/os/__init__.h" + #ifdef SAM_D5X_E5X #include "hal/include/hal_rand_sync.h" #endif @@ -66,7 +68,7 @@ mp_obj_t common_hal_os_uname(void) { return (mp_obj_t)&os_uname_info_obj; } -bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { +bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) { #ifdef SAM_D5X_E5X hri_mclk_set_APBCMASK_TRNG_bit(MCLK); struct rand_sync_desc random; diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index f07cadf417..6e2fb58e51 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -26,6 +26,7 @@ */ #include "common-hal/ps2io/Ps2.h" +#include "shared-bindings/ps2io/Ps2.h" #include @@ -302,11 +303,6 @@ uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t *self) { return self->bufcount; } -bool common_hal_ps2io_ps2_get_paused(ps2io_ps2_obj_t *self) { - uint32_t mask = 1 << self->channel; - return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0; -} - int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t *self) { common_hal_mcu_disable_interrupts(); if (self->bufcount <= 0) { diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index b72e0d1f43..b0407a1136 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -59,7 +59,7 @@ static void turn_off(__IO PORT_PINCFG_Type *pincfg) { pincfg->reg = PORT_PINCFG_RESETVALUE; } -void pulse_finish(void) { +STATIC void pulse_finish(void) { pulse_index++; if (active_pincfg == NULL) { diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index fa6a2d3f47..eaec10463d 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -91,7 +91,7 @@ static uint8_t tcc_channel(const pin_timer_t *t) { return t->wave_output % tcc_cc_num[t->index]; } -bool channel_ok(const pin_timer_t *t) { +STATIC bool channel_ok(const pin_timer_t *t) { uint8_t channel_bit = 1 << tcc_channel(t); return (!t->is_tc && ((tcc_channels[t->index] & channel_bit) == 0)) || t->is_tc; diff --git a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c index dc9cf65334..856fe04dbc 100644 --- a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -25,6 +25,7 @@ */ #include "common-hal/rotaryio/IncrementalEncoder.h" +#include "shared-bindings/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h" #include "atmel_start_pins.h" diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 65d7d94220..e2a67bd174 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -35,6 +35,7 @@ #include "py/runtime.h" #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" #include "supervisor/shared/translate.h" diff --git a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c index 329242887c..2091b7d302 100644 --- a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c +++ b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c @@ -50,7 +50,7 @@ mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { return self->timeout; } -void setup_wdt(watchdog_watchdogtimer_obj_t *self, int setting) { +STATIC void setup_wdt(watchdog_watchdogtimer_obj_t *self, int setting) { OSC32KCTRL->OSCULP32K.bit.EN1K = 1; // Enable out 1K (for WDT) // disable watchdog for config diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 2739bf6547..28e28d6269 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -132,7 +132,7 @@ endif # Remove -Wno-stringop-overflow after we can test with CI's GCC 10. Mac's looks weird. DISABLE_WARNINGS = -Wno-stringop-overflow -Wno-unused-function -Wno-unused-variable -Wno-strict-overflow -Wno-cast-align -Wno-strict-prototypes -Wno-nested-externs -Wno-double-promotion -Wno-sign-compare -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) -Werror=missing-prototypes CFLAGS += \ -march=armv6-m \ diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 39b975ff8d..61e526b226 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -617,7 +617,7 @@ const mp_obj_type_t rp2pio_statemachine_type = { .locals_dict = (mp_obj_dict_t *)&rp2pio_statemachine_locals_dict, }; -rp2pio_statemachine_obj_t *validate_obj_is_statemachine(mp_obj_t obj) { +static rp2pio_statemachine_obj_t *validate_obj_is_statemachine(mp_obj_t obj) { if (!mp_obj_is_type(obj, &rp2pio_statemachine_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), rp2pio_statemachine_type.name); } diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c index 1e16629f30..2d452244f7 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c @@ -31,6 +31,7 @@ #include "shared-bindings/busio/SPI.h" #include "shared-bindings/microcontroller/Pin.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" +#include "supervisor/board.h" #include "supervisor/shared/board.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/raspberrypi/common-hal/alarm/SleepMemory.c b/ports/raspberrypi/common-hal/alarm/SleepMemory.c index b8fcdfbccf..c1765296dc 100644 --- a/ports/raspberrypi/common-hal/alarm/SleepMemory.c +++ b/ports/raspberrypi/common-hal/alarm/SleepMemory.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "common-hal/alarm/SleepMemory.h" +#include "shared-bindings/alarm/SleepMemory.h" void alarm_sleep_memory_reset(void) { } diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c index 276e2e409a..53cbfca57b 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c @@ -42,7 +42,7 @@ STATIC bool _pinalarm_set = false; #define GPIO_IRQ_ALL_EVENTS 0x15u -void gpio_callback(uint gpio, uint32_t events) { +STATIC void gpio_callback(uint gpio, uint32_t events) { alarm_triggered_pins |= (1 << gpio); woke_up = true; diff --git a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c index 65c2b680d8..16ac8fc31e 100644 --- a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c @@ -37,7 +37,7 @@ STATIC bool woke_up = false; STATIC bool _timealarm_set = false; -void timer_callback(void) { +STATIC void timer_callback(void) { woke_up = true; } diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 7db2956b03..1d77630063 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -25,6 +25,7 @@ */ #include "common-hal/analogio/AnalogIn.h" +#include "shared-bindings/analogio/AnalogIn.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 323a3dfbc8..f2775c2543 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -171,7 +171,3 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *se return output_count; } - -void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t *self, uint8_t *buffer, uint32_t length) { - -} diff --git a/ports/raspberrypi/common-hal/countio/Counter.c b/ports/raspberrypi/common-hal/countio/Counter.c index 3d2d291b99..bbf71f996e 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.c +++ b/ports/raspberrypi/common-hal/countio/Counter.c @@ -95,7 +95,7 @@ void common_hal_countio_counter_reset(countio_counter_obj_t *self) { self->count = 0; } -void counter_interrupt_handler() { +void counter_interrupt_handler(void) { uint32_t mask = pwm_get_irq_status_mask(); uint8_t i = 1, pos = 1; diff --git a/ports/raspberrypi/common-hal/countio/Counter.h b/ports/raspberrypi/common-hal/countio/Counter.h index 78e00e0dd2..7469dd2d00 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.h +++ b/ports/raspberrypi/common-hal/countio/Counter.h @@ -14,7 +14,7 @@ typedef struct { } countio_counter_obj_t; -void counter_interrupt_handler(); +void counter_interrupt_handler(void); void reset_countio(void); diff --git a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c index 280c87e234..9eabc9f967 100644 --- a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c @@ -68,7 +68,7 @@ /* .wrap */ \ } -mcu_pin_obj_t *pin_from_number(uint8_t number) { +STATIC mcu_pin_obj_t *pin_from_number(uint8_t number) { const mp_map_t *mcu_map = &mcu_pin_globals.map; for (uint8_t i = 0; i < mcu_map->alloc; i++) { mp_obj_t val = mcu_map->table[i].value; diff --git a/ports/raspberrypi/common-hal/microcontroller/Processor.c b/ports/raspberrypi/common-hal/microcontroller/Processor.c index 68518d75b3..8c5bc7ba75 100644 --- a/ports/raspberrypi/common-hal/microcontroller/Processor.c +++ b/ports/raspberrypi/common-hal/microcontroller/Processor.c @@ -29,6 +29,7 @@ #include "py/mphal.h" #include "common-hal/microcontroller/Processor.h" +#include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" #include "src/rp2_common/hardware_adc/include/hardware/adc.h" diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.c b/ports/raspberrypi/common-hal/nvm/ByteArray.c index 94d98d686f..6908cbeabf 100644 --- a/ports/raspberrypi/common-hal/nvm/ByteArray.c +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.c @@ -25,6 +25,7 @@ */ #include "common-hal/nvm/ByteArray.h" +#include "shared-bindings/nvm/ByteArray.h" #include @@ -36,7 +37,7 @@ static const uint32_t flash_binary_start = (uint32_t)&__flash_binary_start; #define RMV_OFFSET(addr) addr - flash_binary_start -uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { +uint32_t common_hal_nvm_bytearray_get_length(const nvm_bytearray_obj_t *self) { return self->len; } @@ -63,12 +64,12 @@ static void erase_and_write_sector(uint32_t address, uint32_t len, uint8_t *byte flash_range_program(RMV_OFFSET(CIRCUITPY_INTERNAL_NVM_START_ADDR), buffer, FLASH_SECTOR_SIZE); } -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, +void common_hal_nvm_bytearray_get_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t *values) { memcpy(values, self->start_address + start_index, len); } -bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, +bool common_hal_nvm_bytearray_set_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) { uint8_t values_in[len]; common_hal_nvm_bytearray_get_bytes(self, start_index, len, values_in); diff --git a/ports/raspberrypi/common-hal/os/__init__.c b/ports/raspberrypi/common-hal/os/__init__.c index 25fe317abe..805418288a 100644 --- a/ports/raspberrypi/common-hal/os/__init__.c +++ b/ports/raspberrypi/common-hal/os/__init__.c @@ -30,6 +30,8 @@ #include "py/objtuple.h" #include "py/qstr.h" +#include "shared-bindings/os/__init__.h" + #include "lib/crypto-algorithms/sha256.h" #include "hardware/structs/rosc.h" @@ -104,7 +106,7 @@ static void get_random_bits(BYTE out[SHA256_BLOCK_SIZE]) { sha256_final(&context, out); } -bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { +bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) { #define ROSC_POWER_SAVE (1) // assume ROSC is not necessarily active all the time #if ROSC_POWER_SAVE uint32_t old_rosc_ctrl = rosc_hw->ctrl; diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 53dfa008b8..9d3f614987 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -121,7 +121,8 @@ void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { self->level_count = 0; self->buf_index = 0; } -void common_hal_pulseio_pulsein_interrupt(pulseio_pulsein_obj_t *self) { +void common_hal_pulseio_pulsein_interrupt(void *self_in) { + pulseio_pulsein_obj_t *self = self_in; uint32_t rxfifo = 0; diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.h b/ports/raspberrypi/common-hal/pulseio/PulseIn.h index 5386220911..f2c4fc0d06 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.h +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.h @@ -48,6 +48,6 @@ typedef struct { } pulseio_pulsein_obj_t; void pulsein_reset(void); -void common_hal_pulseio_pulsein_interrupt(); +void common_hal_pulseio_pulsein_interrupt(void *); #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/raspberrypi/common-hal/pulseio/PulseOut.c b/ports/raspberrypi/common-hal/pulseio/PulseOut.c index 2b4ab7185c..7704fdff6f 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseOut.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseOut.c @@ -41,7 +41,7 @@ volatile alarm_id_t cur_alarm = 0; -void pulse_finish(pulseio_pulseout_obj_t *self) { +static void pulse_finish(pulseio_pulseout_obj_t *self) { self->pulse_index++; // Turn pwm pin off by switching the GPIO mux to SIO (the cpu manual // control). diff --git a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c index 649c9421e0..1105d357c5 100644 --- a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c @@ -28,6 +28,7 @@ #include #include "common-hal/rotaryio/IncrementalEncoder.h" +#include "shared-bindings/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h" #include "bindings/rp2pio/__init__.h" #include "bindings/rp2pio/StateMachine.h" diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 27672f0de0..4479006d4e 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -70,7 +70,7 @@ static void rp2pio_statemachine_set_pull(uint32_t pull_pin_up, uint32_t pull_pin } } -void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) { +STATIC void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) { uint8_t pio_index = pio_get_index(pio); uint32_t program_id = _current_program_id[pio_index][sm]; if (program_id == 0) { @@ -587,7 +587,7 @@ bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self) { return self->state_machine == NUM_PIO_STATE_MACHINES; } -enum dma_channel_transfer_size _stride_to_dma_size(uint8_t stride) { +STATIC enum dma_channel_transfer_size _stride_to_dma_size(uint8_t stride) { switch (stride) { case 4: return DMA_SIZE_32; diff --git a/ports/raspberrypi/common-hal/rtc/RTC.c b/ports/raspberrypi/common-hal/rtc/RTC.c index 8647fc246c..9bd10abf70 100644 --- a/ports/raspberrypi/common-hal/rtc/RTC.c +++ b/ports/raspberrypi/common-hal/rtc/RTC.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ #include "shared-bindings/rtc/RTC.h" +#include "common-hal/rtc/RTC.h" #include diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index fa18f24fe0..c128cb74b2 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -39,6 +39,7 @@ #include "lib/oofatfs/ff.h" #include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/flash.h" #include "supervisor/usb.h" #include "src/rp2040/hardware_structs/include/hardware/structs/sio.h" diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index fca6d6554c..5041250c0a 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -248,6 +248,7 @@ void port_idle_until_interrupt(void) { /** * \brief Default interrupt handler for unused IRQs. */ +extern void HardFault_Handler(void); // provide a prototype to avoid a missing-prototypes diagnostic __attribute__((used)) void HardFault_Handler(void) { #ifdef ENABLE_MICRO_TRACE_BUFFER // Turn off the micro trace buffer so we don't fill it up in the infinite diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c258317d18..d4980d78fe 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -635,7 +635,7 @@ ifeq ($(CIRCUITPY_RGBMATRIX),1) SRC_MOD += $(addprefix lib/protomatter/src/, \ core.c \ ) -$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces -Wno-missing-prototypes endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. @@ -685,6 +685,7 @@ $(addprefix lib/,\ libm/wf_tgamma.c \ ) endif +$(patsubst %.c,$(BUILD)/%.o,$(SRC_LIBM)): CFLAGS += -Wno-missing-prototypes endif SRC_CIRCUITPY_COMMON = \ diff --git a/shared-bindings/_bleio/CharacteristicBuffer.h b/shared-bindings/_bleio/CharacteristicBuffer.h index 1fd9dd838c..de85f019bc 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.h +++ b/shared-bindings/_bleio/CharacteristicBuffer.h @@ -44,7 +44,7 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self); void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self); bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self); -int common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self); +void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self); bool common_hal_bleio_characteristic_buffer_connected(bleio_characteristic_buffer_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTICBUFFER_H diff --git a/shared-bindings/_bleio/ScanEntry.h b/shared-bindings/_bleio/ScanEntry.h index 35473fd50e..b376433027 100644 --- a/shared-bindings/_bleio/ScanEntry.h +++ b/shared-bindings/_bleio/ScanEntry.h @@ -39,6 +39,6 @@ mp_obj_t common_hal_bleio_scanentry_get_advertisement_bytes(bleio_scanentry_obj_ mp_int_t common_hal_bleio_scanentry_get_rssi(bleio_scanentry_obj_t *self); bool common_hal_bleio_scanentry_get_connectable(bleio_scanentry_obj_t *self); bool common_hal_bleio_scanentry_get_scan_response(bleio_scanentry_obj_t *self); -bool common_hal_bleio_scanentry_matches(bleio_scanentry_obj_t *self, uint8_t *prefixes, size_t prefixes_len, bool match_all); +bool common_hal_bleio_scanentry_matches(bleio_scanentry_obj_t *self, const uint8_t *prefixes, size_t prefixes_len, bool match_all); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SCANENTRY_H diff --git a/shared-bindings/_eve/__init__.h b/shared-bindings/_eve/__init__.h index 883b1a15bf..96a10f010b 100644 --- a/shared-bindings/_eve/__init__.h +++ b/shared-bindings/_eve/__init__.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS__EVE___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS__EVE___INIT___H +#include "shared-module/_eve/__init__.h" + void common_hal__eve_flush(common_hal__eve_t *eve); void common_hal__eve_add(common_hal__eve_t *eve, size_t len, void *buf); void common_hal__eve_Vertex2f(common_hal__eve_t *eve, mp_float_t x, mp_float_t y); diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 5d3c1a15f0..4160f6a334 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -70,7 +70,7 @@ // wake_alarm is implemented as a dictionary entry, so there's no code here. -void validate_objs_are_alarms(size_t n_args, const mp_obj_t *objs) { +STATIC void validate_objs_are_alarms(size_t n_args, const mp_obj_t *objs) { for (size_t i = 0; i < n_args; i++) { if (mp_obj_is_type(objs[i], &alarm_pin_pinalarm_type) || mp_obj_is_type(objs[i], &alarm_time_timealarm_type) || diff --git a/shared-bindings/alarm/time/TimeAlarm.c b/shared-bindings/alarm/time/TimeAlarm.c index 2fdd6218bb..bd7502e891 100644 --- a/shared-bindings/alarm/time/TimeAlarm.c +++ b/shared-bindings/alarm/time/TimeAlarm.c @@ -29,8 +29,9 @@ #include "py/objproperty.h" #include "py/runtime.h" -#include "shared-bindings/time/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" +#include "shared-bindings/rtc/__init__.h" +#include "shared-bindings/time/__init__.h" #include "supervisor/shared/translate.h" diff --git a/shared-bindings/board/__init__.h b/shared-bindings/board/__init__.h index 837608fa9e..bc4d7df61f 100644 --- a/shared-bindings/board/__init__.h +++ b/shared-bindings/board/__init__.h @@ -47,6 +47,10 @@ mp_obj_t common_hal_board_get_uart(void); mp_obj_t common_hal_board_create_uart(void); MP_DECLARE_CONST_FUN_OBJ_0(board_uart_obj); +mp_obj_t board_i2c(void); +mp_obj_t board_spi(void); +mp_obj_t board_uart(void); + #define CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS \ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_board) }, \ { MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&board_module_id_obj) }, diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index a46ab6826e..90cd7c3aa6 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -152,7 +152,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si #if CIRCUITPY_BUSIO_UART // Helper to ensure we have the native super class instead of a subclass. -busio_uart_obj_t *native_uart(mp_obj_t uart_obj) { +STATIC busio_uart_obj_t *native_uart(mp_obj_t uart_obj) { mp_obj_t native_uart = mp_obj_cast_to_native_base(uart_obj, &busio_uart_type); if (native_uart == MP_OBJ_NULL) { mp_raise_ValueError_varg(translate("Must be a %q subclass."), MP_QSTR_UART); diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index fc246582fd..02efd41988 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -68,7 +68,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname); //| """Change current directory.""" //| ... //| -mp_obj_t os_chdir(mp_obj_t path_in) { +STATIC mp_obj_t os_chdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); common_hal_os_chdir(path); return mp_const_none; @@ -79,7 +79,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir); //| """Get the current directory.""" //| ... //| -mp_obj_t os_getcwd(void) { +STATIC mp_obj_t os_getcwd(void) { return common_hal_os_getcwd(); } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); @@ -88,7 +88,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... //| -mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { +STATIC mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { const char *path; if (n_args == 1) { path = mp_obj_str_get_str(args[0]); @@ -103,7 +103,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir); //| """Create a new directory.""" //| ... //| -mp_obj_t os_mkdir(mp_obj_t path_in) { +STATIC mp_obj_t os_mkdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); common_hal_os_mkdir(path); return mp_const_none; @@ -114,7 +114,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir); //| """Remove a file.""" //| ... //| -mp_obj_t os_remove(mp_obj_t path_in) { +STATIC mp_obj_t os_remove(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); common_hal_os_remove(path); return mp_const_none; @@ -125,7 +125,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove); //| """Remove a directory.""" //| ... //| -mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { +STATIC mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { const char *old_path = mp_obj_str_get_str(old_path_in); const char *new_path = mp_obj_str_get_str(new_path_in); common_hal_os_rename(old_path, new_path); @@ -137,7 +137,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename); //| """Rename a file.""" //| ... //| -mp_obj_t os_rmdir(mp_obj_t path_in) { +STATIC mp_obj_t os_rmdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); common_hal_os_rmdir(path); return mp_const_none; @@ -153,7 +153,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); //| which is the number of seconds corresponding to 1999-12-31.""" //| ... //| -mp_obj_t os_stat(mp_obj_t path_in) { +STATIC mp_obj_t os_stat(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); return common_hal_os_stat(path); } @@ -180,7 +180,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); //| in a port-specific implementation.""" //| ... //| -mp_obj_t os_statvfs(mp_obj_t path_in) { +STATIC mp_obj_t os_statvfs(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); return common_hal_os_statvfs(path); } diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 14cf5f5b0d..757a1b8532 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -106,7 +106,7 @@ STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_arg //| //| :return: The number of 512-byte blocks, as a number""" //| -mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { +STATIC mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in; return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self)); } @@ -117,7 +117,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); //| //| :return: None""" //| -mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { +STATIC mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in; common_hal_sdcardio_sdcard_deinit(self); return mp_const_none; @@ -135,7 +135,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); //| :return: None""" //| -mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { +STATIC mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { uint32_t start_block = mp_obj_get_int(start_block_in); mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); @@ -154,7 +154,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readbl //| //| :return: None""" //| ... -mp_obj_t sdcardio_sdcard_sync(mp_obj_t self_in) { +STATIC mp_obj_t sdcardio_sdcard_sync(mp_obj_t self_in) { sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in; int result = common_hal_sdcardio_sdcard_sync(self); if (result < 0) { @@ -176,7 +176,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_sync_obj, sdcardio_sdcard_sync); //| :return: None""" //| -mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { +STATIC mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { uint32_t start_block = mp_obj_get_int(start_block_in); mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index e03d180d7a..ba45af4576 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -168,7 +168,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); //| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. //| //| :return: None""" -mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { +STATIC mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { uint32_t start_block = mp_obj_get_int(start_block_in); mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); @@ -191,7 +191,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks //| //| :return: None""" //| -mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { +STATIC mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { uint32_t start_block = mp_obj_get_int(start_block_in); mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index c5769b56b5..3c957468da 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -54,7 +54,7 @@ //| """ //| ... //| -mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_filesystem, ARG_mount_path, ARG_readonly }; static const mp_arg_t allowed_args[] = { { MP_QSTR_filesystem, MP_ARG_OBJ | MP_ARG_REQUIRED }, @@ -91,7 +91,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(storage_mount_obj, 0, storage_mount); //| This is the CircuitPython analog to the UNIX ``umount`` command.""" //| ... //| -mp_obj_t storage_umount(mp_obj_t mnt_in) { +STATIC mp_obj_t storage_umount(mp_obj_t mnt_in) { if (mp_obj_is_str(mnt_in)) { common_hal_storage_umount_path(mp_obj_str_get_str(mnt_in)); } else { @@ -113,7 +113,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount); //| filesystem will be corrupted.""" //| ... //| -mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_mount_path, ARG_readonly, ARG_disable_concurrent_write_protection }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mount_path, MP_ARG_OBJ | MP_ARG_REQUIRED }, @@ -136,7 +136,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(storage_remount_obj, 0, storage_remount); //| """Retrieves the mount object associated with the mount path""" //| ... //| -mp_obj_t storage_getmount(const mp_obj_t mnt_in) { +STATIC mp_obj_t storage_getmount(const mp_obj_t mnt_in) { return common_hal_storage_getmount(mp_obj_str_get_str(mnt_in)); } MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount); @@ -156,7 +156,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount); //| ... //| -mp_obj_t storage_erase_filesystem(void) { +STATIC mp_obj_t storage_erase_filesystem(void) { common_hal_storage_erase_filesystem(); return mp_const_none; } diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 971d381ede..4b090fc34e 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -93,7 +93,7 @@ STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) { MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep); #if MICROPY_PY_COLLECTIONS -mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); size_t len; mp_obj_t *items; diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 065d23d4f4..7a57d8aedc 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -29,6 +29,7 @@ #include #include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/_bleio/ScanEntry.h" #include "shared-module/_bleio/Address.h" #include "shared-module/_bleio/ScanEntry.h" diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c index 0df77b65cb..a39e6f9ee8 100644 --- a/shared-module/_eve/__init__.c +++ b/shared-module/_eve/__init__.c @@ -27,6 +27,7 @@ #include #include #include "py/runtime.h" +#include "shared-bindings/_eve/__init__.h" #include "shared-module/_eve/__init__.h" STATIC void write(common_hal__eve_t *eve, size_t len, void *buf) { diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index 378efbfde5..bfeab4ae04 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -140,7 +140,7 @@ void common_hal_adafruit_pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_f } } -uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { +STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { if (mp_obj_is_small_int(obj)) { return MP_OBJ_SMALL_INT_VALUE(obj); } else if (mp_obj_is_int(obj)) { @@ -152,7 +152,7 @@ uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); } -void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { +STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { pixelbuf_byteorder_details_t *byteorder = &self->byteorder; // w is shared between white in NeoPixels and brightness in dotstars (so that DotStars can have // per-pixel brightness). Set the defaults here in case it isn't set below. @@ -197,7 +197,7 @@ void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_ } } -void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { +STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { @@ -235,7 +235,7 @@ void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint } } -void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t *self, size_t index, mp_obj_t value) { +STATIC void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t *self, size_t index, mp_obj_t value) { uint8_t r; uint8_t g; uint8_t b; diff --git a/shared-module/audiocore/WaveFile.c b/shared-module/audiocore/WaveFile.c index 14c92ca411..0cceb979a6 100644 --- a/shared-module/audiocore/WaveFile.c +++ b/shared-module/audiocore/WaveFile.c @@ -160,14 +160,6 @@ uint8_t common_hal_audioio_wavefile_get_channel_count(audioio_wavefile_obj_t *se return self->channel_count; } -bool audioio_wavefile_samples_signed(audioio_wavefile_obj_t *self) { - return self->bits_per_sample > 8; -} - -uint32_t audioio_wavefile_max_buffer_length(audioio_wavefile_obj_t *self) { - return 512; -} - void audioio_wavefile_reset_buffer(audioio_wavefile_obj_t *self, bool single_channel_output, uint8_t channel) { diff --git a/shared-module/audiomixer/MixerVoice.c b/shared-module/audiomixer/MixerVoice.c index 34fa907a5b..bb58b0c111 100644 --- a/shared-module/audiomixer/MixerVoice.c +++ b/shared-module/audiomixer/MixerVoice.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ #include "shared-bindings/audiomixer/Mixer.h" +#include "shared-bindings/audiomixer/MixerVoice.h" #include "shared-module/audiomixer/MixerVoice.h" #include diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index cc755d7d2f..5e1bce5924 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -290,10 +290,6 @@ uint8_t common_hal_audiomp3_mp3file_get_channel_count(audiomp3_mp3file_obj_t *se return self->channel_count; } -bool audiomp3_mp3file_samples_signed(audiomp3_mp3file_obj_t *self) { - return true; -} - void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t *self, bool single_channel_output, uint8_t channel) { diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index a9cb3ae978..0c577f0194 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -219,17 +219,6 @@ void common_hal_bitmaptools_rotozoom(displayio_bitmap_t *self, int16_t ox, int16 } } -int16_t constrain(int16_t input, int16_t min, int16_t max) { - // constrain the input between the min and max values - if (input < min) { - return min; - } - if (input > max) { - return max; - } - return input; -} - void common_hal_bitmaptools_fill_region(displayio_bitmap_t *destination, int16_t x1, int16_t y1, int16_t x2, int16_t y2, diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 05900040d8..19d9e7ece0 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -24,7 +24,9 @@ * THE SOFTWARE. */ +#include "shared-bindings/board/__init__.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/board/__init__.h" #include "supervisor/shared/translate.h" #include "mpconfigboard.h" #include "py/runtime.h" diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 675691ed00..7d8fc0d26d 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -103,7 +103,7 @@ bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self return displayio_display_core_show(&self->core, root_group); } -const displayio_area_t *displayio_epaperdisplay_get_refresh_areas(displayio_epaperdisplay_obj_t *self) { +STATIC const displayio_area_t *displayio_epaperdisplay_get_refresh_areas(displayio_epaperdisplay_obj_t *self) { if (self->core.full_refresh) { self->core.area.next = NULL; return &self->core.area; @@ -172,7 +172,7 @@ void displayio_epaperdisplay_change_refresh_mode_parameters(displayio_epaperdisp self->milliseconds_per_frame = seconds_per_frame * 1000; } -void displayio_epaperdisplay_start_refresh(displayio_epaperdisplay_obj_t *self) { +STATIC void displayio_epaperdisplay_start_refresh(displayio_epaperdisplay_obj_t *self) { // run start sequence self->core.bus_reset(self->core.bus); @@ -192,7 +192,7 @@ uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaper return self->milliseconds_per_frame - elapsed_time; } -void displayio_epaperdisplay_finish_refresh(displayio_epaperdisplay_obj_t *self) { +STATIC void displayio_epaperdisplay_finish_refresh(displayio_epaperdisplay_obj_t *self) { // Actually refresh the display now that all pixel RAM has been updated. displayio_display_core_begin_transaction(&self->core); self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, &self->refresh_display_command, 1); @@ -230,7 +230,7 @@ uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay } -bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t *self, const displayio_area_t *area) { +STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t *self, const displayio_area_t *area) { uint16_t buffer_size = 128; // In uint32_ts displayio_area_t clipped; diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 430cbc8409..044674f415 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -104,7 +104,7 @@ bool displayio_tilegrid_get_previous_area(displayio_tilegrid_t *self, displayio_ return true; } -void _update_current_x(displayio_tilegrid_t *self) { +STATIC void _update_current_x(displayio_tilegrid_t *self) { uint16_t width; if (self->transpose_xy) { width = self->pixel_height; @@ -137,7 +137,7 @@ void _update_current_x(displayio_tilegrid_t *self) { } } -void _update_current_y(displayio_tilegrid_t *self) { +STATIC void _update_current_y(displayio_tilegrid_t *self) { uint16_t height; if (self->transpose_xy) { height = self->pixel_width; diff --git a/shared-module/keypad/EventQueue.c b/shared-module/keypad/EventQueue.c index ddd1cd0e87..eeeceb78cf 100644 --- a/shared-module/keypad/EventQueue.c +++ b/shared-module/keypad/EventQueue.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/keypad/Event.h" +#include "shared-bindings/keypad/EventQueue.h" #include "shared-bindings/supervisor/__init__.h" #include "shared-module/keypad/EventQueue.h" diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 1e865385d7..7a6892c51f 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -38,6 +38,8 @@ #include "supervisor/shared/translate.h" #include "shared-bindings/msgpack/ExtType.h" +#include "shared-bindings/msgpack/__init__.h" +#include "shared-module/msgpack/__init__.h" //////////////////////////////////////////////////////////////// // stream management diff --git a/shared-module/random/__init__.c b/shared-module/random/__init__.c index 95ac3bc659..438eb24696 100644 --- a/shared-module/random/__init__.c +++ b/shared-module/random/__init__.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" +#include "shared-bindings/random/__init__.h" #include "shared-bindings/time/__init__.h" // Yasmarang random number generator diff --git a/shared-module/rotaryio/IncrementalEncoder.c b/shared-module/rotaryio/IncrementalEncoder.c index 89dea01cfe..27b9cdb64d 100644 --- a/shared-module/rotaryio/IncrementalEncoder.c +++ b/shared-module/rotaryio/IncrementalEncoder.c @@ -25,6 +25,7 @@ */ #if CIRCUITPY_ROTARYIO && CIRCUITPY_ROTARYIO_SOFTENCODER +#include "shared-bindings/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h" #include "common-hal/rotaryio/IncrementalEncoder.h" diff --git a/shared-module/sdcardio/SDCard.c b/shared-module/sdcardio/SDCard.c index f5ab97ebe5..9cbbf40819 100644 --- a/shared-module/sdcardio/SDCard.c +++ b/shared-module/sdcardio/SDCard.c @@ -28,6 +28,7 @@ #include "shared-bindings/busio/SPI.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/sdcardio/SDCard.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" #include "shared-module/sdcardio/SDCard.h" @@ -325,7 +326,7 @@ void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self) { common_hal_digitalio_digitalinout_deinit(&self->cs); } -void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { +STATIC void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { if (!self->bus) { raise_deinited_error(); } @@ -336,7 +337,7 @@ int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) { return self->sectors; } -int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { +STATIC int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { uint8_t aux[2] = {0, 0}; while (aux[0] != 0xfe) { common_hal_busio_spi_read(self->bus, aux, 1, 0xff); @@ -349,7 +350,7 @@ int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { return 0; } -int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { +STATIC int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { uint32_t nblocks = buf->len / 512; if (nblocks == 1) { // Use CMD17 to read a single block diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index 14f4908222..9012a5ac89 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -53,19 +53,19 @@ int common_hal_sharpdisplay_framebuffer_get_height(sharpdisplay_framebuffer_obj_ return self->height; } -int common_hal_sharpdisplay_framebuffer_get_row_stride(sharpdisplay_framebuffer_obj_t *self) { +STATIC int common_hal_sharpdisplay_framebuffer_get_row_stride(sharpdisplay_framebuffer_obj_t *self) { return (self->width + 7) / 8 + 2; } -int common_hal_sharpdisplay_framebuffer_get_first_pixel_offset(sharpdisplay_framebuffer_obj_t *self) { +STATIC int common_hal_sharpdisplay_framebuffer_get_first_pixel_offset(sharpdisplay_framebuffer_obj_t *self) { return 2; } -bool common_hal_sharpdisplay_framebuffer_get_reverse_pixels_in_byte(sharpdisplay_framebuffer_obj_t *self) { +STATIC bool common_hal_sharpdisplay_framebuffer_get_reverse_pixels_in_byte(sharpdisplay_framebuffer_obj_t *self) { return true; } -bool common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(sharpdisplay_framebuffer_obj_t *self) { +STATIC bool common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(sharpdisplay_framebuffer_obj_t *self) { return true; } @@ -143,7 +143,7 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_ common_hal_sharpdisplay_framebuffer_get_bufinfo(self, NULL); } -void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask) { +STATIC void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask) { // claim SPI bus if (!common_hal_busio_spi_try_lock(self->bus)) { return; diff --git a/shared-module/struct/__init__.c b/shared-module/struct/__init__.c index b3b0096174..a0abd16408 100644 --- a/shared-module/struct/__init__.c +++ b/shared-module/struct/__init__.c @@ -32,8 +32,9 @@ #include "py/binary.h" #include "py/parsenum.h" #include "supervisor/shared/translate.h" +#include "shared-bindings/struct/__init__.h" -void struct_validate_format(char fmt) { +STATIC void struct_validate_format(char fmt) { #if MICROPY_NONSTANDARD_TYPECODES if (fmt == 'S' || fmt == 'O') { mp_raise_RuntimeError(translate("'S' and 'O' are not supported format types")); @@ -41,7 +42,7 @@ void struct_validate_format(char fmt) { #endif } -char get_fmt_type(const char **fmt) { +STATIC char get_fmt_type(const char **fmt) { char t = **fmt; switch (t) { case '!': @@ -60,7 +61,7 @@ char get_fmt_type(const char **fmt) { return t; } -mp_uint_t get_fmt_num(const char **p) { +STATIC mp_uint_t get_fmt_num(const char **p) { const char *num = *p; uint len = 1; while (unichar_isdigit(*++num)) { @@ -71,7 +72,7 @@ mp_uint_t get_fmt_num(const char **p) { return val; } -mp_uint_t calcsize_items(const char *fmt) { +STATIC mp_uint_t calcsize_items(const char *fmt) { mp_uint_t cnt = 0; while (*fmt) { int num = 1; diff --git a/shared-module/terminalio/Terminal.c b/shared-module/terminalio/Terminal.c index 48010aa650..f0a69bde39 100644 --- a/shared-module/terminalio/Terminal.c +++ b/shared-module/terminalio/Terminal.c @@ -28,6 +28,7 @@ #include "shared-module/fontio/BuiltinFont.h" #include "shared-bindings/displayio/TileGrid.h" +#include "shared-bindings/terminalio/Terminal.h" void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font) { self->cursor_x = 0; diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index c79a5f3ae7..b4575b18a2 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -27,6 +27,7 @@ #include "py/mphal.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" +#include "shared-bindings/time/__init__.h" uint64_t common_hal_time_monotonic_ms(void) { return supervisor_ticks_ms64(); diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index 2471daa608..bcaa0092f8 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -28,11 +28,6 @@ void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *o } -uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) { - vectorio_rectangle_t *self = rectangle; - return self->height; -} - mp_obj_t common_hal_vectorio_rectangle_get_draw_protocol(void *rectangle) { vectorio_rectangle_t *self = rectangle; return self->draw_protocol_instance; diff --git a/shared/runtime/interrupt_char.c b/shared/runtime/interrupt_char.c index 4ac099f41e..21e5a06358 100644 --- a/shared/runtime/interrupt_char.c +++ b/shared/runtime/interrupt_char.c @@ -26,6 +26,7 @@ #include "py/obj.h" #include "py/mpstate.h" +#include "shared/runtime/interrupt_char.h" #if MICROPY_KBD_EXCEPTION diff --git a/shared/runtime/sys_stdio_mphal.c b/shared/runtime/sys_stdio_mphal.c index 228529ce3d..580d97f614 100644 --- a/shared/runtime/sys_stdio_mphal.c +++ b/shared/runtime/sys_stdio_mphal.c @@ -52,7 +52,7 @@ typedef struct _sys_stdio_obj_t { STATIC const sys_stdio_obj_t stdio_buffer_obj; #endif -void stdio_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { +STATIC void stdio_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { sys_stdio_obj_t *self = MP_OBJ_TO_PTR(self_in); mp_printf(print, "", self->fd); }