Skip to content

Commit 92f1ed8

Browse files
committed
stmhal: Enable uhashlib module; add heapq, hashlib weak links.
hashlib test passes on pyboard.
1 parent df732bb commit 92f1ed8

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

stmhal/memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// this is needed for extmod/crypto-algorithms/sha256.c
2+
#include <string.h>

stmhal/mpconfigport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#define MICROPY_PY_UJSON (1)
6464
#define MICROPY_PY_URE (1)
6565
#define MICROPY_PY_UHEAPQ (1)
66+
#define MICROPY_PY_UHASHLIB (1)
6667

6768
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
6869
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
@@ -82,6 +83,8 @@ extern const struct _mp_obj_module_t stm_module;
8283
extern const struct _mp_obj_module_t mp_module_ure;
8384
extern const struct _mp_obj_module_t mp_module_uzlib;
8485
extern const struct _mp_obj_module_t mp_module_ujson;
86+
extern const struct _mp_obj_module_t mp_module_uheapq;
87+
extern const struct _mp_obj_module_t mp_module_uhashlib;
8588
extern const struct _mp_obj_module_t mp_module_uos;
8689
extern const struct _mp_obj_module_t mp_module_utime;
8790
extern const struct _mp_obj_module_t mp_module_uselect;
@@ -101,6 +104,8 @@ extern const struct _mp_obj_module_t mp_module_network;
101104
{ MP_OBJ_NEW_QSTR(MP_QSTR_re), (mp_obj_t)&mp_module_ure }, \
102105
{ MP_OBJ_NEW_QSTR(MP_QSTR_zlib), (mp_obj_t)&mp_module_uzlib }, \
103106
{ MP_OBJ_NEW_QSTR(MP_QSTR_json), (mp_obj_t)&mp_module_ujson }, \
107+
{ MP_OBJ_NEW_QSTR(MP_QSTR_heapq), (mp_obj_t)&mp_module_uheapq }, \
108+
{ MP_OBJ_NEW_QSTR(MP_QSTR_hashlib), (mp_obj_t)&mp_module_uhashlib }, \
104109
{ MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&mp_module_uos }, \
105110
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_utime }, \
106111
{ MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_module_uselect }, \

stmhal/qstrdefsport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Q(elapsed_micros)
7676
Q(re)
7777
Q(zlib)
7878
Q(json)
79+
Q(heapq)
80+
Q(hashlib)
7981

8082
// for file class
8183
Q(seek)

0 commit comments

Comments
 (0)