void putS(char *str) { int i = 0; while (str[i]) { putC(str[i++]); } }
void dump_config(const T_DDR_CONFIG_PARAMETERS * data) { int i; for(i=0; i < sizeof(config_strings)/sizeof(config_strings[0]) ; i++){ putText(config_strings[i], 40); putText(": ",20); putHex(*(((unsigned int *) data) +i)); putC('\n'); } }
void putI(int k) { int s[10]; int sPos = 0; div_t out; if (k < 0) { putC('-'); k = -k; } do{ out = div(k, 10); s[sPos++] = out.rem; k = out.quot; } while( k != 0); for (; sPos > 0; ) { putC('0' + s[--sPos]); } }
void dump_timing(const T_DDR_TIMING_PARAMETERS * data) { int i; unsigned int *val = (unsigned int *) data; for(i=0; i < sizeof(Timing_strings)/sizeof(Timing_strings[0]) ; i++, ++val){ putText(Timing_strings[i], 40); putText(": ",20); putHex(*val); putC('\n'); } }
// Standard putchar void putchar(char c) { if (c == '\r') { backSpace(); } else if (c == '\n') { newLine(); } else if (c == 0x0f || c == '\t') { if (getCursorX() % 4 == 0) { int i = 0; for (i = 0; i < 4; ++i) { putChar(c); putC(' '); } } else while (getCursorX() % 4 != 0) { putChar(c); putC(' '); } } else if (c != 0) { putChar(c); putC(c); } }
void video_reload() { int x, y; int old_x = getCursorX(); int old_y = getCursorY(); setCursor(FALSE); for(x = 0; x < current_video_mode->width; ++x) { for(y = 0; y < current_video_mode->height; ++y) { setCursorX(x); setCursorY(y); putC(current_video_mode->screen[x][y]); } } setCursor(TRUE); setCursorX(old_x); setCursorY(old_y); }
// Standard putchar void putchar(char c) { putC(c); }
void putS(char *string){ while(*string != '\0'){ // Send Each Char Individualy putC(*string); string++; } }
void sub_putH(unsigned char byte) { if (byte > 9) putC(byte + ('A'-10)); else putC(byte + '0'); }
// Interrupt Handler (UART) void _int_(_UART1_VECTOR) isr_uart1(void){ if(IFS0bits.U1RXIF){ putC(U1RXREG); IFS0bits.U1RXIF = 0; // Clear Receive Interrupt Flag } }