#include "os.h" void clear_cache(void) { unsigned dummy; __asm volatile( " .arm \n" "0: mrc p15, 0, r15, c7, c10, 3 @ test and clean DCache \n" " bne 0b \n" " mov %0, #0 \n" " mcr p15, 0, %0, c7, c7, 0 @ invalidate ICache and DCache \n" : "=r" (dummy)); } int hwtype(void) { return 0; // nLaunch is only for Classic Nspire for now } int stat(const char * filename, void * stats) { return _stat(filename, stats); } int feof(FILE * stream __attribute__((unused))) { return 0; } void nio_init(int *a __attribute__((unused)), int b __attribute__((unused)), int c __attribute__((unused)), int d __attribute__((unused)), int e __attribute__((unused)), int f __attribute__((unused)), int g __attribute__((unused)), int h __attribute__((unused))) {} void nio_set_default(int * a __attribute__((unused))) {} int nio_gets(char * a __attribute__((unused))) { return 0; } void nio_free(int * a __attribute__((unused))) {} int uart_puts(const char *str) { print_rs232(str); return 1; } void uart_printf(char *format __attribute__((unused)), ...) {} int nio_puts(const char* str) { if (strlen(str)!=2) { display_msg_to_screen(str, 1, 1); } return 1; } int nio_printf(const char *format, ...) { char buf[1000]; memset(buf,'\0',sizeof(buf)); __builtin_va_list arglist; __builtin_va_start(arglist,format); vsprintf(buf,format,*(char **)&arglist); nio_puts(buf); __builtin_va_end(arglist); return strlen(buf); }