diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-10-30 23:03:58 +0000 |
|---|---|---|
| committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-31 19:14:30 +0300 |
| commit | 731f359292c0e2630873df1a19c5baac7287024f (patch) | |
| tree | 3aef09fd15b82baa9fff7c72fe3bc7e05a869614 /minimal | |
| parent | 0bd3f3291d3ea0252a91653a1edcbfa83d524834 (diff) | |
all: Add py/mphal.h and use it in all ports.
py/mphal.h contains declarations for generic mp_hal_XXX functions, such
as stdio and delay/ticks, which ports should provide definitions for. A
port will also provide mphalport.h with further HAL declarations.
Diffstat (limited to 'minimal')
| -rw-r--r-- | minimal/mpconfigport.h | 9 | ||||
| -rw-r--r-- | minimal/mphalport.h | 2 | ||||
| -rw-r--r-- | minimal/uart_extra.c | 1 |
3 files changed, 3 insertions, 9 deletions
diff --git a/minimal/mpconfigport.h b/minimal/mpconfigport.h index c585593f1..caa31d3bd 100644 --- a/minimal/mpconfigport.h +++ b/minimal/mpconfigport.h @@ -65,7 +65,6 @@ typedef void *machine_ptr_t; // must be of pointer size typedef const void *machine_const_ptr_t; // must be of pointer size typedef long mp_off_t; -void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len); #define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len) // extra built in names to add to the global namespace @@ -76,14 +75,6 @@ extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj; // We need to provide a declaration/definition of alloca() #include <alloca.h> -#define mp_hal_ticks_ms() 0 -int mp_hal_stdin_rx_chr(void); -void mp_hal_stdout_tx_str(const char *str); -void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len); -void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len); - -static inline void mp_hal_set_interrupt_char(char c) {} - #define MICROPY_HW_BOARD_NAME "minimal" #define MICROPY_HW_MCU_NAME "unknown-cpu" diff --git a/minimal/mphalport.h b/minimal/mphalport.h new file mode 100644 index 000000000..60d68bd2d --- /dev/null +++ b/minimal/mphalport.h @@ -0,0 +1,2 @@ +static inline mp_uint_t mp_hal_ticks_ms(void) { return 0; } +static inline void mp_hal_set_interrupt_char(char c) {} diff --git a/minimal/uart_extra.c b/minimal/uart_extra.c index e266904be..1c3fc2e03 100644 --- a/minimal/uart_extra.c +++ b/minimal/uart_extra.c @@ -1,6 +1,7 @@ #include <string.h> #include <unistd.h> #include "py/mpconfig.h" +#include "py/mphal.h" /* * Extra UART functions |
