Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
0e96d1b3
Commit
0e96d1b3
authored
Mar 18, 2015
by
danicampora
Browse files
cc3200: Add parameter to wlan_stop() for custom timeout values.
parent
f382f444
Changes
6
Hide whitespace changes
Inline
Side-by-side
cc3200/mods/modpyb.c
View file @
0e96d1b3
...
...
@@ -82,11 +82,8 @@ extern OsiTaskHandle xSimpleLinkSpawnTaskHndl;
/// Resets the pyboard in a manner similar to pushing the external RESET
/// button.
STATIC
mp_obj_t
pyb_hard_reset
(
void
)
{
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// disable wlan services
wlan_stop_servers
();
#endif
wlan_stop
();
// disable wlan
wlan_stop
(
SL_STOP_TIMEOUT_LONG
);
// perform a SoC reset
PRCMSOCReset
();
return
mp_const_none
;
...
...
cc3200/mods/modwlan.c
View file @
0e96d1b3
...
...
@@ -529,7 +529,7 @@ void wlan_update(void) {
}
// call this function to disable the complete WLAN subsystem before a system reset
void
wlan_stop
(
void
)
{
void
wlan_stop
(
uint32_t
timeout
)
{
if
(
wlan_obj
.
mode
>=
0
)
{
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// Stop all other processes using the wlan engine
...
...
@@ -539,7 +539,7 @@ void wlan_stop (void) {
#endif
sl_LockObjLock
(
&
wlan_LockObj
,
SL_OS_WAIT_FOREVER
);
wlan_obj
.
mode
=
-
1
;
sl_Stop
(
SL_STOP_TIMEOUT
);
sl_Stop
(
MAX
(
timeout
,
SL_STOP_TIMEOUT
)
)
;
}
}
...
...
cc3200/mods/modwlan.h
View file @
0e96d1b3
...
...
@@ -33,6 +33,7 @@
#define SIMPLELINK_SPAWN_TASK_PRIORITY 3
#define SIMPLELINK_TASK_STACK_SIZE 2048
#define SL_STOP_TIMEOUT 35
#define SL_STOP_TIMEOUT_LONG 255
/******************************************************************************
DEFINE TYPES
...
...
@@ -56,7 +57,7 @@ extern void wlan_init0 (void);
extern
modwlan_Status_t
wlan_sl_enable
(
SlWlanMode_t
mode
,
const
char
*
ssid
,
uint8_t
ssid_len
,
uint8_t
sec
,
const
char
*
key
,
uint8_t
key_len
,
uint8_t
channel
);
extern
void
wlan_first_start
(
void
);
extern
void
wlan_stop
(
void
);
extern
void
wlan_stop
(
uint32_t
timeout
);
extern
void
wlan_get_mac
(
uint8_t
*
macAddress
);
extern
void
wlan_get_ip
(
uint32_t
*
ip
);
extern
void
wlan_stop_servers
(
void
);
...
...
cc3200/mods/pybpin.c
View file @
0e96d1b3
...
...
@@ -331,12 +331,12 @@ STATIC void pin_extint_enable (mp_obj_t self_in) {
MAP_PRCMHibernateWakeupSourceDisable
(
hib_pin
);
}
}
// if idx is invalid, the
the
pin supports active interrupts for sure
// if idx is invalid, the pin supports active interrupts for sure
if
(
idx
>=
PYBPIN_NUM_WAKE_PINS
||
pybpin_wake_pin
[
idx
].
active
)
{
MAP_GPIOIntClear
(
self
->
port
,
self
->
bit
);
MAP_GPIOIntEnable
(
self
->
port
,
self
->
bit
);
}
// in case i
n
was enabled before
// in case i
t
was enabled before
else
if
(
idx
<
PYBPIN_NUM_WAKE_PINS
&&
!
pybpin_wake_pin
[
idx
].
active
)
{
MAP_GPIOIntDisable
(
self
->
port
,
self
->
bit
);
}
...
...
cc3200/mods/pybsleep.c
View file @
0e96d1b3
...
...
@@ -613,7 +613,7 @@ STATIC mp_obj_t pyb_sleep_hibernate (mp_obj_t self_in) {
return
mp_const_none
;
}
}
wlan_stop
();
wlan_stop
(
SL_STOP_TIMEOUT
);
pybsleep_flash_powerdown
();
MAP_PRCMHibernateEnter
();
return
mp_const_none
;
...
...
cc3200/mptask.c
View file @
0e96d1b3
...
...
@@ -246,9 +246,8 @@ soft_reset_exit:
// wait for all bus transfers to complete
HAL_Delay
(
50
);
// disable wlan services
wlan_stop_servers
();
wlan_stop
();
// disable wlan
wlan_stop
(
SL_STOP_TIMEOUT_LONG
);
// de-initialize the stdio uart
if
(
pyb_stdio_uart
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment