Another attempt to fix the MtxOrb weirdness. Changed the general-purpose

output so it doesn't send anything unless something actually happened.
This commit is contained in:
toykeeper
2000-05-25 18:21:22 +00:00
parent e5d1a9d431
commit 0c07dacfea
2 changed files with 6 additions and 5 deletions
+2
View File
@@ -879,6 +879,8 @@ output_func (client * c, int argc, char **argv)
} else { } else {
if (0 == strcmp (argv[1], "on")) if (0 == strcmp (argv[1], "on"))
output_state = 1; output_state = 1;
else if (0 == strcmp (argv[1], "off"))
output_state = -1;
else else
output_state = 0; output_state = 0;
} }
+4 -5
View File
@@ -304,10 +304,10 @@ void
MtxOrb_output (int on) MtxOrb_output (int on)
{ {
char out[4]; char out[4];
if (on) { if (on > 0) {
sprintf (out, "%cW", 254); sprintf (out, "%cW", 254);
write (fd, out, 2); write (fd, out, 2);
} else { } else if (on < 0) {
sprintf (out, "%cV", 254); sprintf (out, "%cV", 254);
write (fd, out, 2); write (fd, out, 2);
} }
@@ -573,17 +573,16 @@ MtxOrb_draw_frame (char *dat)
if (!dat) if (!dat)
return; return;
/*
sprintf(out, "%cG%c%c", 254, 1, 1); sprintf(out, "%cG%c%c", 254, 1, 1);
write(fd, out, 4); write(fd, out, 4);
write(fd, dat, lcd.wid*lcd.hgt); write(fd, dat, lcd.wid*lcd.hgt);
/* */
for (i = 0; i < lcd.hgt; i++) { for (i = 0; i < lcd.hgt; i++) {
sprintf (out, "%cG%c%c", 254, 1, i + 1); sprintf (out, "%cG%c%c", 254, 1, i + 1);
write (fd, out, 4); write (fd, out, 4);
write (fd, dat + (lcd.wid * i), lcd.wid); write (fd, dat + (lcd.wid * i), lcd.wid);
} }
*/
} }
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////