Skip to content

Commit f645428

Browse files
committed
esp32/modnetwork: Remove unnecessary indirection variable for scan list.
1 parent 60eda02 commit f645428

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

esp32/modnetwork.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ STATIC mp_obj_t esp_status(mp_obj_t self_in) {
257257

258258
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_status_obj, esp_status);
259259

260-
STATIC mp_obj_t *esp_scan_list = NULL;
261-
262260
STATIC mp_obj_t esp_scan(mp_obj_t self_in) {
263261
// check that STA mode is active
264262
wifi_mode_t mode;
@@ -276,7 +274,6 @@ STATIC mp_obj_t esp_scan(mp_obj_t self_in) {
276274
ESP_EXCEPTIONS( esp_wifi_scan_get_ap_num(&count) );
277275
wifi_ap_record_t *wifi_ap_records = calloc(count, sizeof(wifi_ap_record_t));
278276
ESP_EXCEPTIONS( esp_wifi_scan_get_ap_records(&count, wifi_ap_records) );
279-
esp_scan_list = &list;
280277
for (uint16_t i = 0; i < count; i++) {
281278
mp_obj_tuple_t *t = mp_obj_new_tuple(6, NULL);
282279
uint8_t *x = memchr(wifi_ap_records[i].ssid, 0, sizeof(wifi_ap_records[i].ssid));
@@ -287,7 +284,7 @@ STATIC mp_obj_t esp_scan(mp_obj_t self_in) {
287284
t->items[3] = MP_OBJ_NEW_SMALL_INT(wifi_ap_records[i].rssi);
288285
t->items[4] = MP_OBJ_NEW_SMALL_INT(wifi_ap_records[i].authmode);
289286
t->items[5] = mp_const_false; // XXX hidden?
290-
mp_obj_list_append(*esp_scan_list, MP_OBJ_FROM_PTR(t));
287+
mp_obj_list_append(list, MP_OBJ_FROM_PTR(t));
291288
}
292289
free(wifi_ap_records);
293290
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy