|
57 | 57 | #define PYBRICKS_OPT_EXTRA_LEVEL2 (1) |
58 | 58 | #define PYBRICKS_OPT_CUSTOM_IMPORT (1) |
59 | 59 | #define PYBRICKS_OPT_NATIVE_MOD (1) |
60 | | -// Start with config shared by all Pybricks ports. |
61 | | -#include "../_common/mpconfigport.h" |
62 | | - |
63 | | -// Reduced from 256 for better raw paste stability. |
64 | | -// FIXME: USB driver limitation -- should allow higher. |
65 | | -#define MICROPY_REPL_STDIN_BUFFER_MAX (64) |
66 | | - |
67 | | -#define MICROPY_MPHALPORT_H "../_common/mphalport.h" |
68 | | - |
69 | | -// type definitions for the specific machine |
70 | | - |
71 | | -#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1)) |
72 | | - |
73 | | -// This port is intended to be 32-bit, but unfortunately, int32_t for |
74 | | -// different targets may be defined in different ways - either as int |
75 | | -// or as long. This requires different printf formatting specifiers |
76 | | -// to print such value. So, we avoid int32_t and use int directly. |
77 | | -#define UINT_FMT "%u" |
78 | | -#define INT_FMT "%d" |
79 | | -typedef int mp_int_t; // must be pointer size |
80 | | -typedef unsigned mp_uint_t; // must be pointer size |
81 | | - |
82 | | -typedef long mp_off_t; |
83 | 60 |
|
84 | | -#include "pbio_os_config.h" |
85 | | - |
86 | | -#define MICROPY_BEGIN_ATOMIC_SECTION() pbio_os_hook_disable_irq() |
87 | | -#define MICROPY_END_ATOMIC_SECTION(state) pbio_os_hook_enable_irq(state) |
88 | | - |
89 | | -#define MICROPY_VM_HOOK_LOOP \ |
90 | | - do { \ |
91 | | - extern bool pbio_os_run_processes_once(void); \ |
92 | | - pbio_os_run_processes_once(); \ |
93 | | - } while (0); |
94 | | - |
95 | | -#define MICROPY_GC_HOOK_LOOP(i) do { \ |
96 | | - if (((i) & 0xf) == 0) { \ |
97 | | - MICROPY_VM_HOOK_LOOP \ |
98 | | - } \ |
99 | | -} while (0) |
100 | | - |
101 | | -#define MICROPY_EVENT_POLL_HOOK \ |
102 | | - do { \ |
103 | | - extern void pb_event_poll_hook(void); \ |
104 | | - pb_event_poll_hook(); \ |
105 | | - } while (0); |
106 | | - |
107 | | -// We need to provide a declaration/definition of alloca() |
108 | | -#include <alloca.h> |
109 | | - |
110 | | -#define MP_STATE_PORT MP_STATE_VM |
| 61 | +#include "../_common/mpconfigport.h" |
0 commit comments