/*! \param s the string only the first 5 characters will be displayed. if there are less than 5 characters, the remaining display positions will be cleared. */ void cputs(char *s) { int i; cputc_native(0, 5); for (i = 4; (*s) && (i >= 0);) cputc(*(s++), i--); while (i >= 1) cputc_native(0, i--); #if !defined(CONF_LCD_REFRESH) lcd_refresh(); #endif }
/*! \param s the string Only the first 5 characters will be displayed, unless the first character is '-', in which case an additional character will be displayed. If there are fewer characters than display positions, the remaining "user" display positions will be cleared. */ void cputs(const char *s) { int i; // Determine if the first character is a dash if ('-' == (*s)) { cputc(*(s++), 5); } else { cputc_native(0, 5); } for (i = 4; (*s) && (i >= 0);) cputc(*(s++), i--); while (i >= 1) cputc_native(0, i--); #if !defined(CONF_LCD_REFRESH) lcd_refresh(); #endif }
//! clear user portion of screen void cls() { #ifdef CONF_ASCII cputs(""); #else unsigned char i = 0; for (i = 5; i >= 1; i--) { cputc_native(0, i); } #endif // reset the program number display show_program_num(); }
/*! \param word the hexword position 0 is unaffected by this call. */ void cputw(unsigned word) { int i; cputc_native(0, 5); for (i = 1; i <= 4; i++) { cputc_hex(word & 0x0f, i); word >>= 4; } #if !defined(CONF_LCD_REFRESH) lcd_refresh(); #endif }