bsp,abstract-machine,uart: add preset command in _uart_getc()

* but it is not parsed
This commit is contained in:
Zihao Yu 2023-05-24 14:50:38 +08:00
parent e5eb90efca
commit 7e91ba791e
2 changed files with 4 additions and 3 deletions

View file

@ -1,9 +1,10 @@
#include <klib.h> #include <klib.h>
#include <rtthread.h>
char *strchr(const char *s, int c) { char *strchr(const char *s, int c) {
assert(0); assert(0);
} }
char *strstr(const char *haystack, const char *needle) { char *strstr(const char *haystack, const char *needle) {
assert(0); return rt_strstr(haystack, needle);
} }

View file

@ -37,8 +37,8 @@ static int _uart_putc(struct rt_serial_device *serial, char c) {
} }
static int _uart_getc(struct rt_serial_device *serial) { static int _uart_getc(struct rt_serial_device *serial) {
assert(0); static const char *p = "help\n";
return -1; return (*p != '\0' ? *(p ++) : -1);
} }
const struct rt_uart_ops _uart_ops = { const struct rt_uart_ops _uart_ops = {