Skip to content

Commit 4cd370e

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into add-os-utime-function
2 parents 987030e + 14c9028 commit 4cd370e

File tree

23 files changed

+89
-50
lines changed

23 files changed

+89
-50
lines changed

locale/circuitpython.pot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ msgstr ""
6060
msgid "%%c requires int or char"
6161
msgstr ""
6262

63+
#: main.c
64+
#, c-format
65+
msgid "%02X"
66+
msgstr ""
67+
6368
#: shared-bindings/rgbmatrix/RGBMatrix.c
6469
#, c-format
6570
msgid ""
@@ -2077,6 +2082,10 @@ msgstr ""
20772082
msgid "UART write"
20782083
msgstr ""
20792084

2085+
#: main.c
2086+
msgid "UID:"
2087+
msgstr ""
2088+
20802089
#: shared-module/usb_hid/Device.c
20812090
msgid "USB busy"
20822091
msgstr ""

main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
779779
#if CIRCUITPY_MICROCONTROLLER && COMMON_HAL_MCU_PROCESSOR_UID_LENGTH > 0
780780
uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH];
781781
common_hal_mcu_processor_get_uid(raw_id);
782-
mp_printf(&mp_plat_print, "UID:");
783-
for (uint8_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
784-
mp_printf(&mp_plat_print, "%02X", raw_id[i]);
782+
mp_cprintf(&mp_plat_print, translate("UID:"));
783+
for (size_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
784+
mp_cprintf(&mp_plat_print, translate("%02X"), raw_id[i]);
785785
}
786786
mp_printf(&mp_plat_print, "\n");
787787
port_boot_info();

ports/atmel-samd/common-hal/busio/I2C.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
125125
// exact cutoff, but no frequency well under 100kHz is available)
126126
if ((frequency < 95000) ||
127127
(i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE)) {
128-
reset_pin_number(sda->number);
129-
reset_pin_number(scl->number);
130128
common_hal_busio_i2c_deinit(self);
131129
mp_arg_error_invalid(MP_QSTR_frequency);
132130
}

ports/espressif/common-hal/wifi/Radio.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, const uint
165165
esp_wifi_set_mac(ESP_IF_WIFI_AP, mac);
166166
}
167167

168-
mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
168+
mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, uint8_t start_channel, uint8_t stop_channel) {
169169
if (self->current_scan != NULL) {
170170
mp_raise_RuntimeError(translate("Already scanning for wifi networks"));
171171
}
@@ -177,9 +177,12 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
177177
wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t);
178178
scan->base.type = &wifi_scannednetworks_type;
179179
self->current_scan = scan;
180-
scan->start_channel = 1;
181-
scan->end_channel = 11;
180+
scan->current_channel_index = 0;
181+
scan->start_channel = start_channel;
182+
scan->end_channel = stop_channel;
182183
scan->radio_event_group = self->event_group_handle;
184+
scan->done = false;
185+
scan->channel_scan_in_progress = false;
183186
wifi_scannednetworks_scan_next_channel(scan);
184187
return scan;
185188
}

ports/espressif/common-hal/wifi/ScannedNetworks.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self)
7272
return mp_const_none;
7373
}
7474
// If we are scanning, wait and then load them.
75-
if (self->scanning) {
75+
if (self->channel_scan_in_progress) {
7676
// We may have to scan more than one channel to get a result.
7777
while (!self->done) {
7878
if (!wifi_scannednetworks_wait_for_scan(self)) {
@@ -81,7 +81,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self)
8181
}
8282

8383
esp_wifi_scan_get_ap_num(&self->total_results);
84-
self->scanning = false;
84+
self->channel_scan_in_progress = false;
8585
if (self->total_results > 0) {
8686
break;
8787
}
@@ -112,7 +112,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self)
112112
}
113113
}
114114
esp_wifi_scan_get_ap_records(&self->total_results, self->results);
115-
self->scanning = false;
115+
self->channel_scan_in_progress = false;
116116
}
117117

118118
wifi_network_obj_t *entry = m_new_obj(wifi_network_obj_t);
@@ -132,40 +132,49 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self)
132132
}
133133

134134
// We don't do a linear scan so that we look at a variety of spectrum up front.
135-
static uint8_t scan_pattern[] = {6, 1, 11, 3, 9, 13, 2, 4, 8, 12, 5, 7, 10, 14};
135+
static uint8_t scan_pattern[] = {6, 1, 11, 3, 9, 13, 2, 4, 8, 12, 5, 7, 10, 14, 0};
136136

137137
void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) {
138-
uint8_t next_channel = sizeof(scan_pattern);
138+
// There is no channel 0, so use that as a flag to indicate we've run out of channels to scan.
139+
uint8_t next_channel = 0;
139140
while (self->current_channel_index < sizeof(scan_pattern)) {
140141
next_channel = scan_pattern[self->current_channel_index];
141142
self->current_channel_index++;
143+
// Scan only channels that are in the specified range.
142144
if (self->start_channel <= next_channel && next_channel <= self->end_channel) {
143145
break;
144146
}
145147
}
146148
wifi_scan_config_t config = { 0 };
147149
config.channel = next_channel;
148-
if (next_channel == sizeof(scan_pattern)) {
150+
if (next_channel == 0) {
149151
wifi_scannednetworks_done(self);
150152
} else {
151153
esp_err_t result = esp_wifi_scan_start(&config, false);
152154
if (result != ESP_OK) {
153155
wifi_scannednetworks_done(self);
154156
} else {
155-
self->scanning = true;
157+
self->channel_scan_in_progress = true;
156158
}
157159
}
158160
}
159161

160162
void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t *self) {
161163
// if a scan is active, make sure and clean up the idf's buffer of results.
162-
if (self->scanning) {
164+
if (self->channel_scan_in_progress) {
163165
esp_wifi_scan_stop();
164166
if (wifi_scannednetworks_wait_for_scan(self)) {
165-
// Ignore the number of records since we're throwing them away.
166-
uint16_t number = 0;
167-
esp_wifi_scan_get_ap_records(&number, NULL);
168-
self->scanning = false;
167+
// Discard the scanned records, one at a time, to avoid memory leaks.
168+
uint16_t number;
169+
do {
170+
number = 1;
171+
wifi_ap_record_t record;
172+
esp_wifi_scan_get_ap_records(&number, &record);
173+
} while (number > 0);
174+
// TODO: available in ESP-IDF v5.0; do instead of the above.
175+
// Discard scan results.
176+
// esp_wifi_clear_ap_list();
177+
self->channel_scan_in_progress = false;
169178
}
170179
}
171180
wifi_scannednetworks_done(self);

ports/espressif/common-hal/wifi/ScannedNetworks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef struct {
5353
uint8_t end_channel; // Inclusive
5454

5555
bool done;
56-
bool scanning;
56+
bool channel_scan_in_progress;
5757
} wifi_scannednetworks_obj_t;
5858

5959
void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self);

ports/espressif/common-hal/wifi/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void common_hal_wifi_init(bool user_initiated) {
172172
// Even though we just called esp_netif_create_default_wifi_sta,
173173
// station mode isn't actually ready for use until esp_wifi_set_mode()
174174
// is called and the configuration is loaded via esp_wifi_set_config().
175-
// Set both convienence flags to false so it's not forgotten.
175+
// Set both convenience flags to false so it's not forgotten.
176176
self->sta_mode = 0;
177177
self->ap_mode = 0;
178178

ports/espressif/esp-idf

Submodule esp-idf updated 724 files

ports/raspberrypi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ INC_CYW43 := \
6565
-isystem sdk/src/rp2_common/pico_cyw43_arch/include/ \
6666
-isystem sdk/src/rp2_common/pico_lwip/include/ \
6767

68-
CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DCYW43_LOGIC_DEBUG=0
68+
CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DIGNORE_GPIO24 -DCYW43_LOGIC_DEBUG=0
6969
SRC_SDK_CYW43 := \
7070
src/common/pico_sync/sem.c \
7171
src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c \

ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
2828
{ MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) },
2929

3030
{ MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_CYW1) },
31-
{ MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_CYW1) },
32-
33-
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) },
34-
{ MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) },
3531

3632
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_CYW0) },
37-
{ MP_ROM_QSTR(MP_QSTR_CYW0), MP_ROM_PTR(&pin_CYW0) },
33+
34+
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_CYW2) },
3835

3936
{ MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) },
4037
{ MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) },
@@ -47,8 +44,5 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4744
{ MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) },
4845
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
4946
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
50-
51-
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) },
52-
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) },
5347
};
5448
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/raspberrypi/common-hal/microcontroller/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ const mp_rom_map_elem_t mcu_pin_global_dict_table[TOTAL_GPIO_COUNT] = {
176176
#if !defined(IGNORE_GPIO23)
177177
{ MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) },
178178
#endif
179+
#if !defined(IGNORE_GPIO24)
179180
{ MP_ROM_QSTR(MP_QSTR_GPIO24), MP_ROM_PTR(&pin_GPIO24) },
181+
#endif
180182
#if !defined(IGNORE_GPIO25)
181183
{ MP_ROM_QSTR(MP_QSTR_GPIO25), MP_ROM_PTR(&pin_GPIO25) },
182184
#endif
@@ -187,6 +189,7 @@ const mp_rom_map_elem_t mcu_pin_global_dict_table[TOTAL_GPIO_COUNT] = {
187189
#if CIRCUITPY_CYW43
188190
{ MP_ROM_QSTR(MP_QSTR_CYW0), MP_ROM_PTR(&pin_CYW0) },
189191
{ MP_ROM_QSTR(MP_QSTR_CYW1), MP_ROM_PTR(&pin_CYW1) },
192+
{ MP_ROM_QSTR(MP_QSTR_CYW2), MP_ROM_PTR(&pin_CYW2) },
190193
#endif
191194
};
192195
MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_global_dict_table);

ports/raspberrypi/common-hal/wifi/Radio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, const uint
131131
ro_attribute(MP_QSTR_mac_address_ap);
132132
}
133133

134-
mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) {
134+
mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, uint8_t start_channel, uint8_t stop_channel) {
135+
// channel bounds are ignored; not implemented in driver
135136
if (self->current_scan) {
136137
mp_raise_RuntimeError(translate("Already scanning for wifi networks"));
137138
}

ports/raspberrypi/peripherals/pins.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ PIN(19);
6464
PIN(20);
6565
PIN(21);
6666
PIN(22);
67+
#if !defined(IGNORE_GPIO23)
6768
PIN(23);
69+
#endif
70+
#if !defined(IGNORE_GPIO24)
6871
PIN(24);
72+
#endif
6973
#if !defined(IGNORE_GPIO25)
7074
PIN(25);
7175
#endif
@@ -76,4 +80,5 @@ PIN(29);
7680
#if CIRCUITPY_CYW43
7781
CYW_PIN(0);
7882
CYW_PIN(1);
83+
CYW_PIN(2);
7984
#endif

ports/raspberrypi/peripherals/pins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ extern const mcu_pin_obj_t pin_GPIO29;
7373
#if CIRCUITPY_CYW43
7474
extern const mcu_pin_obj_t pin_CYW0;
7575
extern const mcu_pin_obj_t pin_CYW1;
76+
extern const mcu_pin_obj_t pin_CYW2;
7677
#endif
7778

7879
#endif // MICROPY_INCLUDED_RASPBERRYPI_PERIPHERALS_PINS_H

py/modbuiltins.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = {
759759
{ MP_ROM_QSTR(MP_QSTR_KeyError), MP_ROM_PTR(&mp_type_KeyError) },
760760
{ MP_ROM_QSTR(MP_QSTR_LookupError), MP_ROM_PTR(&mp_type_LookupError) },
761761
{ MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_MemoryError) },
762-
{ MP_ROM_QSTR(MP_QSTR_MpyError), MP_ROM_PTR(&mp_type_MpyError) },
763762
{ MP_ROM_QSTR(MP_QSTR_NameError), MP_ROM_PTR(&mp_type_NameError) },
764763
{ MP_ROM_QSTR(MP_QSTR_NotImplementedError), MP_ROM_PTR(&mp_type_NotImplementedError) },
765764
{ MP_ROM_QSTR(MP_QSTR_OSError), MP_ROM_PTR(&mp_type_OSError) },

py/obj.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ extern const mp_obj_type_t mp_type_ReloadException;
742742
extern const mp_obj_type_t mp_type_KeyError;
743743
extern const mp_obj_type_t mp_type_LookupError;
744744
extern const mp_obj_type_t mp_type_MemoryError;
745-
extern const mp_obj_type_t mp_type_MpyError;
746745
extern const mp_obj_type_t mp_type_NameError;
747746
extern const mp_obj_type_t mp_type_NotImplementedError;
748747
extern const mp_obj_type_t mp_type_OSError;

py/objexcept.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ MP_DEFINE_EXCEPTION(UnicodeError, ValueError)
347347
#if CIRCUITPY_ALARM
348348
MP_DEFINE_EXCEPTION(DeepSleepRequest, BaseException)
349349
#endif
350-
MP_DEFINE_EXCEPTION(MpyError, ValueError)
351350
/*
352351
MP_DEFINE_EXCEPTION(Warning, Exception)
353352
MP_DEFINE_EXCEPTION(DeprecationWarning, Warning)

py/persistentcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ mp_raw_code_t *mp_raw_code_load(mp_reader_t *reader) {
582582
|| MPY_FEATURE_DECODE_FLAGS(header[2]) != MPY_FEATURE_FLAGS
583583
|| header[3] > mp_small_int_bits()
584584
|| read_uint(reader, NULL) > QSTR_WINDOW_SIZE) {
585-
mp_raise_MpyError(MP_ERROR_TEXT("Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info."));
585+
mp_raise_ValueError(MP_ERROR_TEXT("Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info."));
586586
}
587587
if (MPY_FEATURE_DECODE_ARCH(header[2]) != MP_NATIVE_ARCH_NONE) {
588588
byte arch = MPY_FEATURE_DECODE_ARCH(header[2]);

py/runtime.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,10 +1742,6 @@ NORETURN void mp_raise_OverflowError_varg(const compressed_string_t *fmt, ...) {
17421742
va_end(argptr);
17431743
}
17441744

1745-
NORETURN void mp_raise_MpyError(const compressed_string_t *msg) {
1746-
mp_raise_msg(&mp_type_MpyError, msg);
1747-
}
1748-
17491745
NORETURN void mp_raise_type_arg(const mp_obj_type_t *exc_type, mp_obj_t arg) {
17501746
nlr_raise(mp_obj_new_exception_arg1(exc_type, arg));
17511747
}

py/runtime.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ NORETURN void mp_raise_BrokenPipeError(void);
225225
NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg);
226226
NORETURN void mp_raise_NotImplementedError_varg(const compressed_string_t *fmt, ...);
227227
NORETURN void mp_raise_OverflowError_varg(const compressed_string_t *fmt, ...);
228-
NORETURN void mp_raise_MpyError(const compressed_string_t *msg);
229228
NORETURN void mp_raise_recursion_depth(void);
230229
#endif
231230

shared-bindings/wifi/Radio.c

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,38 @@ MP_PROPERTY_GETSET(wifi_radio_mac_address_ap_obj,
216216
//| def start_scanning_networks(
217217
//| self, *, start_channel: int = 1, stop_channel: int = 11
218218
//| ) -> Iterable[Network]:
219-
//| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country."""
219+
//| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country.
220+
//|
221+
//| .. note::
222+
//|
223+
//| In the raspberrypi port (RP2040 CYW43), ``start_channel`` and ``stop_channel`` are ignored.
224+
//| """
220225
//| ...
221-
STATIC mp_obj_t wifi_radio_start_scanning_networks(mp_obj_t self_in) {
222-
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in);
226+
STATIC mp_obj_t wifi_radio_start_scanning_networks(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
227+
enum { ARG_start_channel, ARG_stop_channel };
228+
static const mp_arg_t allowed_args[] = {
229+
{ MP_QSTR_start_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
230+
{ MP_QSTR_stop_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 11} },
231+
};
232+
233+
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
234+
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
235+
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
236+
237+
uint8_t start_channel =
238+
(uint8_t)mp_arg_validate_int_range(args[ARG_start_channel].u_int, 1, 14, MP_QSTR_start_channel);
239+
uint8_t stop_channel =
240+
(uint8_t)mp_arg_validate_int_range(args[ARG_stop_channel].u_int, 1, 14, MP_QSTR_stop_channel);
241+
// Swap if in reverse order, without complaining.
242+
if (start_channel > stop_channel) {
243+
uint8_t temp = stop_channel;
244+
stop_channel = start_channel;
245+
start_channel = temp;
246+
}
223247

224-
return common_hal_wifi_radio_start_scanning_networks(self);
248+
return common_hal_wifi_radio_start_scanning_networks(self, start_channel, stop_channel);
225249
}
226-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_start_scanning_networks_obj, wifi_radio_start_scanning_networks);
250+
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_start_scanning_networks_obj, 1, wifi_radio_start_scanning_networks);
227251

228252
//| def stop_scanning_networks(self) -> None:
229253
//| """Stop scanning for Wifi networks and free any resources used to do it."""

shared-bindings/wifi/Radio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, con
8585
extern mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self);
8686
extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t power);
8787

88-
extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self);
88+
extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, uint8_t start_channel, uint8_t stop_channel);
8989
extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self);
9090

9191
extern void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mod0 RuntimeError Corrupt .mpy file
22
mod1 RuntimeError Corrupt .mpy file
3-
mod2 MpyError Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
4-
mod3 MpyError Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
3+
mod2 ValueError Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
4+
mod3 ValueError Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.

0 commit comments

Comments
 (0)