summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-05-17 14:20:24 +0200
committerDaniel Campora <daniel@wipy.io>2015-05-17 14:20:24 +0200
commitcd3f2523f10605873369e973743e2f8a95c6b808 (patch)
tree275a711d1afa8f854d18f5c5320aac5adaae6762
parenta379b6ed111a7e9a6e20e9701f8681b497987615 (diff)
downloadmicropython-cd3f2523f10605873369e973743e2f8a95c6b808.tar.gz
micropython-cd3f2523f10605873369e973743e2f8a95c6b808.zip
cc3200: Disable WLAN.urn() by default.
Can be enabled by defining MICROPY_PORT_WLAN_URN=1 in mpconfigport.h.
-rw-r--r--cc3200/mods/modwlan.c6
-rw-r--r--cc3200/mods/pybpin.c2
-rw-r--r--cc3200/mpconfigport.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c
index aedd4e2a9c..d0a47d2b25 100644
--- a/cc3200/mods/modwlan.c
+++ b/cc3200/mods/modwlan.c
@@ -124,7 +124,7 @@ typedef struct _wlan_obj_t {
#define MODWLAN_TIMEOUT_MS 5000
#define MODWLAN_MAX_NETWORKS 20
-#define MODWLAN_SCAN_PERIOD_S 300 // 5 minutes
+#define MODWLAN_SCAN_PERIOD_S 3600 // 1 hour
#define MODWLAN_WAIT_FOR_SCAN_MS 1050
#define ASSERT_ON_ERROR( x ) ASSERT((x) >= 0 )
@@ -850,6 +850,7 @@ STATIC mp_obj_t wlan_ifconfig (mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(wlan_ifconfig_obj, wlan_ifconfig);
+#if MICROPY_PORT_WLAN_URN
STATIC mp_obj_t wlan_urn (uint n_args, const mp_obj_t *args) {
char urn[MAX_DEVICE_URN_LEN];
uint8_t len = MAX_DEVICE_URN_LEN;
@@ -880,6 +881,7 @@ STATIC mp_obj_t wlan_urn (uint n_args, const mp_obj_t *args) {
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_urn_obj, 1, 2, wlan_urn);
+#endif
/// \method wlan_netlist()
/// Return a list of tuples with all the acces points within range
@@ -1037,7 +1039,9 @@ STATIC const mp_map_elem_t wlan_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_disconnect), (mp_obj_t)&wlan_disconnect_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_isconnected), (mp_obj_t)&wlan_isconnected_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ifconfig), (mp_obj_t)&wlan_ifconfig_obj },
+#if MICROPY_PORT_WLAN_URN
{ MP_OBJ_NEW_QSTR(MP_QSTR_urn), (mp_obj_t)&wlan_urn_obj },
+#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_callback), (mp_obj_t)&wlan_callback_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_config_ip), (mp_obj_t)&wlan_config_ip_obj },
diff --git a/cc3200/mods/pybpin.c b/cc3200/mods/pybpin.c
index 521579d008..9022b1cd52 100644
--- a/cc3200/mods/pybpin.c
+++ b/cc3200/mods/pybpin.c
@@ -754,7 +754,7 @@ STATIC void EXTI_Handler(uint port) {
uint32_t bits = MAP_GPIOIntStatus(port, true);
MAP_GPIOIntClear(port, bits);
- // might be that we have more than one Pin interrupt triggered at the same time
+ // might be that we have more than one Pin interrupt pending
// therefore we must loop through all of the 8 possible bits
for (int i = 0; i < 8; i++) {
uint32_t bit = (1 << i);
diff --git a/cc3200/mpconfigport.h b/cc3200/mpconfigport.h
index c585b3e382..5e1c61c056 100644
--- a/cc3200/mpconfigport.h
+++ b/cc3200/mpconfigport.h
@@ -183,6 +183,7 @@ void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len);
#define MICROPY_HAL_H "cc3200_hal.h"
#define MICROPY_PORT_HAS_TELNET (1)
#define MICROPY_PORT_HAS_FTP (1)
+#define MICROPY_PORT_WLAN_URN (0)
#define MICROPY_PY_SYS_PLATFORM "WiPy"
#define MICROPY_PORT_WLAN_AP_SSID "wipy-wlan"