Add TODOs and -Os for RISC-V

This commit is contained in:
Scott Shawcroft 2022-01-26 17:07:20 -08:00
parent e409ff75cd
commit d9966c1724
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
6 changed files with 26 additions and 5 deletions

View File

@ -157,7 +157,12 @@ ifeq ($(DEBUG), 1)
# CFLAGS += -fno-inline -fno-ipa-sra # CFLAGS += -fno-inline -fno-ipa-sra
else else
CFLAGS += -DNDEBUG -ggdb3 CFLAGS += -DNDEBUG -ggdb3
ifeq ($(IDF_TARGET_ARCH),xtensa)
OPTIMIZATION_FLAGS ?= -O2 OPTIMIZATION_FLAGS ?= -O2
else
# RISC-V is larger than xtensa so do -Os for it
OPTIMIZATION_FLAGS ?= -Os
endif
# TODO: Test with -flto # TODO: Test with -flto
### CFLAGS += -flto ### CFLAGS += -flto
endif endif

View File

@ -75,6 +75,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
// mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), // mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"),
// max_length_max, fixed_length ? "True" : "False"); // max_length_max, fixed_length ? "True" : "False");
// } // }
// TODO: Implement this.
self->max_length = max_length; self->max_length = max_length;
self->fixed_length = fixed_length; self->fixed_length = fixed_length;
@ -97,6 +98,7 @@ bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_character
} }
size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t *buf, size_t len) { size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t *buf, size_t len) {
// TODO: Implement this.
return 0; return 0;
} }
@ -105,6 +107,7 @@ size_t common_hal_bleio_characteristic_get_max_length(bleio_characteristic_obj_t
} }
void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) { void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) {
// TODO: Implement this.
} }
bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self) { bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self) {
@ -116,8 +119,9 @@ bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties
} }
void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) { void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) {
// TODO: Implement this.
} }
void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) {
// TODO: Implement this.
} }

View File

@ -65,15 +65,17 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe
} }
uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) {
// TODO: Implement this.
return 0; return 0;
} }
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) {
// TODO: Implement this.
return 0; return 0;
} }
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) {
// TODO: Implement this.
} }
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) {
@ -81,6 +83,7 @@ bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer
} }
void 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) {
// TODO: Implement this.
} }
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) {

View File

@ -64,13 +64,15 @@ bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) {
} }
void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) {
// TODO: Implement this.
} }
void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) { void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) {
// TODO: Implement this.
} }
mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) { mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) {
// TODO: Implement this.
while (self->conn_params_updating && !mp_hal_is_interrupted()) { while (self->conn_params_updating && !mp_hal_is_interrupted()) {
RUN_BACKGROUND_TASKS; RUN_BACKGROUND_TASKS;
} }
@ -84,6 +86,7 @@ mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_inte
void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) {
self->conn_params_updating = true; self->conn_params_updating = true;
// TODO: Implement this.
} }
mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) {
@ -94,6 +97,7 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_conne
self->connection->remote_service_list->items); self->connection->remote_service_list->items);
mp_obj_list_clear(MP_OBJ_FROM_PTR(self->connection->remote_service_list)); mp_obj_list_clear(MP_OBJ_FROM_PTR(self->connection->remote_service_list));
// TODO: Implement this.
return services_tuple; return services_tuple;
} }

View File

@ -68,10 +68,13 @@ size_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self, uint8
(void)conn_handle; (void)conn_handle;
} }
// TODO: Implement this.
return 0; return 0;
} }
void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buffer_info_t *bufinfo) { void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buffer_info_t *bufinfo) {
// TODO: Implement this.
// Do GATT operations only if this descriptor has been registered. // Do GATT operations only if this descriptor has been registered.
if (self->handle != BLEIO_HANDLE_INVALID) { if (self->handle != BLEIO_HANDLE_INVALID) {
// uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); // uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection);

View File

@ -118,7 +118,7 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self
} }
// Copy received data. Lock out write interrupt handler while copying. // Copy received data. Lock out write interrupt handler while copying.
// TODO: Implement this.
return 0; return 0;
} }
@ -172,6 +172,7 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, c
self->pending_size += len; self->pending_size += len;
num_bytes_written += len; num_bytes_written += len;
// TODO: Implement this.
// If no writes are queued then sneak in this data. // If no writes are queued then sneak in this data.
if (!self->packet_queued) { if (!self->packet_queued) {
@ -270,4 +271,5 @@ bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) {
void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) { void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) {
if (!common_hal_bleio_packet_buffer_deinited(self)) { if (!common_hal_bleio_packet_buffer_deinited(self)) {
} }
// TODO: Implement this.
} }