adds RISCV-VP platform
This commit is contained in:
21
env/riscv_vp/bsp_write.c
vendored
Normal file
21
env/riscv_vp/bsp_write.c
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include "platform.h"
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
ssize_t _bsp_write(int fd, const void *ptr, size_t len) {
|
||||
const uint8_t *current = (const uint8_t *)ptr;
|
||||
if (isatty(fd)) {
|
||||
for (size_t jj = 0; jj < len; jj++) {
|
||||
uart_write(uart, current[jj]);
|
||||
if (current[jj] == '\n') {
|
||||
uart_write(uart, '\r');
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
return 1;
|
||||
}
|
Reference in New Issue
Block a user