File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 62
62
63
63
SRC_C = \
64
64
main.c \
65
- uart_core .c \
65
+ stdio_core .c \
66
66
lib/utils/stdout_helpers.c \
67
67
lib/utils/pyexec.c \
68
68
lib/mp-readline/readline.c \
Original file line number Diff line number Diff line change
1
+ #include <unistd.h>
2
+ #include "stdio.h"
3
+ #include "py/mpconfig.h"
4
+
5
+ /*
6
+ * Core UART functions to implement for a port
7
+ */
8
+
9
+ #if MICROPY_MIN_USE_STM32_MCU
10
+ typedef struct {
11
+ volatile uint32_t SR ;
12
+ volatile uint32_t DR ;
13
+ } periph_uart_t ;
14
+ #define USART1 ((periph_uart_t*)0x40011000)
15
+ #endif
16
+
17
+ // Receive single character
18
+ int mp_hal_stdin_rx_chr (void ) {
19
+ unsigned char c = 0 ;
20
+ fread (& c , 1 , 1 , stdin );
21
+ return c ;
22
+ }
23
+
24
+ // Send string of given length
25
+ void mp_hal_stdout_tx_strn (const char * str , mp_uint_t len ) {
26
+ fwrite (str , len , 1 , stdout );
27
+ }
You can’t perform that action at this time.
0 commit comments