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:
@@ -42,6 +42,7 @@
|
||||
#include "crc.h"
|
||||
#include "npdu.h"
|
||||
#include "bits.h"
|
||||
#include "bytes.h"
|
||||
#include "bacaddr.h"
|
||||
#include "txbuf.h"
|
||||
|
||||
@@ -256,9 +257,9 @@ static void MSTP_Send_Frame(
|
||||
crc8 = CRC_Calc_Header(buffer[3], crc8);
|
||||
buffer[4] = source;
|
||||
crc8 = CRC_Calc_Header(buffer[4], crc8);
|
||||
buffer[5] = pdu_len / 256;
|
||||
buffer[5] = HI_BYTE(pdu_len);
|
||||
crc8 = CRC_Calc_Header(buffer[5], crc8);
|
||||
buffer[6] = pdu_len % 256;
|
||||
buffer[6] = LO_BYTE(pdu_len);
|
||||
crc8 = CRC_Calc_Header(buffer[6], crc8);
|
||||
buffer[7] = ~crc8;
|
||||
if (pdu_len) {
|
||||
|
||||
Reference in New Issue
Block a user