-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32,esp8266: Change network.WLAN from a function to a type.
When the network module was first introduced in the esp8266 port in ee3fec3 there was only one interface (STA) and, to save flash, the WLAN object was aliased to the network module, which had just static methods for WLAN operations. This was subsequently changed in 9e8396a when the AP interface was introduced, and the WLAN object became a true class. But, network.WLAN remained a function that returned either the STA or AP object and was never upgraded to the type itself. This scheme was then copied over to the esp32 port when it was first introduced. This commit changes network.WLAN from a function to a reference to the WLAN type. This makes it consistent with other ports and network objects, and allows accessing constants of network.WLAN without creating an instance. Signed-off-by: Damien George <damien@micropython.org>
- Loading branch information
Showing
6 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(esp_network_get_wlan_obj); | ||
extern const mp_obj_type_t esp_network_wlan_type; | ||
|
||
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(esp_network_phy_mode_obj); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters