Skip to content

Commit d9966c1

Browse files
committed
Add TODOs and -Os for RISC-V
1 parent e409ff7 commit d9966c1

File tree

6 files changed

+26
-5
lines changed

6 files changed

+26
-5
lines changed

ports/espressif/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ ifeq ($(DEBUG), 1)
157157
# CFLAGS += -fno-inline -fno-ipa-sra
158158
else
159159
CFLAGS += -DNDEBUG -ggdb3
160-
OPTIMIZATION_FLAGS ?= -O2
160+
ifeq ($(IDF_TARGET_ARCH),xtensa)
161+
OPTIMIZATION_FLAGS ?= -O2
162+
else
163+
# RISC-V is larger than xtensa so do -Os for it
164+
OPTIMIZATION_FLAGS ?= -Os
165+
endif
161166
# TODO: Test with -flto
162167
### CFLAGS += -flto
163168
endif

ports/espressif/common-hal/_bleio/Characteristic.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
7575
// mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"),
7676
// max_length_max, fixed_length ? "True" : "False");
7777
// }
78+
// TODO: Implement this.
7879
self->max_length = max_length;
7980
self->fixed_length = fixed_length;
8081

@@ -97,6 +98,7 @@ bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_character
9798
}
9899

99100
size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t *buf, size_t len) {
101+
// TODO: Implement this.
100102
return 0;
101103
}
102104

@@ -105,6 +107,7 @@ size_t common_hal_bleio_characteristic_get_max_length(bleio_characteristic_obj_t
105107
}
106108

107109
void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) {
110+
// TODO: Implement this.
108111
}
109112

110113
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
116119
}
117120

118121
void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) {
122+
// TODO: Implement this.
119123
}
120124

121125
void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) {
122-
126+
// TODO: Implement this.
123127
}

ports/espressif/common-hal/_bleio/CharacteristicBuffer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,25 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe
6565
}
6666

6767
uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) {
68-
68+
// TODO: Implement this.
6969
return 0;
7070
}
7171

7272
uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) {
73+
// TODO: Implement this.
7374
return 0;
7475
}
7576

7677
void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self) {
78+
// TODO: Implement this.
7779
}
7880

7981
bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self) {
8082
return self->characteristic == NULL;
8183
}
8284

8385
void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self) {
86+
// TODO: Implement this.
8487
}
8588

8689
bool common_hal_bleio_characteristic_buffer_connected(bleio_characteristic_buffer_obj_t *self) {

ports/espressif/common-hal/_bleio/Connection.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) {
6464
}
6565

6666
void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) {
67+
// TODO: Implement this.
6768
}
6869

6970
void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) {
70-
71+
// TODO: Implement this.
7172
}
7273

7374
mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) {
75+
// TODO: Implement this.
7476
while (self->conn_params_updating && !mp_hal_is_interrupted()) {
7577
RUN_BACKGROUND_TASKS;
7678
}
@@ -84,6 +86,7 @@ mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_inte
8486

8587
void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) {
8688
self->conn_params_updating = true;
89+
// TODO: Implement this.
8790
}
8891

8992
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
9497
self->connection->remote_service_list->items);
9598
mp_obj_list_clear(MP_OBJ_FROM_PTR(self->connection->remote_service_list));
9699

100+
// TODO: Implement this.
97101
return services_tuple;
98102
}
99103

ports/espressif/common-hal/_bleio/Descriptor.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ size_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self, uint8
6868
(void)conn_handle;
6969
}
7070

71+
// TODO: Implement this.
72+
7173
return 0;
7274
}
7375

7476
void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buffer_info_t *bufinfo) {
77+
// TODO: Implement this.
7578
// Do GATT operations only if this descriptor has been registered.
7679
if (self->handle != BLEIO_HANDLE_INVALID) {
7780
// uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection);

ports/espressif/common-hal/_bleio/PacketBuffer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self
118118
}
119119

120120
// Copy received data. Lock out write interrupt handler while copying.
121-
121+
// TODO: Implement this.
122122
return 0;
123123
}
124124

@@ -172,6 +172,7 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, c
172172
self->pending_size += len;
173173
num_bytes_written += len;
174174

175+
// TODO: Implement this.
175176

176177
// If no writes are queued then sneak in this data.
177178
if (!self->packet_queued) {
@@ -270,4 +271,5 @@ bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) {
270271
void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) {
271272
if (!common_hal_bleio_packet_buffer_deinited(self)) {
272273
}
274+
// TODO: Implement this.
273275
}

0 commit comments

Comments
 (0)