This repository was archived by the owner on Sep 6, 2023. It is now read-only.
File tree 5 files changed +14
-0
lines changed
5 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ const mp_obj_module_t mp_module___main__ = {
42
42
};
43
43
44
44
void mp_init (void ) {
45
+ // call port specific initialization if any
46
+ #ifdef MICROPY_PORT_INIT_FUNC
47
+ MICROPY_PORT_INIT_FUNC ;
48
+ #endif
49
+
45
50
mp_emit_glue_init ();
46
51
47
52
// init global module stuff
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ SRC_C = \
31
31
unix/main.c \
32
32
unix/file.c \
33
33
realpath.c \
34
+ init.c \
34
35
35
36
OBJ = $(PY_O ) $(addprefix $(BUILD ) /, $(SRC_C:.c=.o ) )
36
37
Original file line number Diff line number Diff line change
1
+ #include <stdlib.h>
2
+
3
+ void init () {
4
+ putenv ("PRINTF_EXPONENT_DIGITS=2" );
5
+ }
Original file line number Diff line number Diff line change
1
+ void init (void );
Original file line number Diff line number Diff line change 15
15
#define MICROPY_MOD_SYS_STDFILES (1)
16
16
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
17
17
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
18
+ #define MICROPY_PORT_INIT_FUNC init()
18
19
19
20
// type definitions for the specific machine
20
21
@@ -38,3 +39,4 @@ extern const struct _mp_obj_fun_native_t mp_builtin_open_obj;
38
39
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
39
40
40
41
#include "realpath.h"
42
+ #include "init.h"
You can’t perform that action at this time.
0 commit comments