better naming of term API

This commit is contained in:
Babz 2021-09-09 22:09:33 +02:00
parent 3870de0624
commit b34f272588
3 changed files with 8 additions and 5 deletions

View File

@ -77,8 +77,8 @@ int main(int isappli, int optnum) {
int off_state = 0;
uint16_t backlight_save;
term_append(LOREM_IPSUM);
term_append("-----------------------------------------------------------------");
term_print(LOREM_IPSUM);
term_print("-----------------------------------------------------------------");
term_printf("isappli=%d optnum=%d\n", isappli, optnum);
set_statusbar(tick_ctr, shift_state, alpha_state, get_battery_voltage());

View File

@ -117,7 +117,7 @@ void term_scroll_down(void) {
}
}
void term_append(const char *str) {
int term_print(const char *str) {
static int row = 1;
static int col = 0;
@ -138,6 +138,8 @@ void term_append(const char *str) {
i += tgrid_sets(&row, &col, C_WHITE, C_BLACK, str + i);
}
return i;
}
int term_printf(const char *restrict format, ...) {
@ -146,7 +148,7 @@ int term_printf(const char *restrict format, ...) {
char buf[1024];
const int n = vsprintf(buf, format, argp);
term_append(buf);
term_print(buf);
va_end(argp);
return n;

View File

@ -9,7 +9,8 @@ void tgrid_display(void);
int term_writeat(int row, int col, int fg, int bg, const char *s);
void term_scroll_down(void);
void term_append(const char *str);
int term_print(const char *str);
int term_printf(const char *restrict format, ...);
#endif // #ifndef UNS_TERM_H