modifies initcode and libwrap for new mnrs/ehrenberg vp
This commit is contained in:
@ -13,7 +13,7 @@ int __wrap_puts(const char *s)
|
||||
{
|
||||
while (*s != '\0') {
|
||||
#if defined(BOARD_ehrenberg)
|
||||
while (uart_get_tx_free(uart)==0) ;
|
||||
while (get_uart_rx_tx_reg_tx_free(uart)==0) ;
|
||||
uart_write(uart, *s);
|
||||
#elif defined(BOARD_iss)
|
||||
*((uint32_t*) 0xFFFF0000) = *s;
|
||||
|
@ -29,7 +29,7 @@ ssize_t __wrap_read(int fd, void* ptr, size_t len)
|
||||
if (isatty(fd)) {
|
||||
#if defined(BOARD_ehrenberg)
|
||||
for (current = (uint8_t *)ptr;
|
||||
(current < ((uint8_t *)ptr) + len) && (uart_get_rx_avail(uart) > 0);
|
||||
(current < ((uint8_t *)ptr) + len) && (get_uart_rx_tx_reg_rx_avail(uart) > 0);
|
||||
current ++) {
|
||||
*current = uart_read(uart);
|
||||
result++;
|
||||
|
@ -8,17 +8,16 @@
|
||||
#include "platform.h"
|
||||
#include "stub.h"
|
||||
#include "weak_under_alias.h"
|
||||
|
||||
ssize_t __wrap_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++) {
|
||||
#if defined(BOARD_ehrenberg)
|
||||
while (uart_get_tx_free(uart)==0) ;
|
||||
while (get_uart_rx_tx_reg_tx_free(uart)==0) ;
|
||||
uart_write(uart, current[jj]);
|
||||
if (current[jj] == '\n') {
|
||||
while (uart_get_tx_free(uart)==0) ;
|
||||
while (get_uart_rx_tx_reg_tx_free(uart)==0) ;
|
||||
uart_write(uart, '\r');
|
||||
}
|
||||
#elif defined(BOARD_iss)
|
||||
|
Reference in New Issue
Block a user