|
|
@@ -31,7 +31,14 @@
|
|
|
|
|
|
extern unsigned char UartPutc(unsigned char my_ch);
|
|
|
extern unsigned char UartGetc(void);
|
|
|
-extern __attribute__((noreturn)) void UartEndSimulation(int code);
|
|
|
+
|
|
|
+__attribute__((noreturn)) void UartEndSimulation(int code)
|
|
|
+{
|
|
|
+ UartPutc((char)0x4); // End of simulation
|
|
|
+ UartPutc((char)code); // Exit code
|
|
|
+ while (1)
|
|
|
+ ;
|
|
|
+}
|
|
|
|
|
|
void exit(int code)
|
|
|
{
|
|
|
@@ -221,13 +228,13 @@ __attribute__((weak)) void(_sys_exit)(int return_code) { exit(return_code); }
|
|
|
Copied from CMSIS/DSP/DSP_Lib_TestSuite/Common/platform/GCC/Retarget.c
|
|
|
*/
|
|
|
|
|
|
-int _open(const char* path, int flags, ...) { return (-1); }
|
|
|
+int _open(const char *path, int flags, ...) { return (-1); }
|
|
|
|
|
|
int _close(int fd) { return (-1); }
|
|
|
|
|
|
int _lseek(int fd, int ptr, int dir) { return (0); }
|
|
|
|
|
|
-int __attribute__((weak)) _fstat(int fd, struct stat* st)
|
|
|
+int __attribute__((weak)) _fstat(int fd, struct stat *st)
|
|
|
{
|
|
|
memset(st, 0, sizeof(*st));
|
|
|
st->st_mode = S_IFCHR;
|
|
|
@@ -236,7 +243,7 @@ int __attribute__((weak)) _fstat(int fd, struct stat* st)
|
|
|
|
|
|
int _isatty(int fd) { return (1); }
|
|
|
|
|
|
-int _read(int fd, char* ptr, int len)
|
|
|
+int _read(int fd, char *ptr, int len)
|
|
|
{
|
|
|
char c;
|
|
|
int i;
|
|
|
@@ -252,7 +259,7 @@ int _read(int fd, char* ptr, int len)
|
|
|
return (len - i);
|
|
|
}
|
|
|
|
|
|
-int _write(int fd, char* ptr, int len)
|
|
|
+int _write(int fd, char *ptr, int len)
|
|
|
{
|
|
|
int i;
|
|
|
|