Skip to content

Commit 641a3d3

Browse files
author
Daniel Campora
committed
cc3200: Make sure to update sleep objects when registered.
1 parent 6ff2d54 commit 641a3d3

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

cc3200/mods/pybsleep.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "sleeprestore.h"
5656
#include "serverstask.h"
5757
#include "antenna.h"
58+
#include "cryptohash.h"
5859

5960
/******************************************************************************
6061
DECLARE PRIVATE CONSTANTS
@@ -211,10 +212,9 @@ void pybsleep_add (const mp_obj_t obj, WakeUpCB_t wakeup) {
211212
sleep_obj->base.type = &pybsleep_type;
212213
sleep_obj->obj = obj;
213214
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);
218218
}
219219

220220
void pybsleep_remove (const mp_obj_t obj) {
@@ -412,6 +412,9 @@ void pybsleep_suspend_exit (void) {
412412
// reconfigure all the previously enabled interrupts
413413
mpcallback_wake_all();
414414

415+
// we need to init the crypto hash engine again
416+
CRYPTOHASH_Init();
417+
415418
// trigger a sw interrupt
416419
MAP_IntPendSet(INT_PRCM);
417420

@@ -460,7 +463,6 @@ STATIC void pybsleep_iopark (bool hibernate) {
460463
mp_map_t *named_map = mp_obj_dict_get_map((mp_obj_t)&pin_cpu_pins_locals_dict);
461464
for (uint i = 0; i < named_map->used; i++) {
462465
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
464466
switch (pin->pin_num) {
465467
#ifdef DEBUG
466468
// skip the JTAG pins

cc3200/util/cryptohash.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
/******************************************************************************
4242
DEFINE PUBLIC FUNCTIONS
4343
******************************************************************************/
44-
__attribute__ ((section (".boot")))
4544
void CRYPTOHASH_Init (void) {
4645
// Enable the Data Hashing and Transform Engine
4746
MAP_PRCMPeripheralClkEnable(PRCM_DTHE, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK);

0 commit comments

Comments
 (0)