aboutsummaryrefslogtreecommitdiff
path: root/cc3200
diff options
context:
space:
mode:
authordanicampora2015-03-20 13:39:43 +0100
committerdanicampora2015-03-21 11:31:29 +0100
commit59f68313369802a9fe19c5161891075d5163c0f0 (patch)
treef58874f228600da93c12157cc9776431d861e3f7 /cc3200
parent77791b5633bf8ad29eafea4a6a27736367f339ec (diff)
cc3200: Reduce soft reset time. WLAN is not reinit, just reenabled.
Diffstat (limited to 'cc3200')
-rw-r--r--cc3200/mods/modwlan.h2
-rw-r--r--cc3200/mods/pybsleep.c4
-rw-r--r--cc3200/mods/pybsleep.h1
-rw-r--r--cc3200/mptask.c10
4 files changed, 10 insertions, 7 deletions
diff --git a/cc3200/mods/modwlan.h b/cc3200/mods/modwlan.h
index 897c1bfb0..b856c2d65 100644
--- a/cc3200/mods/modwlan.h
+++ b/cc3200/mods/modwlan.h
@@ -33,7 +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 SL_STOP_TIMEOUT_LONG 205
/******************************************************************************
DEFINE TYPES
diff --git a/cc3200/mods/pybsleep.c b/cc3200/mods/pybsleep.c
index b074d539b..d93c09fa4 100644
--- a/cc3200/mods/pybsleep.c
+++ b/cc3200/mods/pybsleep.c
@@ -226,6 +226,10 @@ void pybsleep_configure_timer_wakeup (uint pwrmode) {
pybsleep_wake_cb.timer_wake_pwrmode = pwrmode;
}
+pybsleep_reset_cause_t pybsleep_get_reset_cause (void) {
+ return pybsleep_reset_cause;
+}
+
/******************************************************************************
DEFINE PRIVATE FUNCTIONS
******************************************************************************/
diff --git a/cc3200/mods/pybsleep.h b/cc3200/mods/pybsleep.h
index 783515378..08dc4ce4b 100644
--- a/cc3200/mods/pybsleep.h
+++ b/cc3200/mods/pybsleep.h
@@ -72,5 +72,6 @@ void pybsleep_set_wlan_lpds_callback (mp_obj_t cb_obj);
void pybsleep_set_gpio_lpds_callback (mp_obj_t cb_obj);
void pybsleep_set_timer_lpds_callback (mp_obj_t cb_obj);
void pybsleep_configure_timer_wakeup (uint pwrmode);
+pybsleep_reset_cause_t pybsleep_get_reset_cause (void);
#endif /* PYBSLEEP_H_ */
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index 91ca696d0..2d28df8cc 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -144,15 +144,13 @@ soft_reset:
mperror_enable_heartbeat();
- if (MAP_PRCMSysResetCauseGet() != PRCM_HIB_EXIT) {
- // only if not comming out of hibernate
+ if (pybsleep_get_reset_cause() < PYB_SLP_HIB_RESET) {
+ // only if not comming out of hibernate or a soft reset
mptask_enter_ap_mode();
- // don't check for safeboot when comming out of hibernate
#ifndef DEBUG
safeboot = PRCMIsSafeBootRequested();
#endif
- }
- else {
+ } else {
// when waking up from hibernate we just want
// to enable simplelink and leave it as is
wlan_first_start();
@@ -218,7 +216,7 @@ soft_reset:
// Main script is finished, so now go into REPL mode.
// The REPL mode can change, or it can request a soft reset.
- for (;;) {
+ for ( ; ; ) {
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
if (pyexec_raw_repl() != 0) {
break;