|
55 | 55 | #include "sleeprestore.h" |
56 | 56 | #include "serverstask.h" |
57 | 57 | #include "antenna.h" |
| 58 | +#include "cryptohash.h" |
58 | 59 |
|
59 | 60 | /****************************************************************************** |
60 | 61 | DECLARE PRIVATE CONSTANTS |
@@ -211,10 +212,9 @@ void pybsleep_add (const mp_obj_t obj, WakeUpCB_t wakeup) { |
211 | 212 | sleep_obj->base.type = &pybsleep_type; |
212 | 213 | sleep_obj->obj = obj; |
213 | 214 | sleep_obj->wakeup = wakeup; |
214 | | - // only add objects once |
215 | | - if (!pybsleep_find(sleep_obj)) { |
216 | | - mp_obj_list_append(&MP_STATE_PORT(pybsleep_obj_list), sleep_obj); |
217 | | - } |
| 215 | + // remove it in case it was already registered |
| 216 | + pybsleep_remove (sleep_obj); |
| 217 | + mp_obj_list_append(&MP_STATE_PORT(pybsleep_obj_list), sleep_obj); |
218 | 218 | } |
219 | 219 |
|
220 | 220 | void pybsleep_remove (const mp_obj_t obj) { |
@@ -412,6 +412,9 @@ void pybsleep_suspend_exit (void) { |
412 | 412 | // reconfigure all the previously enabled interrupts |
413 | 413 | mpcallback_wake_all(); |
414 | 414 |
|
| 415 | + // we need to init the crypto hash engine again |
| 416 | + CRYPTOHASH_Init(); |
| 417 | + |
415 | 418 | // trigger a sw interrupt |
416 | 419 | MAP_IntPendSet(INT_PRCM); |
417 | 420 |
|
@@ -460,7 +463,6 @@ STATIC void pybsleep_iopark (bool hibernate) { |
460 | 463 | mp_map_t *named_map = mp_obj_dict_get_map((mp_obj_t)&pin_cpu_pins_locals_dict); |
461 | 464 | for (uint i = 0; i < named_map->used; i++) { |
462 | 465 | pin_obj_t * pin = (pin_obj_t *)named_map->table[i].value; |
463 | | - // skip the sflash pins since these are shared with the network processor |
464 | 466 | switch (pin->pin_num) { |
465 | 467 | #ifdef DEBUG |
466 | 468 | // skip the JTAG pins |
|
0 commit comments