minimal: Allow to compile without defining MICROPY_HAL_H.

crypto-aes
Damien George 8 years ago
parent ccf45a4283
commit 601c814603
  1. 2
      lib/mp-readline/readline.c
  2. 1
      minimal/main.c
  3. 4
      minimal/mpconfigport.h
  4. 4
      minimal/uart_core.c
  5. 11
      minimal/uart_extra.c
  6. 2
      stmhal/printf.c

@ -30,7 +30,9 @@
#include "py/mpstate.h"
#include "readline.h"
#ifdef MICROPY_HAL_H
#include MICROPY_HAL_H
#endif
#if 0 // print debugging info
#define DEBUG_PRINT (1)

@ -9,7 +9,6 @@
#include "py/pfenv.h"
#include "py/gc.h"
#include "pyexec.h"
#include "pybstdio.h"
void do_str(const char *src) {
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);

@ -65,6 +65,10 @@ extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#include <alloca.h>
#define HAL_GetTick() 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) {}

@ -6,7 +6,7 @@
*/
// Receive single character
int stdin_rx_chr(void) {
int mp_hal_stdin_rx_chr(void) {
unsigned char c = 0;
#if MICROPY_MIN_USE_STDOUT
int r = read(0, &c, 1);
@ -16,7 +16,7 @@ int stdin_rx_chr(void) {
}
// Send string of given length
void stdout_tx_strn(const char *str, mp_uint_t len) {
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
#if MICROPY_MIN_USE_STDOUT
int r = write(1, str, len);
(void)r;

@ -1,7 +1,6 @@
#include <string.h>
#include <unistd.h>
#include "py/mpconfig.h"
#include "pybstdio.h"
/*
* Extra UART functions
@ -11,16 +10,16 @@
// Send "cooked" string of length, where every occurance of
// LF character is replaced with CR LF.
void stdout_tx_strn_cooked(const char *str, mp_uint_t len) {
void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len) {
while (len--) {
if (*str == '\n') {
stdout_tx_strn("\r", 1);
mp_hal_stdout_tx_strn("\r", 1);
}
stdout_tx_strn(str++, 1);
mp_hal_stdout_tx_strn(str++, 1);
}
}
// Send zero-terminated string
void stdout_tx_str(const char *str) {
stdout_tx_strn(str, strlen(str));
void mp_hal_stdout_tx_str(const char *str) {
mp_hal_stdout_tx_strn(str, strlen(str));
}

@ -30,7 +30,9 @@
#include "py/obj.h"
#include "py/pfenv.h"
#ifdef MICROPY_HAL_H
#include MICROPY_HAL_H
#endif
#if MICROPY_PY_BUILTINS_FLOAT
#include "py/formatfloat.h"

Loading…
Cancel
Save