Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit ca673c0

Browse files
committed
Small changes
1 parent ca10cd1 commit ca673c0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

esp32/mods/modbt.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,13 @@ static mp_obj_t bt_connect_helper(mp_obj_t addr, TickType_t timeout){
14361436

14371437
/* Initiate a background connection, esp_ble_gattc_open returns immediately */
14381438
if (ESP_OK != esp_ble_gattc_open(bt_obj.gattc_if, bufinfo.buf, BLE_ADDR_TYPE_PUBLIC, true)) {
1439-
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
1439+
// Only drop exception if not called from bt_resume() API, otherwise return with mp_const_none on error
1440+
if(mod_bt_allow_resume_deinit == false) {
1441+
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
1442+
}
1443+
else {
1444+
return mp_const_none;
1445+
}
14401446
}
14411447

14421448
MP_THREAD_GIL_EXIT();

esp32/mods/modmachine.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ STATIC mp_obj_t machine_sleep (uint n_args, const mp_obj_t *arg) {
442442
{
443443
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Wifi or BT not stopped before sleep"));
444444
}
445+
445446
/* resume wlan */
446447
wlan_resume(reconnect);
447448
/* resume bt */

esp32/mods/modwlan.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,6 @@ static void TASK_SMART_CONFIG (void *pvParameters) {
988988

989989
smartConf_start:
990990
wlan_smart_config_enabled = true;
991-
mp_printf(&mp_plat_print, "\n-------SmartConfig Started-------\n");
992991
/*create Timer */
993992
wlan_smartConfig_timeout = xTimerCreate("smartConfig_Timer", 60000 / portTICK_PERIOD_MS, 0, 0, wlan_timer_callback);
994993
/*start Timer */
@@ -2489,7 +2488,7 @@ STATIC mp_obj_t wlan_country(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
24892488
if(wlan_obj.country == NULL) {
24902489
wlan_obj.country = (wifi_country_t*)malloc(sizeof(wifi_country_t));
24912490
}
2492-
memcpy(&(wlan_obj.country), &country_config, sizeof(wlan_obj.country));
2491+
memcpy(wlan_obj.country, &country_config, sizeof(wifi_country_t));
24932492

24942493
return mp_const_none;
24952494
}

0 commit comments

Comments
 (0)