Merge pull request #913 from openmv/portenta_wifi_fixes

Portenta wifi fixes
This commit is contained in:
Ibrahim Abd Elkader 2020-09-30 21:58:21 +02:00 committed by GitHub
commit a9916339ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

@ -1 +1 @@
Subproject commit a21ea079f4aa96de59ece2ded10857bca6574ab0
Subproject commit 1d5f608adc12be228d71ac97a9174be1a4a9a904

View File

@ -76,6 +76,12 @@
#include "ini.h"
#include "omv_boardconfig.h"
#if MICROPY_PY_LWIP
#include "lwip/init.h"
#include "lwip/apps/mdns.h"
#include "drivers/cyw43/cyw43.h"
#endif
int errno;
extern char _vfs_buf;
static fs_user_mount_t *vfs_fat = (fs_user_mount_t *) &_vfs_buf;
@ -496,6 +502,29 @@ soft_reset:
sdcard_init();
#endif
rtc_init_start(false);
#if MICROPY_PY_LWIP
// lwIP doesn't allow to reinitialise itself by subsequent calls to this function
// because the system timeout list (next_timeout) is only ever reset by BSS clearing.
// So for now we only init the lwIP stack once on power-up.
if (first_soft_reset) {
lwip_init();
}
#if LWIP_MDNS_RESPONDER
mdns_resp_init();
#endif
systick_enable_dispatch(SYSTICK_DISPATCH_LWIP, mod_network_lwip_poll_wrapper);
#endif
#if MICROPY_PY_NETWORK_CYW43
{
cyw43_init(&cyw43_state);
uint8_t buf[8];
memcpy(&buf[0], "PYBD", 4);
mp_hal_get_mac_ascii(MP_HAL_MAC_WLAN0, 8, 4, (char *)&buf[4]);
cyw43_wifi_ap_set_ssid(&cyw43_state, 8, buf);
cyw43_wifi_ap_set_password(&cyw43_state, 8, (const uint8_t *)"pybd0123");
}
#endif
pyb_usb_init0();
MP_STATE_PORT(pyb_stdio_uart) = NULL;