From 39eea77a0bb34500bb521057c51f120cb197f281 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Mon, 20 Mar 2023 15:59:48 +0000 Subject: [PATCH] Badger 2040W: Leaner startup for #6. --- firmware/PIMORONI_BADGER2040W/lib/badger2040.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/firmware/PIMORONI_BADGER2040W/lib/badger2040.py b/firmware/PIMORONI_BADGER2040W/lib/badger2040.py index 5765b0a..95b333c 100644 --- a/firmware/PIMORONI_BADGER2040W/lib/badger2040.py +++ b/firmware/PIMORONI_BADGER2040W/lib/badger2040.py @@ -1,12 +1,7 @@ import machine import micropython from picographics import PicoGraphics, DISPLAY_INKY_PACK -import network -from network_manager import NetworkManager -import WIFI_CONFIG -import uasyncio import time -import gc import wakeup import pcf85063a @@ -240,6 +235,12 @@ def ip_address(self): return network.WLAN(network.STA_IF).ifconfig()[0] def connect(self): + import network + from network_manager import NetworkManager + import WIFI_CONFIG + import uasyncio + import gc + if WIFI_CONFIG.COUNTRY == "": raise RuntimeError("You must populate WIFI_CONFIG.py for networking.") self.display.set_update_speed(2)