diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/mphal.h | 61 | ||||
-rw-r--r-- | py/mpprint.c | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/py/mphal.h b/py/mphal.h new file mode 100644 index 0000000000..a0b642fc98 --- /dev/null +++ b/py/mphal.h @@ -0,0 +1,61 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef __MICROPY_INCLUDED_PY_MPHAL_H__ +#define __MICROPY_INCLUDED_PY_MPHAL_H__ + +#include "py/mpconfig.h" + +#ifdef MICROPY_MPHALPORT_H +#include MICROPY_MPHALPORT_H +#else +#include <mphalport.h> +#endif + +#ifndef mp_hal_stdin_rx_chr +int mp_hal_stdin_rx_chr(void); +#endif + +#ifndef mp_hal_stdout_tx_str +void mp_hal_stdout_tx_str(const char *str); +#endif + +#ifndef mp_hal_stdout_tx_strn +void mp_hal_stdout_tx_strn(const char *str, size_t len); +#endif + +#ifndef mp_hal_stdout_tx_strn_cooked +void mp_hal_stdout_tx_strn_cooked(const char *str, size_t len); +#endif + +#ifndef mp_hal_delay_ms +void mp_hal_delay_ms(mp_uint_t ms); +#endif + +#ifndef mp_hal_ticks_ms +mp_uint_t mp_hal_ticks_ms(void); +#endif + +#endif // __MICROPY_INCLUDED_PY_MPHAL_H__ diff --git a/py/mpprint.c b/py/mpprint.c index 6da6614b7c..0aecf5c56d 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -30,6 +30,7 @@ #include <stdio.h> #include <string.h> +#include "py/mphal.h" #include "py/mpprint.h" #include "py/obj.h" #include "py/objint.h" |