Using write() for output for better portability

This commit is contained in:
2024-07-16 14:12:15 +02:00
parent 716fdd7fa0
commit 02a7d525be
7 changed files with 84 additions and 27 deletions

15
bsp_z7/newlib/write.c Normal file
View File

@ -0,0 +1,15 @@
#include "xil_printf.h"
#include "xparameters.h"
int write(int file, char *ptr, int len) {
if (ptr == NULL) {
return 0;
}
// TODO file descriptors
int todo;
for (todo = 0; todo < len; todo++) {
outbyte(*ptr++);
}
return len;
}