Additional missing-prototypes fixes

I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
This commit is contained in:
Jeff Epler 2021-11-10 08:42:21 -06:00
parent 4a1ce646f5
commit 621953c960
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
73 changed files with 123 additions and 242 deletions

View File

@ -33,6 +33,7 @@
#include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/__init__.h"
#include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/Connection.h"
#include "shared-bindings/_bleio/CharacteristicBuffer.h"
#include "supervisor/shared/tick.h" #include "supervisor/shared/tick.h"
#include "common-hal/_bleio/CharacteristicBuffer.h" #include "common-hal/_bleio/CharacteristicBuffer.h"

View File

@ -85,5 +85,6 @@ typedef struct {
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); 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); 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); 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 #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H

View File

@ -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[]) { STATIC void process_find_info_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
if (dlen < 2) { if (dlen < 2) {
return; // invalid, drop 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; 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); 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[]) { STATIC void process_read_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
if (dlen < 2) { if (dlen < 2) {
return; // invalid, drop 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[]) { STATIC void process_read_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
if (dlen < 1) { if (dlen < 1) {
return; // invalid, drop return; // invalid, drop
@ -1713,77 +1662,3 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
break; 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);
}

View File

@ -291,7 +291,7 @@ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno
endif endif
SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) 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 := \ SRC_PERIPHERALS := \
peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \ peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \
@ -310,7 +310,7 @@ SRC_PERIPHERALS := \
peripherals/samd/sercom.c \ peripherals/samd/sercom.c \
peripherals/samd/timers.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 += \ SRC_C += \
audio_dma.c \ audio_dma.c \

View File

@ -485,6 +485,3 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se
return values_output; return values_output;
} }
void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t* self, uint8_t* buffer, uint32_t length) {
}

View File

@ -25,6 +25,7 @@
*/ */
#include "samd/sercom.h" #include "samd/sercom.h"
#include "common-hal/busio/__init__.h"
static bool never_reset_sercoms[SERCOM_INST_NUM]; static bool never_reset_sercoms[SERCOM_INST_NUM];

View File

@ -1,5 +1,6 @@
#include "common-hal/countio/Counter.h" #include "common-hal/countio/Counter.h"
#include "shared-bindings/countio/Counter.h"
#include "atmel_start_pins.h" #include "atmel_start_pins.h"

View File

@ -65,6 +65,7 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "common-hal/microcontroller/Processor.h" #include "common-hal/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h" #include "shared-bindings/microcontroller/ResetReason.h"
#include "samd/adc.h" #include "samd/adc.h"

View File

@ -25,6 +25,7 @@
*/ */
#include "common-hal/nvm/ByteArray.h" #include "common-hal/nvm/ByteArray.h"
#include "shared-bindings/nvm/ByteArray.h"
#include "hal_flash.h" #include "hal_flash.h"
@ -33,11 +34,11 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
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; 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) { 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 // 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. // 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. // 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) { uint32_t start_index, uint32_t len, uint8_t *values) {
memcpy(values, self->start_address + start_index, len); memcpy(values, self->start_address + start_index, len);
} }

View File

@ -30,6 +30,8 @@
#include "py/objtuple.h" #include "py/objtuple.h"
#include "py/qstr.h" #include "py/qstr.h"
#include "shared-bindings/os/__init__.h"
#ifdef SAM_D5X_E5X #ifdef SAM_D5X_E5X
#include "hal/include/hal_rand_sync.h" #include "hal/include/hal_rand_sync.h"
#endif #endif
@ -66,7 +68,7 @@ mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj; 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 #ifdef SAM_D5X_E5X
hri_mclk_set_APBCMASK_TRNG_bit(MCLK); hri_mclk_set_APBCMASK_TRNG_bit(MCLK);
struct rand_sync_desc random; struct rand_sync_desc random;

View File

@ -26,6 +26,7 @@
*/ */
#include "common-hal/ps2io/Ps2.h" #include "common-hal/ps2io/Ps2.h"
#include "shared-bindings/ps2io/Ps2.h"
#include <stdint.h> #include <stdint.h>
@ -302,11 +303,6 @@ uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t *self) {
return self->bufcount; 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) { int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t *self) {
common_hal_mcu_disable_interrupts(); common_hal_mcu_disable_interrupts();
if (self->bufcount <= 0) { if (self->bufcount <= 0) {

View File

@ -59,7 +59,7 @@ static void turn_off(__IO PORT_PINCFG_Type *pincfg) {
pincfg->reg = PORT_PINCFG_RESETVALUE; pincfg->reg = PORT_PINCFG_RESETVALUE;
} }
void pulse_finish(void) { STATIC void pulse_finish(void) {
pulse_index++; pulse_index++;
if (active_pincfg == NULL) { if (active_pincfg == NULL) {

View File

@ -91,7 +91,7 @@ static uint8_t tcc_channel(const pin_timer_t *t) {
return t->wave_output % tcc_cc_num[t->index]; 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); uint8_t channel_bit = 1 << tcc_channel(t);
return (!t->is_tc && ((tcc_channels[t->index] & channel_bit) == 0)) || return (!t->is_tc && ((tcc_channels[t->index] & channel_bit) == 0)) ||
t->is_tc; t->is_tc;

View File

@ -25,6 +25,7 @@
*/ */
#include "common-hal/rotaryio/IncrementalEncoder.h" #include "common-hal/rotaryio/IncrementalEncoder.h"
#include "shared-bindings/rotaryio/IncrementalEncoder.h"
#include "shared-module/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h"
#include "atmel_start_pins.h" #include "atmel_start_pins.h"

View File

@ -35,6 +35,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "shared/timeutils/timeutils.h" #include "shared/timeutils/timeutils.h"
#include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/__init__.h"
#include "shared-bindings/rtc/RTC.h"
#include "supervisor/port.h" #include "supervisor/port.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"

View File

@ -50,7 +50,7 @@ mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) {
return self->timeout; 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) OSC32KCTRL->OSCULP32K.bit.EN1K = 1; // Enable out 1K (for WDT)
// disable watchdog for config // disable watchdog for config

View File

@ -132,7 +132,7 @@ endif
# Remove -Wno-stringop-overflow after we can test with CI's GCC 10. Mac's looks weird. # 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 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 += \ CFLAGS += \
-march=armv6-m \ -march=armv6-m \

View File

@ -617,7 +617,7 @@ const mp_obj_type_t rp2pio_statemachine_type = {
.locals_dict = (mp_obj_dict_t *)&rp2pio_statemachine_locals_dict, .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)) { if (!mp_obj_is_type(obj, &rp2pio_statemachine_type)) {
mp_raise_TypeError_varg(translate("Expected a %q"), rp2pio_statemachine_type.name); mp_raise_TypeError_varg(translate("Expected a %q"), rp2pio_statemachine_type.name);
} }

View File

@ -31,6 +31,7 @@
#include "shared-bindings/busio/SPI.h" #include "shared-bindings/busio/SPI.h"
#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h"
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
#include "supervisor/board.h"
#include "supervisor/shared/board.h" #include "supervisor/shared/board.h"
displayio_fourwire_obj_t board_display_obj; displayio_fourwire_obj_t board_display_obj;

View File

@ -28,6 +28,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "common-hal/alarm/SleepMemory.h" #include "common-hal/alarm/SleepMemory.h"
#include "shared-bindings/alarm/SleepMemory.h"
void alarm_sleep_memory_reset(void) { void alarm_sleep_memory_reset(void) {
} }

View File

@ -42,7 +42,7 @@ STATIC bool _pinalarm_set = false;
#define GPIO_IRQ_ALL_EVENTS 0x15u #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); alarm_triggered_pins |= (1 << gpio);
woke_up = true; woke_up = true;

View File

@ -37,7 +37,7 @@
STATIC bool woke_up = false; STATIC bool woke_up = false;
STATIC bool _timealarm_set = false; STATIC bool _timealarm_set = false;
void timer_callback(void) { STATIC void timer_callback(void) {
woke_up = true; woke_up = true;
} }

View File

@ -25,6 +25,7 @@
*/ */
#include "common-hal/analogio/AnalogIn.h" #include "common-hal/analogio/AnalogIn.h"
#include "shared-bindings/analogio/AnalogIn.h"
#include "py/runtime.h" #include "py/runtime.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"

View File

@ -171,7 +171,3 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *se
return output_count; return output_count;
} }
void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t *self, uint8_t *buffer, uint32_t length) {
}

View File

@ -95,7 +95,7 @@ void common_hal_countio_counter_reset(countio_counter_obj_t *self) {
self->count = 0; self->count = 0;
} }
void counter_interrupt_handler() { void counter_interrupt_handler(void) {
uint32_t mask = pwm_get_irq_status_mask(); uint32_t mask = pwm_get_irq_status_mask();
uint8_t i = 1, pos = 1; uint8_t i = 1, pos = 1;

View File

@ -14,7 +14,7 @@ typedef struct {
} countio_counter_obj_t; } countio_counter_obj_t;
void counter_interrupt_handler(); void counter_interrupt_handler(void);
void reset_countio(void); void reset_countio(void);

View File

@ -68,7 +68,7 @@
/* .wrap */ \ /* .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; const mp_map_t *mcu_map = &mcu_pin_globals.map;
for (uint8_t i = 0; i < mcu_map->alloc; i++) { for (uint8_t i = 0; i < mcu_map->alloc; i++) {
mp_obj_t val = mcu_map->table[i].value; mp_obj_t val = mcu_map->table[i].value;

View File

@ -29,6 +29,7 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "common-hal/microcontroller/Processor.h" #include "common-hal/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h" #include "shared-bindings/microcontroller/ResetReason.h"
#include "src/rp2_common/hardware_adc/include/hardware/adc.h" #include "src/rp2_common/hardware_adc/include/hardware/adc.h"

View File

@ -25,6 +25,7 @@
*/ */
#include "common-hal/nvm/ByteArray.h" #include "common-hal/nvm/ByteArray.h"
#include "shared-bindings/nvm/ByteArray.h"
#include <string.h> #include <string.h>
@ -36,7 +37,7 @@ static const uint32_t flash_binary_start = (uint32_t)&__flash_binary_start;
#define RMV_OFFSET(addr) addr - 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; 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); 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) { uint32_t start_index, uint32_t len, uint8_t *values) {
memcpy(values, self->start_address + start_index, len); 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) { uint32_t start_index, uint8_t *values, uint32_t len) {
uint8_t values_in[len]; uint8_t values_in[len];
common_hal_nvm_bytearray_get_bytes(self, start_index, len, values_in); common_hal_nvm_bytearray_get_bytes(self, start_index, len, values_in);

View File

@ -30,6 +30,8 @@
#include "py/objtuple.h" #include "py/objtuple.h"
#include "py/qstr.h" #include "py/qstr.h"
#include "shared-bindings/os/__init__.h"
#include "lib/crypto-algorithms/sha256.h" #include "lib/crypto-algorithms/sha256.h"
#include "hardware/structs/rosc.h" #include "hardware/structs/rosc.h"
@ -104,7 +106,7 @@ static void get_random_bits(BYTE out[SHA256_BLOCK_SIZE]) {
sha256_final(&context, out); 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 #define ROSC_POWER_SAVE (1) // assume ROSC is not necessarily active all the time
#if ROSC_POWER_SAVE #if ROSC_POWER_SAVE
uint32_t old_rosc_ctrl = rosc_hw->ctrl; uint32_t old_rosc_ctrl = rosc_hw->ctrl;

View File

@ -121,7 +121,8 @@ void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) {
self->level_count = 0; self->level_count = 0;
self->buf_index = 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; uint32_t rxfifo = 0;

View File

@ -48,6 +48,6 @@ typedef struct {
} pulseio_pulsein_obj_t; } pulseio_pulsein_obj_t;
void pulsein_reset(void); 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 #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PULSEIN_H

View File

@ -41,7 +41,7 @@
volatile alarm_id_t cur_alarm = 0; 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++; self->pulse_index++;
// Turn pwm pin off by switching the GPIO mux to SIO (the cpu manual // Turn pwm pin off by switching the GPIO mux to SIO (the cpu manual
// control). // control).

View File

@ -28,6 +28,7 @@
#include <hardware/regs/pio.h> #include <hardware/regs/pio.h>
#include "common-hal/rotaryio/IncrementalEncoder.h" #include "common-hal/rotaryio/IncrementalEncoder.h"
#include "shared-bindings/rotaryio/IncrementalEncoder.h"
#include "shared-module/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h"
#include "bindings/rp2pio/__init__.h" #include "bindings/rp2pio/__init__.h"
#include "bindings/rp2pio/StateMachine.h" #include "bindings/rp2pio/StateMachine.h"

View File

@ -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); uint8_t pio_index = pio_get_index(pio);
uint32_t program_id = _current_program_id[pio_index][sm]; uint32_t program_id = _current_program_id[pio_index][sm];
if (program_id == 0) { 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; 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) { switch (stride) {
case 4: case 4:
return DMA_SIZE_32; return DMA_SIZE_32;

View File

@ -24,6 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "shared-bindings/rtc/RTC.h" #include "shared-bindings/rtc/RTC.h"
#include "common-hal/rtc/RTC.h"
#include <sys/time.h> #include <sys/time.h>

View File

@ -39,6 +39,7 @@
#include "lib/oofatfs/ff.h" #include "lib/oofatfs/ff.h"
#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/__init__.h"
#include "supervisor/flash.h"
#include "supervisor/usb.h" #include "supervisor/usb.h"
#include "src/rp2040/hardware_structs/include/hardware/structs/sio.h" #include "src/rp2040/hardware_structs/include/hardware/structs/sio.h"

View File

@ -248,6 +248,7 @@ void port_idle_until_interrupt(void) {
/** /**
* \brief Default interrupt handler for unused IRQs. * \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) { __attribute__((used)) void HardFault_Handler(void) {
#ifdef ENABLE_MICRO_TRACE_BUFFER #ifdef ENABLE_MICRO_TRACE_BUFFER
// Turn off the micro trace buffer so we don't fill it up in the infinite // Turn off the micro trace buffer so we don't fill it up in the infinite

View File

@ -635,7 +635,7 @@ ifeq ($(CIRCUITPY_RGBMATRIX),1)
SRC_MOD += $(addprefix lib/protomatter/src/, \ SRC_MOD += $(addprefix lib/protomatter/src/, \
core.c \ 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 endif
# All possible sources are listed here, and are filtered by SRC_PATTERNS. # All possible sources are listed here, and are filtered by SRC_PATTERNS.
@ -685,6 +685,7 @@ $(addprefix lib/,\
libm/wf_tgamma.c \ libm/wf_tgamma.c \
) )
endif endif
$(patsubst %.c,$(BUILD)/%.o,$(SRC_LIBM)): CFLAGS += -Wno-missing-prototypes
endif endif
SRC_CIRCUITPY_COMMON = \ SRC_CIRCUITPY_COMMON = \

View File

@ -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); 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); 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); 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); bool common_hal_bleio_characteristic_buffer_connected(bleio_characteristic_buffer_obj_t *self);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTICBUFFER_H #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTICBUFFER_H

View File

@ -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); 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_connectable(bleio_scanentry_obj_t *self);
bool common_hal_bleio_scanentry_get_scan_response(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 #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SCANENTRY_H

View File

@ -27,6 +27,8 @@
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS__EVE___INIT___H #ifndef MICROPY_INCLUDED_SHARED_BINDINGS__EVE___INIT___H
#define 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_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_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); void common_hal__eve_Vertex2f(common_hal__eve_t *eve, mp_float_t x, mp_float_t y);

View File

@ -70,7 +70,7 @@
// wake_alarm is implemented as a dictionary entry, so there's no code here. // 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++) { for (size_t i = 0; i < n_args; i++) {
if (mp_obj_is_type(objs[i], &alarm_pin_pinalarm_type) || if (mp_obj_is_type(objs[i], &alarm_pin_pinalarm_type) ||
mp_obj_is_type(objs[i], &alarm_time_timealarm_type) || mp_obj_is_type(objs[i], &alarm_time_timealarm_type) ||

View File

@ -29,8 +29,9 @@
#include "py/objproperty.h" #include "py/objproperty.h"
#include "py/runtime.h" #include "py/runtime.h"
#include "shared-bindings/time/__init__.h"
#include "shared-bindings/alarm/time/TimeAlarm.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" #include "supervisor/shared/translate.h"

View File

@ -47,6 +47,10 @@ mp_obj_t common_hal_board_get_uart(void);
mp_obj_t common_hal_board_create_uart(void); mp_obj_t common_hal_board_create_uart(void);
MP_DECLARE_CONST_FUN_OBJ_0(board_uart_obj); 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 \ #define CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS \
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_board) }, \ { 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) }, { MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&board_module_id_obj) },

View File

@ -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 #if CIRCUITPY_BUSIO_UART
// Helper to ensure we have the native super class instead of a subclass. // 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); mp_obj_t native_uart = mp_obj_cast_to_native_base(uart_obj, &busio_uart_type);
if (native_uart == MP_OBJ_NULL) { if (native_uart == MP_OBJ_NULL) {
mp_raise_ValueError_varg(translate("Must be a %q subclass."), MP_QSTR_UART); mp_raise_ValueError_varg(translate("Must be a %q subclass."), MP_QSTR_UART);

View File

@ -68,7 +68,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
//| """Change current directory.""" //| """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); const char *path = mp_obj_str_get_str(path_in);
common_hal_os_chdir(path); common_hal_os_chdir(path);
return mp_const_none; return mp_const_none;
@ -79,7 +79,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir);
//| """Get the current directory.""" //| """Get the current directory."""
//| ... //| ...
//| //|
mp_obj_t os_getcwd(void) { STATIC mp_obj_t os_getcwd(void) {
return common_hal_os_getcwd(); return common_hal_os_getcwd();
} }
MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, 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.""" //| """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; const char *path;
if (n_args == 1) { if (n_args == 1) {
path = mp_obj_str_get_str(args[0]); 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.""" //| """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); const char *path = mp_obj_str_get_str(path_in);
common_hal_os_mkdir(path); common_hal_os_mkdir(path);
return mp_const_none; return mp_const_none;
@ -114,7 +114,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir);
//| """Remove a file.""" //| """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); const char *path = mp_obj_str_get_str(path_in);
common_hal_os_remove(path); common_hal_os_remove(path);
return mp_const_none; return mp_const_none;
@ -125,7 +125,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove);
//| """Remove a directory.""" //| """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 *old_path = mp_obj_str_get_str(old_path_in);
const char *new_path = mp_obj_str_get_str(new_path_in); const char *new_path = mp_obj_str_get_str(new_path_in);
common_hal_os_rename(old_path, new_path); 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.""" //| """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); const char *path = mp_obj_str_get_str(path_in);
common_hal_os_rmdir(path); common_hal_os_rmdir(path);
return mp_const_none; 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.""" //| 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); const char *path = mp_obj_str_get_str(path_in);
return common_hal_os_stat(path); 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.""" //| 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); const char *path = mp_obj_str_get_str(path_in);
return common_hal_os_statvfs(path); return common_hal_os_statvfs(path);
} }

View File

@ -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""" //| :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; 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)); 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""" //| :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; sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in;
common_hal_sdcardio_sdcard_deinit(self); common_hal_sdcardio_sdcard_deinit(self);
return mp_const_none; return mp_const_none;
@ -135,7 +135,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit);
//| :return: None""" //| :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); uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); 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""" //| :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; sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in;
int result = common_hal_sdcardio_sdcard_sync(self); int result = common_hal_sdcardio_sdcard_sync(self);
if (result < 0) { if (result < 0) {
@ -176,7 +176,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_sync_obj, sdcardio_sdcard_sync);
//| :return: None""" //| :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); uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);

View File

@ -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. //| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512.
//| //|
//| :return: None""" //| :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); uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); 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""" //| :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); uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);

View File

@ -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 }; enum { ARG_filesystem, ARG_mount_path, ARG_readonly };
static const mp_arg_t allowed_args[] = { static const mp_arg_t allowed_args[] = {
{ MP_QSTR_filesystem, MP_ARG_OBJ | MP_ARG_REQUIRED }, { 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.""" //| 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)) { if (mp_obj_is_str(mnt_in)) {
common_hal_storage_umount_path(mp_obj_str_get_str(mnt_in)); common_hal_storage_umount_path(mp_obj_str_get_str(mnt_in));
} else { } else {
@ -113,7 +113,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount);
//| filesystem will be corrupted.""" //| 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 }; enum { ARG_mount_path, ARG_readonly, ARG_disable_concurrent_write_protection };
static const mp_arg_t allowed_args[] = { static const mp_arg_t allowed_args[] = {
{ MP_QSTR_mount_path, MP_ARG_OBJ | MP_ARG_REQUIRED }, { 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""" //| """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)); return common_hal_storage_getmount(mp_obj_str_get_str(mnt_in));
} }
MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount); 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(); common_hal_storage_erase_filesystem();
return mp_const_none; return mp_const_none;
} }

View File

@ -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); MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);
#if MICROPY_PY_COLLECTIONS #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); mp_arg_check_num(n_args, n_kw, 1, 1, false);
size_t len; size_t len;
mp_obj_t *items; mp_obj_t *items;

View File

@ -29,6 +29,7 @@
#include <string.h> #include <string.h>
#include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Address.h"
#include "shared-bindings/_bleio/ScanEntry.h"
#include "shared-module/_bleio/Address.h" #include "shared-module/_bleio/Address.h"
#include "shared-module/_bleio/ScanEntry.h" #include "shared-module/_bleio/ScanEntry.h"

View File

@ -27,6 +27,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "py/runtime.h" #include "py/runtime.h"
#include "shared-bindings/_eve/__init__.h"
#include "shared-module/_eve/__init__.h" #include "shared-module/_eve/__init__.h"
STATIC void write(common_hal__eve_t *eve, size_t len, void *buf) { STATIC void write(common_hal__eve_t *eve, size_t len, void *buf) {

View File

@ -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)) { if (mp_obj_is_small_int(obj)) {
return MP_OBJ_SMALL_INT_VALUE(obj); return MP_OBJ_SMALL_INT_VALUE(obj);
} else if (mp_obj_is_int(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); 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; pixelbuf_byteorder_details_t *byteorder = &self->byteorder;
// w is shared between white in NeoPixels and brightness in dotstars (so that DotStars can have // 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. // 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 // 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. // by three to leave the top five bits.
if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { 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 r;
uint8_t g; uint8_t g;
uint8_t b; uint8_t b;

View File

@ -160,14 +160,6 @@ uint8_t common_hal_audioio_wavefile_get_channel_count(audioio_wavefile_obj_t *se
return self->channel_count; 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, void audioio_wavefile_reset_buffer(audioio_wavefile_obj_t *self,
bool single_channel_output, bool single_channel_output,
uint8_t channel) { uint8_t channel) {

View File

@ -24,6 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "shared-bindings/audiomixer/Mixer.h" #include "shared-bindings/audiomixer/Mixer.h"
#include "shared-bindings/audiomixer/MixerVoice.h"
#include "shared-module/audiomixer/MixerVoice.h" #include "shared-module/audiomixer/MixerVoice.h"
#include <stdint.h> #include <stdint.h>

View File

@ -290,10 +290,6 @@ uint8_t common_hal_audiomp3_mp3file_get_channel_count(audiomp3_mp3file_obj_t *se
return self->channel_count; 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, void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t *self,
bool single_channel_output, bool single_channel_output,
uint8_t channel) { uint8_t channel) {

View File

@ -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, void common_hal_bitmaptools_fill_region(displayio_bitmap_t *destination,
int16_t x1, int16_t y1, int16_t x1, int16_t y1,
int16_t x2, int16_t y2, int16_t x2, int16_t y2,

View File

@ -24,7 +24,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "shared-bindings/board/__init__.h"
#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h"
#include "shared-module/board/__init__.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
#include "mpconfigboard.h" #include "mpconfigboard.h"
#include "py/runtime.h" #include "py/runtime.h"

View File

@ -103,7 +103,7 @@ bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self
return displayio_display_core_show(&self->core, root_group); 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) { if (self->core.full_refresh) {
self->core.area.next = NULL; self->core.area.next = NULL;
return &self->core.area; 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; 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 // run start sequence
self->core.bus_reset(self->core.bus); 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; 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. // Actually refresh the display now that all pixel RAM has been updated.
displayio_display_core_begin_transaction(&self->core); displayio_display_core_begin_transaction(&self->core);
self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, &self->refresh_display_command, 1); 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 uint16_t buffer_size = 128; // In uint32_ts
displayio_area_t clipped; displayio_area_t clipped;

View File

@ -104,7 +104,7 @@ bool displayio_tilegrid_get_previous_area(displayio_tilegrid_t *self, displayio_
return true; return true;
} }
void _update_current_x(displayio_tilegrid_t *self) { STATIC void _update_current_x(displayio_tilegrid_t *self) {
uint16_t width; uint16_t width;
if (self->transpose_xy) { if (self->transpose_xy) {
width = self->pixel_height; 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; uint16_t height;
if (self->transpose_xy) { if (self->transpose_xy) {
height = self->pixel_width; height = self->pixel_width;

View File

@ -25,6 +25,7 @@
*/ */
#include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/Event.h"
#include "shared-bindings/keypad/EventQueue.h"
#include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/supervisor/__init__.h"
#include "shared-module/keypad/EventQueue.h" #include "shared-module/keypad/EventQueue.h"

View File

@ -38,6 +38,8 @@
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
#include "shared-bindings/msgpack/ExtType.h" #include "shared-bindings/msgpack/ExtType.h"
#include "shared-bindings/msgpack/__init__.h"
#include "shared-module/msgpack/__init__.h"
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// stream management // stream management

View File

@ -30,6 +30,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "shared-bindings/os/__init__.h" #include "shared-bindings/os/__init__.h"
#include "shared-bindings/random/__init__.h"
#include "shared-bindings/time/__init__.h" #include "shared-bindings/time/__init__.h"
// Yasmarang random number generator // Yasmarang random number generator

View File

@ -25,6 +25,7 @@
*/ */
#if CIRCUITPY_ROTARYIO && CIRCUITPY_ROTARYIO_SOFTENCODER #if CIRCUITPY_ROTARYIO && CIRCUITPY_ROTARYIO_SOFTENCODER
#include "shared-bindings/rotaryio/IncrementalEncoder.h"
#include "shared-module/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h"
#include "common-hal/rotaryio/IncrementalEncoder.h" #include "common-hal/rotaryio/IncrementalEncoder.h"

View File

@ -28,6 +28,7 @@
#include "shared-bindings/busio/SPI.h" #include "shared-bindings/busio/SPI.h"
#include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/sdcardio/SDCard.h"
#include "shared-bindings/time/__init__.h" #include "shared-bindings/time/__init__.h"
#include "shared-bindings/util.h" #include "shared-bindings/util.h"
#include "shared-module/sdcardio/SDCard.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); 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) { if (!self->bus) {
raise_deinited_error(); raise_deinited_error();
} }
@ -336,7 +337,7 @@ int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) {
return self->sectors; 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}; uint8_t aux[2] = {0, 0};
while (aux[0] != 0xfe) { while (aux[0] != 0xfe) {
common_hal_busio_spi_read(self->bus, aux, 1, 0xff); 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; 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; uint32_t nblocks = buf->len / 512;
if (nblocks == 1) { if (nblocks == 1) {
// Use CMD17 to read a single block // Use CMD17 to read a single block

View File

@ -53,19 +53,19 @@ int common_hal_sharpdisplay_framebuffer_get_height(sharpdisplay_framebuffer_obj_
return self->height; 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; 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; 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; 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; return true;
} }
@ -143,7 +143,7 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_
common_hal_sharpdisplay_framebuffer_get_bufinfo(self, NULL); 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 // claim SPI bus
if (!common_hal_busio_spi_try_lock(self->bus)) { if (!common_hal_busio_spi_try_lock(self->bus)) {
return; return;

View File

@ -32,8 +32,9 @@
#include "py/binary.h" #include "py/binary.h"
#include "py/parsenum.h" #include "py/parsenum.h"
#include "supervisor/shared/translate.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 MICROPY_NONSTANDARD_TYPECODES
if (fmt == 'S' || fmt == 'O') { if (fmt == 'S' || fmt == 'O') {
mp_raise_RuntimeError(translate("'S' and 'O' are not supported format types")); mp_raise_RuntimeError(translate("'S' and 'O' are not supported format types"));
@ -41,7 +42,7 @@ void struct_validate_format(char fmt) {
#endif #endif
} }
char get_fmt_type(const char **fmt) { STATIC char get_fmt_type(const char **fmt) {
char t = **fmt; char t = **fmt;
switch (t) { switch (t) {
case '!': case '!':
@ -60,7 +61,7 @@ char get_fmt_type(const char **fmt) {
return t; 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; const char *num = *p;
uint len = 1; uint len = 1;
while (unichar_isdigit(*++num)) { while (unichar_isdigit(*++num)) {
@ -71,7 +72,7 @@ mp_uint_t get_fmt_num(const char **p) {
return val; return val;
} }
mp_uint_t calcsize_items(const char *fmt) { STATIC mp_uint_t calcsize_items(const char *fmt) {
mp_uint_t cnt = 0; mp_uint_t cnt = 0;
while (*fmt) { while (*fmt) {
int num = 1; int num = 1;

View File

@ -28,6 +28,7 @@
#include "shared-module/fontio/BuiltinFont.h" #include "shared-module/fontio/BuiltinFont.h"
#include "shared-bindings/displayio/TileGrid.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) { void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font) {
self->cursor_x = 0; self->cursor_x = 0;

View File

@ -27,6 +27,7 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "supervisor/port.h" #include "supervisor/port.h"
#include "supervisor/shared/tick.h" #include "supervisor/shared/tick.h"
#include "shared-bindings/time/__init__.h"
uint64_t common_hal_time_monotonic_ms(void) { uint64_t common_hal_time_monotonic_ms(void) {
return supervisor_ticks_ms64(); return supervisor_ticks_ms64();

View File

@ -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) { mp_obj_t common_hal_vectorio_rectangle_get_draw_protocol(void *rectangle) {
vectorio_rectangle_t *self = rectangle; vectorio_rectangle_t *self = rectangle;
return self->draw_protocol_instance; return self->draw_protocol_instance;

View File

@ -26,6 +26,7 @@
#include "py/obj.h" #include "py/obj.h"
#include "py/mpstate.h" #include "py/mpstate.h"
#include "shared/runtime/interrupt_char.h"
#if MICROPY_KBD_EXCEPTION #if MICROPY_KBD_EXCEPTION

View File

@ -52,7 +52,7 @@ typedef struct _sys_stdio_obj_t {
STATIC const sys_stdio_obj_t stdio_buffer_obj; STATIC const sys_stdio_obj_t stdio_buffer_obj;
#endif #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); sys_stdio_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_printf(print, "<io.FileIO %d>", self->fd); mp_printf(print, "<io.FileIO %d>", self->fd);
} }