void render_time(uint8_t* data) {
	char time_str[] = "12:34:56";

	time_str[7] = '0' + data[0] % 10;
	time_str[6] = '0' + data[0] / 10;
	time_str[4] = '0' + data[1] % 10;
	time_str[3] = '0' + data[1] / 10;
	time_str[1] = '0' + data[2] % 10;
	time_str[0] = '0' + data[2] / 10;

    halLcdClearScreen();
	halLcdPrintXY(time_str, 40, 45, GRAYSCALE_TEXT | OVERWRITE_TEXT);
	halLcdPrintXY(status_str, 0, 98, GRAYSCALE_TEXT | OVERWRITE_TEXT | INVERT_TEXT);
}
Beispiel #2
0
/*---------------------------------------------------------------------------*/
void
lcd_write_char(char c)
{
  char string[2];

  if(WITH_LCD) {
    if(c == '\n') {
      inc_y();
    } else {
      string[0] = c;
      string[1] = 0;

      if(ypos == Y_MAX) {
	lcd_clear();
	ypos = xpos = 0;
      }

      halLcdPrintXY(string, xpos * X_CHAR_SIZE, ypos * Y_CHAR_SIZE, 0);

      if(xpos == X_MAX) {
	inc_y();
      } else {
	xpos++;
      }
    }
  }
}