Changed modulo and division operations on 256 to bit shift using include/bytes.h macro to improve code size on architectures that don't do division natively.

This commit is contained in:
skarg
2009-08-20 14:38:25 +00:00
parent e513ffa412
commit 4b422d6c1c
7 changed files with 20 additions and 14 deletions
+2 -2
View File
@@ -178,9 +178,9 @@ unsigned MSTP_Create_Frame(
crc8 = CRC_Calc_Header(buffer[3], crc8);
buffer[4] = source;
crc8 = CRC_Calc_Header(buffer[4], crc8);
buffer[5] = data_len / 256;
buffer[5] = HI_BYTE(data_len);
crc8 = CRC_Calc_Header(buffer[5], crc8);
buffer[6] = data_len % 256;
buffer[6] = LO_BYTE(data_len);
crc8 = CRC_Calc_Header(buffer[6], crc8);
buffer[7] = ~crc8;