0 Members and 1 Guest are viewing this topic.
__asm__ volatile("mrs r0, cpsr;" "bic r0, r0, #0x80;" "msr cpsr_c, r0;" ::: "r0");
//---- uart output routines ----static const unsigned SDC_printf_addrs[] = {0x0, 0x0,0x101019AC,0x0}; // OS 3.1 #define SDC_printf SYSCALL_CUSTOM(SDC_printf_addrs ,int, char *fmt, ... )static const unsigned SDC_Put_String_addrs[] = {0x0, 0x0,0x101018E0,0x0}; // OS 3.1 formerly log_rs232#define SDC_Put_String SYSCALL_CUSTOM(SDC_Put_String_addrs ,int, char * )
//---- uart input routines ----static const unsigned SDC_Get_Char_addrs[] = {0x0, 0x0,0x10101838,0x0}; // OS 3.1#define SDC_Get_Char SYSCALL_CUSTOM(SDC_Get_Char_addrs ,void, int * )static const unsigned SDC_Data_Ready_addrs[] = {0x0, 0x0,0x101017EC,0x0}; // OS 3.1#define SDC_Data_Ready SYSCALL_CUSTOM(SDC_Data_Ready_addrs ,int, void )
For the uart, it might be better to use the Nucleus SDC_* API directly than using the standard library.
Try using SDC_printf() or SDC_Put_String() [formerly called log_rs232]SDC_Put_String has been tested , SDC_printf untested
The program goes resident after hooking into the Battmon task{That frequently updates the battery icon on the screen} .
#define fputs(s,f) irq_fputs(s,f)inline void irq_fputs(char *s, FILE *f){ fputs(s, f); __asm__ volatile("mrs r0, cpsr;" "bic r0, r0, #0x80;" "msr cpsr_c, r0;" ::: "r0");}