Skip to content

Commit 1356819

Browse files
committed
Handle None for BLE name; fix ScanEntry bug; compile issue
1 parent cfa8b4b commit 1356819

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

ports/nrf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ INC += -I../../supervisor/shared/usb
9191
ifeq ($(DEBUG), 1)
9292
CFLAGS += -ggdb
9393
# You may want to enable these flags to make setting breakpoints easier.
94-
CFLAGS += -fno-inline -fno-ipa-sra
94+
# CFLAGS += -fno-inline -fno-ipa-sra
9595
else
9696
CFLAGS += -Os -DNDEBUG
9797
# TODO: Test with -flto

shared-bindings/bleio/Peripheral.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,8 @@ STATIC mp_obj_t bleio_peripheral_make_new(const mp_obj_type_t *type, size_t n_ar
117117
}
118118

119119
const mp_obj_t name = args[ARG_name].u_obj;
120-
if (name == MP_OBJ_NULL) {
120+
if (name == MP_OBJ_NULL || name == mp_const_none) {
121121
self->name = mp_obj_new_str(default_name, strlen(default_name));
122-
} else if (name == mp_const_none) {
123-
// Make None be the empty string.
124-
self->name = MP_OBJ_NEW_QSTR(MP_QSTR_);
125122
} else if (MP_OBJ_IS_STR(name)) {
126123
self->name = name;
127124
} else {

shared-bindings/bleio/ScanEntry.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) {
5555
bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in);
5656

5757
bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t);
58+
address->base.type = &bleio_address_type;
5859
memcpy(address->bytes, self->address.bytes, NUM_BLEIO_ADDRESS_BYTES);
5960
address->type = self->address.type;
6061
return MP_OBJ_TO_PTR(address);

shared-module/displayio/TileGrid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ void displayio_tilegrid_finish_refresh(displayio_tilegrid_t *self) {
440440
displayio_area_t* displayio_tilegrid_get_refresh_areas(displayio_tilegrid_t *self, displayio_area_t* tail) {
441441
if (self->moved && !self->first_draw) {
442442
displayio_area_union(&self->previous_area, &self->current_area, &self->dirty_area);
443-
if (displayio_area_size(&self->dirty_area) <= 2 * self->pixel_width * self->pixel_height) {
443+
if (displayio_area_size(&self->dirty_area) <= 2U * self->pixel_width * self->pixel_height) {
444444
self->dirty_area.next = tail;
445445
return &self->dirty_area;
446446
}

0 commit comments

Comments
 (0)