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 /pic16bit/pic16bit_mphal.c | |
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 'pic16bit/pic16bit_mphal.c')
-rw-r--r-- | pic16bit/pic16bit_mphal.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pic16bit/pic16bit_mphal.c b/pic16bit/pic16bit_mphal.c index dccea7659..557b1e0da 100644 --- a/pic16bit/pic16bit_mphal.c +++ b/pic16bit/pic16bit_mphal.c @@ -25,7 +25,7 @@ */ #include <string.h> -#include "pic16bit_mphal.h" +#include "py/mphal.h" #include "board.h" static int interrupt_char; @@ -34,12 +34,12 @@ void mp_hal_init(void) { MP_STATE_PORT(keyboard_interrupt_obj) = mp_obj_new_exception(&mp_type_KeyboardInterrupt); } -mp_uint_t mp_hal_get_milliseconds(void) { +mp_uint_t mp_hal_ticks_ms(void) { // TODO return 0; } -void mp_hal_milli_delay(mp_uint_t ms) { +void mp_hal_delay_ms(mp_uint_t ms) { // tuned for fixed CPU frequency for (int i = ms; i > 0; i--) { for (volatile int j = 0; j < 5000; j++) { @@ -63,13 +63,13 @@ void mp_hal_stdout_tx_str(const char *str) { mp_hal_stdout_tx_strn(str, strlen(str)); } -void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) { +void mp_hal_stdout_tx_strn(const char *str, size_t len) { for (; len > 0; --len) { uart_tx_char(*str++); } } -void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len) { +void mp_hal_stdout_tx_strn_cooked(const char *str, size_t len) { for (; len > 0; --len) { if (*str == '\n') { uart_tx_char('\r'); |