--- a/blackbox/main.c Tue Jun 25 23:52:29 2013 +0200 +++ b/blackbox/main.c Wed Jun 26 11:11:04 2013 +0200 @@ -172,23 +172,6 @@ if (status == 7) slot[car].canrefuel = 0; } - /* Old ASCII Format: - RS232_puts("RW:"); - RS232_putc(car + '0'); - RS232_putc(':'); - RS232_putc(type + '0'); - RS232_putc(':'); - itoa(sender, s, 16); - RS232_puts(s); - RS232_putc(':'); - itoa(status, s, 16); - RS232_puts(s); - RS232_putc(':'); - ultoa(sysclk.value, s, 16); - RS232_puts(s); - RS232_putc('\n'); - */ - // New binary protocol: TODO: compress sender & status, car & type RS232_puts("RW:\n"); RS232_putc(8); // 8 binary bytes following @@ -578,8 +561,9 @@ slot[car0-1].laps++; laps.value = slot[car0-1].laps; // New binary protocol: - RS232_puts("L:3:\n"); // 3 = BB - RS232_putc(11); // binary bytes following + RS232_puts("L:\n"); + RS232_putc(12); // binary bytes following + RS232_putc(3); // 3 = Track BB RS232_putc(laps.byte[1]); RS232_putc(laps.byte[0]); RS232_putc(car0_state); // slot number @@ -609,8 +593,9 @@ slot[car1-1].laps++; laps.value = slot[car1-1].laps; // New binary protocol: - RS232_puts("L:1:\n"); // 1 = AA - RS232_putc(11); // binary bytes following + RS232_puts("L:\n"); + RS232_putc(12); // binary bytes following + RS232_putc(1); // 1 = Track AA RS232_putc(laps.byte[1]); RS232_putc(laps.byte[0]); RS232_putc(car1_state); // slot number