Compiling with CRC tables.
This commit is contained in:
@@ -82,7 +82,12 @@ COMMON = -mmcu=$(MCU)
|
|||||||
OPTIMIZATION = -Os -mcall-prologues
|
OPTIMIZATION = -Os -mcall-prologues
|
||||||
|
|
||||||
## Compile options common for all C compilation units.
|
## Compile options common for all C compilation units.
|
||||||
BFLAGS = -DBACDL_MSTP -DMAX_APDU=50 -DBIG_ENDIAN=0 -DMAX_TSM_TRANSACTIONS=0
|
BFLAGS = -DBACDL_MSTP
|
||||||
|
BFLAGS += -DMAX_APDU=50
|
||||||
|
BFLAGS += -DBIG_ENDIAN=0
|
||||||
|
BFLAGS += -DMAX_TSM_TRANSACTIONS=0
|
||||||
|
#BFLAGS += -DCRC_USE_TABLE
|
||||||
|
BFLAGS += -DTEST_MSTP
|
||||||
CFLAGS = $(COMMON)
|
CFLAGS = $(COMMON)
|
||||||
CFLAGS += -Wall -gdwarf-2 $(BFLAGS) $(OPTIMIZATION) -fsigned-char
|
CFLAGS += -Wall -gdwarf-2 $(BFLAGS) $(OPTIMIZATION) -fsigned-char
|
||||||
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
|
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
|
||||||
@@ -104,8 +109,8 @@ HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
|
|||||||
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
|
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
|
||||||
|
|
||||||
## Objects that must be built in order to link
|
## Objects that must be built in order to link
|
||||||
OBJECTS = $(COBJ) $(DEMOOBJ)
|
#OBJECTS = $(COBJ) $(DEMOOBJ)
|
||||||
#OBJECTS = $(COBJ)
|
OBJECTS = $(COBJ)
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
TARGET_ELF=$(TARGET).elf
|
TARGET_ELF=$(TARGET).elf
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void task_milliseconds(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if defined(TEST_MSTP)
|
||||||
void apdu_handler(BACNET_ADDRESS * src, /* source address */
|
void apdu_handler(BACNET_ADDRESS * src, /* source address */
|
||||||
uint8_t * apdu, /* APDU data */
|
uint8_t * apdu, /* APDU data */
|
||||||
uint16_t pdu_len) /* for confirmed messages */
|
uint16_t pdu_len) /* for confirmed messages */
|
||||||
@@ -117,14 +117,18 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
datalink_init(NULL);
|
datalink_init(NULL);
|
||||||
/* broadcast an I-Am on startup */
|
/* broadcast an I-Am on startup */
|
||||||
|
#if !defined(TEST_MSTP)
|
||||||
iam_send(&Handler_Transmit_Buffer[0]);
|
iam_send(&Handler_Transmit_Buffer[0]);
|
||||||
|
#endif
|
||||||
for (;;) {
|
for (;;) {
|
||||||
task_milliseconds();
|
task_milliseconds();
|
||||||
/* other tasks */
|
/* other tasks */
|
||||||
/* BACnet handling */
|
/* BACnet handling */
|
||||||
pdu_len = datalink_receive(&src, &PDUBuffer[0], sizeof(PDUBuffer), 0);
|
pdu_len = datalink_receive(&src, &PDUBuffer[0], sizeof(PDUBuffer), 0);
|
||||||
if (pdu_len) {
|
if (pdu_len) {
|
||||||
|
#if !defined(TEST_MSTP)
|
||||||
npdu_handler(&src, &PDUBuffer[0], pdu_len);
|
npdu_handler(&src, &PDUBuffer[0], pdu_len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user