Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
ac3fb974
Commit
ac3fb974
authored
Jun 02, 2022
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix/variants: Enable seeding random module on import in dev, coverage.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
d2f018bf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
ports/unix/mpconfigport.h
ports/unix/mpconfigport.h
+11
-0
ports/unix/variants/coverage/mpconfigvariant.h
ports/unix/variants/coverage/mpconfigvariant.h
+1
-1
ports/unix/variants/dev/mpconfigvariant.h
ports/unix/variants/dev/mpconfigvariant.h
+1
-1
No files found.
ports/unix/mpconfigport.h
View file @
ac3fb974
...
...
@@ -253,6 +253,17 @@ void mp_unix_mark_exec(void);
#define MICROPY_FORCE_PLAT_ALLOC_EXEC (1)
#endif
#ifdef MICROPY_PY_URANDOM_SEED_INIT_FUNC
// Support for seeding the random module on import.
#include <stddef.h>
void
mp_hal_get_random
(
size_t
n
,
void
*
buf
);
static
inline
unsigned
long
mp_urandom_seed_init
(
void
)
{
unsigned
long
r
;
mp_hal_get_random
(
sizeof
(
r
),
&
r
);
return
r
;
}
#endif
#ifdef __linux__
// Can access physical memory using /dev/mem
#define MICROPY_PLAT_DEV_MEM (1)
...
...
ports/unix/variants/coverage/mpconfigvariant.h
View file @
ac3fb974
...
...
@@ -31,7 +31,6 @@
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
// Disable some features that come enabled by default with the feature level.
#define MICROPY_MODULE_BUILTIN_INIT (0)
#define MICROPY_PY_BUILTINS_EXECFILE (0)
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
#define MICROPY_PY_USELECT (0)
...
...
@@ -50,6 +49,7 @@
#define MICROPY_PY_SYS_GETSIZEOF (1)
#define MICROPY_PY_SYS_TRACEBACKLIMIT (1)
#define MICROPY_PY_IO_BUFFEREDWRITER (1)
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_urandom_seed_init())
#define MICROPY_PY_URE_DEBUG (1)
#define MICROPY_PY_URE_MATCH_GROUPS (1)
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
...
...
ports/unix/variants/dev/mpconfigvariant.h
View file @
ac3fb974
...
...
@@ -28,7 +28,6 @@
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
// Disable some features that come enabled by default with the feature level.
#define MICROPY_MODULE_BUILTIN_INIT (0)
#define MICROPY_PY_BUILTINS_EXECFILE (0)
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
#define MICROPY_PY_USELECT (0)
...
...
@@ -37,3 +36,4 @@
#define MICROPY_REPL_EMACS_WORDS_MOVE (1)
#define MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE (1)
#define MICROPY_PY_SYS_SETTRACE (1)
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (mp_urandom_seed_init())
Write
Preview
Markdown
is supported
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