Browse Source

cc3200: Disable WLAN.urn() by default.

Can be enabled by defining MICROPY_PORT_WLAN_URN=1 in mpconfigport.h.
pull/1266/merge
Daniel Campora 10 years ago
parent
commit
cd3f2523f1
  1. 6
      cc3200/mods/modwlan.c
  2. 2
      cc3200/mods/pybpin.c
  3. 1
      cc3200/mpconfigport.h

6
cc3200/mods/modwlan.c

@ -124,7 +124,7 @@ typedef struct _wlan_obj_t {
#define MODWLAN_TIMEOUT_MS 5000 #define MODWLAN_TIMEOUT_MS 5000
#define MODWLAN_MAX_NETWORKS 20 #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 MODWLAN_WAIT_FOR_SCAN_MS 1050
#define ASSERT_ON_ERROR( x ) ASSERT((x) >= 0 ) #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); 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) { STATIC mp_obj_t wlan_urn (uint n_args, const mp_obj_t *args) {
char urn[MAX_DEVICE_URN_LEN]; char urn[MAX_DEVICE_URN_LEN];
uint8_t len = 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; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_urn_obj, 1, 2, wlan_urn); STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_urn_obj, 1, 2, wlan_urn);
#endif
/// \method wlan_netlist() /// \method wlan_netlist()
/// Return a list of tuples with all the acces points within range /// 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_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_isconnected), (mp_obj_t)&wlan_isconnected_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ifconfig), (mp_obj_t)&wlan_ifconfig_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 }, { 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_callback), (mp_obj_t)&wlan_callback_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_config_ip), (mp_obj_t)&wlan_config_ip_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_config_ip), (mp_obj_t)&wlan_config_ip_obj },

2
cc3200/mods/pybpin.c

@ -754,7 +754,7 @@ STATIC void EXTI_Handler(uint port) {
uint32_t bits = MAP_GPIOIntStatus(port, true); uint32_t bits = MAP_GPIOIntStatus(port, true);
MAP_GPIOIntClear(port, bits); 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 // therefore we must loop through all of the 8 possible bits
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
uint32_t bit = (1 << i); uint32_t bit = (1 << i);

1
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_HAL_H "cc3200_hal.h"
#define MICROPY_PORT_HAS_TELNET (1) #define MICROPY_PORT_HAS_TELNET (1)
#define MICROPY_PORT_HAS_FTP (1) #define MICROPY_PORT_HAS_FTP (1)
#define MICROPY_PORT_WLAN_URN (0)
#define MICROPY_PY_SYS_PLATFORM "WiPy" #define MICROPY_PY_SYS_PLATFORM "WiPy"
#define MICROPY_PORT_WLAN_AP_SSID "wipy-wlan" #define MICROPY_PORT_WLAN_AP_SSID "wipy-wlan"

Loading…
Cancel
Save