From 6f0d62d85e8e918529c4e0868ebd2abd4eca9d83 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 18 Mar 2022 12:05:54 -0700 Subject: [PATCH] Formatting and shrink build size on C3 --- ports/espressif/common-hal/mdns/RemoteService.c | 8 ++++---- ports/espressif/common-hal/mdns/Server.c | 6 +++--- ports/espressif/mpconfigport.mk | 7 ++++--- shared-bindings/mdns/RemoteService.c | 1 - shared-bindings/mdns/RemoteService.h | 8 ++++---- shared-bindings/mdns/Server.h | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ports/espressif/common-hal/mdns/RemoteService.c b/ports/espressif/common-hal/mdns/RemoteService.c index 69c96fe0f8..e7eb93dc52 100644 --- a/ports/espressif/common-hal/mdns/RemoteService.c +++ b/ports/espressif/common-hal/mdns/RemoteService.c @@ -26,19 +26,19 @@ #include "shared-bindings/mdns/RemoteService.h" -const char * common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self) { +const char *common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self) { return self->result->service_type; } -const char * common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t *self) { +const char *common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t *self) { return self->result->proto; } -const char * common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self) { +const char *common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self) { return self->result->instance_name; } -const char * common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self) { +const char *common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self) { return self->result->hostname; } diff --git a/ports/espressif/common-hal/mdns/Server.c b/ports/espressif/common-hal/mdns/Server.c index eecd1ad66e..2f260bbde0 100644 --- a/ports/espressif/common-hal/mdns/Server.c +++ b/ports/espressif/common-hal/mdns/Server.c @@ -76,7 +76,7 @@ bool common_hal_mdns_server_deinited(mdns_server_obj_t *self) { return mdns_instance_name_set(NULL) == ESP_ERR_INVALID_STATE; } -const char * common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) { +const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) { return self->hostname; } @@ -85,7 +85,7 @@ void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *ho self->hostname = hostname; } -const char * common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self) { +const char *common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self) { if (self->instance_name == NULL) { return self->hostname; } @@ -121,7 +121,7 @@ mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *servic // Don't error if we're out of memory. Instead, truncate the tuple. uint8_t added = 0; while (next != NULL) { - mdns_remoteservice_obj_t *service = gc_alloc(sizeof(mdns_remoteservice_obj_t), true, false); + mdns_remoteservice_obj_t *service = gc_alloc(sizeof(mdns_remoteservice_obj_t), GC_ALLOC_FLAG_HAS_FINALISER, false); if (service == NULL) { if (added == 0) { m_malloc_fail(sizeof(mdns_remoteservice_obj_t)); diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 46e5bd3bb7..e70cc0f102 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -34,18 +34,19 @@ CIRCUITPY_ESPIDF ?= 1 CIRCUITPY_MODULE ?= none ifeq ($(IDF_TARGET),esp32c3) -CIRCUITPY_USB = 0 CIRCUITPY_ALARM = 0 +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 1 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_IMAGECAPTURE = 0 +CIRCUITPY_MDNS = 0 CIRCUITPY_PARALLELDISPLAY = 0 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +CIRCUITPY_USB = 0 else ifeq ($(IDF_TARGET),esp32s3) CIRCUITPY_BLEIO = 1 CIRCUITPY_BLEIO_HCI = 0 diff --git a/shared-bindings/mdns/RemoteService.c b/shared-bindings/mdns/RemoteService.c index 4e1c63099d..2c8c9f6fd7 100644 --- a/shared-bindings/mdns/RemoteService.c +++ b/shared-bindings/mdns/RemoteService.c @@ -140,7 +140,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_deinit_obj, mdns_remoteservi STATIC const mp_rom_map_elem_t mdns_remoteservice_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_hostname), MP_ROM_PTR(&mdns_remoteservice_hostname_obj) }, { MP_ROM_QSTR(MP_QSTR_instance_name), MP_ROM_PTR(&mdns_remoteservice_instance_name_obj) }, - { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&mdns_remoteservice_instance_name_obj) }, { MP_ROM_QSTR(MP_QSTR_service_type), MP_ROM_PTR(&mdns_remoteservice_service_type_obj) }, { MP_ROM_QSTR(MP_QSTR_protocol), MP_ROM_PTR(&mdns_remoteservice_protocol_obj) }, { MP_ROM_QSTR(MP_QSTR_port), MP_ROM_PTR(&mdns_remoteservice_port_obj) }, diff --git a/shared-bindings/mdns/RemoteService.h b/shared-bindings/mdns/RemoteService.h index 055ea24d2c..f751b683ed 100644 --- a/shared-bindings/mdns/RemoteService.h +++ b/shared-bindings/mdns/RemoteService.h @@ -33,9 +33,9 @@ extern const mp_obj_type_t mdns_remoteservice_type; -const char * common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self); -const char * common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t *self); -const char * common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self); -const char * common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self); +const char *common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self); +const char *common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t *self); +const char *common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self); +const char *common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self); mp_int_t common_hal_mdns_remoteservice_get_port(mdns_remoteservice_obj_t *self); void common_hal_mdns_remoteservice_deinit(mdns_remoteservice_obj_t *self); diff --git a/shared-bindings/mdns/Server.h b/shared-bindings/mdns/Server.h index 741cced9a0..a178e9bd2d 100644 --- a/shared-bindings/mdns/Server.h +++ b/shared-bindings/mdns/Server.h @@ -35,9 +35,9 @@ extern const mp_obj_type_t mdns_server_type; void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_interface); void common_hal_mdns_server_deinit(mdns_server_obj_t *self); bool common_hal_mdns_server_deinited(mdns_server_obj_t *self); -const char * common_hal_mdns_server_get_hostname(mdns_server_obj_t *self); +const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self); void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *hostname); -const char * common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self); +const char *common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self); void common_hal_mdns_server_set_instance_name(mdns_server_obj_t *self, const char *instance_name); mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_float_t timeout); void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port);