Exemplo n.º 1
0
void serial_send_string(char *s)
{
	while(*s) {
		if (*s == '\n')
			serial_send_char('\r');
		serial_send_char(*s);
		s++;
	}
}
Exemplo n.º 2
0
Arquivo: ui.c Projeto: russells/hc2
static void show_temperature_cal(struct UI *me)
{
	int16_t adjti;
	char s[8];		/* TODO change to s[9] when we get the bigger
				   LCD.  Also change the layout code below. */

	adjti = get_calibrated_ti(me);

	if (LOWTI == adjti) {
		lcd_clear();
		lcd_showstring(lowtistring);
		return;
	}
	if (HIGHTI == adjti) {
		lcd_clear();
		lcd_showstring(hightistring);
		return;
	}
	adjti -= MINTI;
	Q_ASSERT( adjti >= 0 );
	Q_ASSERT( adjti < NCONVERSIONS );

	strcpy(s, tstrings_cal[adjti]);

	Q_ASSERT( me->cal >= MIN_CAL );
	Q_ASSERT( me->cal <= MAX_CAL );

	strcpy(s+4, calstrings[ me->cal - MIN_CAL ]);

	{
		SERIALSTR("cal ");
		serial_send_int(adjti);
		SERIALSTR(":");
		serial_send_int(adjti);
		SERIALSTR(" \"");
		for (uint8_t i = 0; s[i]; i++) {
			serial_send_char(0x7f & s[i]);
			if (0x80 & s[i]) {
				serial_send_char('.');
			}
		}
		SERIALSTR("\"\r\n");
	}


	lcd_clear();
	lcd_showstring(s);
}
Exemplo n.º 3
0
Arquivo: ui.c Projeto: russells/hc2
static void show_at(const struct Time *at)
{
	char buf[8];

	buf[7] = 'a';
	snprintf(buf, 8, "AT %c%c%c%c", at->ht, at->h1, at->mt, at->m1);
	Q_ASSERT( ! buf[7] );
	SERIALSTR("AT(");
	serial_send_int(at->ht);
	serial_send_char(':');
	serial_send_int(at->h1);
	serial_send_char(':');
	serial_send_int(at->mt);
	serial_send_char(':');
	serial_send_int(at->m1);
	SERIALSTR(")");
	lcd_showstring(buf);
}
Exemplo n.º 4
0
static inline void putk(u32 c)
{
	serial_send_char(c);
}