further semihosting support
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../../include/tgc-vp/devices/uart.h"
|
||||
#include "../../env/tgc-vp/platform.h"
|
||||
#include "platform.h"
|
||||
#include "stub.h"
|
||||
#include "weak_under_alias.h"
|
||||
@@ -12,11 +14,19 @@
|
||||
|
||||
ssize_t __wrap_write(int fd, const void* ptr, size_t len)
|
||||
{
|
||||
const uint8_t * current = (const uint8_t *)ptr;
|
||||
const uint8_t * current = (const uint8_t *)ptr;
|
||||
#if defined(SEMIHOSTING)
|
||||
sh_write(current, fd);
|
||||
return len;
|
||||
#endif
|
||||
if(isatty(fd)) {
|
||||
for (size_t jj = 0; jj < len; jj++) {
|
||||
sh_writec(current[jj]);
|
||||
}
|
||||
return len;
|
||||
} else {
|
||||
sh_write(current, fd);
|
||||
return len;
|
||||
}
|
||||
//return len;
|
||||
#endif
|
||||
if (isatty(fd)) {
|
||||
for (size_t jj = 0; jj < len; jj++) {
|
||||
#if defined(BOARD_ehrenberg)
|
||||
|
Reference in New Issue
Block a user