comparison main.c @ 26:d3e5934fe55c

- Move crc16 to utils and fix it - Fix main.c crc calculation
author Matt Johnston <matt@ucc.asn.au>
date Thu, 07 Jun 2012 20:26:50 +0800
parents 2943f62c8e62
children dbbd503119ba
comparison
equal deleted inserted replaced
25:2943f62c8e62 26:d3e5934fe55c
202 } 202 }
203 loop_until_bit_is_set(UCSR0A, UDRE0); 203 loop_until_bit_is_set(UCSR0A, UDRE0);
204 UDR0 = c; 204 UDR0 = c;
205 if (stream == crc_stdout) 205 if (stream == crc_stdout)
206 { 206 {
207 crc_out = _crc_ccitt_update(crc_out, '\n'); 207 crc_out = _crc_ccitt_update(crc_out, c);
208 } 208 }
209 if (c == '\r') 209 if (c == '\r')
210 { 210 {
211 loop_until_bit_is_set(UCSR0A, UDRE0); 211 loop_until_bit_is_set(UCSR0A, UDRE0);
212 UDR0 = '\n'; 212 UDR0 = '\n';