diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/Makefile b/bacnet-stack/ports/bdk-atxx4-mstp/Makefile index b3aebc39..20014832 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/Makefile +++ b/bacnet-stack/ports/bdk-atxx4-mstp/Makefile @@ -17,6 +17,7 @@ OBJDUMP = avr-objdump SIZE = avr-size AVRDUDE = avrdude LINT = splint +LINT_MCU = __AVR_ATmega644p__ SIZE_OPTIONS = -t #SIZE_OPTIONS = -C --mcu=${MCU} @@ -188,6 +189,7 @@ CFLAGS += -fshort-enums # warnings CFLAGS += -Wall CFLAGS += -Wstrict-prototypes +CFLAGS += -Wmissing-prototypes # put it all together CFLAGS += -gdwarf-2 $(BFLAGS) $(OPTIMIZATION) CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d @@ -319,7 +321,7 @@ size: ${TARGET_ELF} @${SIZE} ${SIZE_OPTIONS} ${TARGET_ELF} lint: - $(LINT) $(BFLAGS) $(CSRC) + $(LINT) -exportlocal -D$(LINT_MCU) $(BFLAGS) $(CSRC) install: $(TARGET_ELF) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_INSTALL) diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/adc.c b/bacnet-stack/ports/bdk-atxx4-mstp/adc.c index 658ef8f1..8120e192 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/adc.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/adc.c @@ -24,6 +24,8 @@ #include #include #include "hardware.h" +/* me */ +#include "adc.h" /* prescale select bits */ #if (F_CPU >> 1) < 1000000 @@ -73,8 +75,8 @@ void adc_init( /* ADEN = Enable ADSC = Start conversion ADIF = Interrupt Flag - ADIE = Interrupt Enable - ADATE = Auto Trigger Enable + ADIE = Interrupt Enable + ADATE = Auto Trigger Enable */ ADCSRA |= (1 << ADEN) | (1 << ADIE) | (1 << ADIF) | (1 << ADATE); /* trigger selection bits @@ -85,7 +87,7 @@ void adc_init( 1 0 0 Timer/Counter0 Overflow 1 0 1 Timer/Counter1 Compare Match B 1 1 0 Timer/Counter1 Overflow - 1 1 1 Timer/Counter1 Capture Event + 1 1 1 Timer/Counter1 Capture Event */ ADCSRB |= (0 << ADTS2) | (0 << ADTS1) | (0 << ADTS0); /* start the conversions */ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c b/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c index c5218b3f..45227aaa 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bacnet.c @@ -45,6 +45,8 @@ #include "av.h" #include "bi.h" #include "bo.h" +/* me */ +#include "bacnet.h" /* MAC Address of MS/TP */ static uint8_t MSTP_MAC_Address; diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c index c7f936b6..c02c1ddc 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c @@ -218,7 +218,7 @@ bool Binary_Output_Present_Value_Set( return status; } -void Binary_Output_Polarity_Set( +static void Binary_Output_Polarity_Set( uint32_t instance, BACNET_POLARITY polarity) { @@ -231,7 +231,7 @@ void Binary_Output_Polarity_Set( } } -void Binary_Output_Out_Of_Service_Set( +static void Binary_Output_Out_Of_Service_Set( uint32_t instance, bool flag) { diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/dlmstp.c b/bacnet-stack/ports/bdk-atxx4-mstp/dlmstp.c index 8159637d..cdab7b2f 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/dlmstp.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/dlmstp.c @@ -1348,6 +1348,7 @@ void dlmstp_get_broadcast_address( return; } +#ifdef TEST_MSTP_STATE_TEXT char *dlmstp_receive_state_text( void) { @@ -1366,7 +1367,9 @@ char *dlmstp_receive_state_text( return "unknown"; } +#endif +#ifdef TEST_MSTP_STATE_TEXT char *dlmstp_master_state_text( void) { @@ -1395,3 +1398,4 @@ char *dlmstp_master_state_text( return "unknown"; } +#endif \ No newline at end of file diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/init.c b/bacnet-stack/ports/bdk-atxx4-mstp/init.c index afd80ba3..f1f8bd22 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/init.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/init.c @@ -23,6 +23,8 @@ * *********************************************************************/ #include "hardware.h" +/* me */ +#include "init.h" void init( void) diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/input.c b/bacnet-stack/ports/bdk-atxx4-mstp/input.c index 82ed682f..a795b65e 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/input.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/input.c @@ -26,6 +26,8 @@ #include #include "hardware.h" #include "timer.h" +/* me */ +#include "input.h" static uint8_t Address_Switch; static uint8_t Buttons; diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/rs485.c b/bacnet-stack/ports/bdk-atxx4-mstp/rs485.c index c5e15423..44032e76 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/rs485.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/rs485.c @@ -29,6 +29,8 @@ #include "timer.h" #include "led.h" #include "nvdata.h" +/* me */ +#include "rs485.h" /* baud rate */ static uint32_t Baud_Rate = 9600; diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/seeprom.c b/bacnet-stack/ports/bdk-atxx4-mstp/seeprom.c index e623f035..ea33e032 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/seeprom.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/seeprom.c @@ -25,6 +25,7 @@ #include #include #include "hardware.h" +/* me */ #include "seeprom.h" /* the SEEPROM chip select bits A2, A1, and A0 are grounded */ @@ -276,7 +277,7 @@ int seeprom_bytes_read( * RETURN: number of bytes written, or -1 on error * NOTES: only writes from offset to end of page. **************************************************************************/ -int seeprom_bytes_write_page( +static int seeprom_bytes_write_page( uint16_t eeaddr, /* SEEPROM starting memory address */ uint8_t * buf, /* data to send */ int len) @@ -413,14 +414,14 @@ int seeprom_bytes_write_page( /************************************************************************* * DESCRIPTION: Write some data and wait until it is sent * RETURN: number of bytes written, or -1 on error -* NOTES: -* When the word address, internally generated, +* NOTES: +* When the word address, internally generated, * reaches the page boundary, the following -* byte is placed at the beginning of the same +* byte is placed at the beginning of the same * page. If more than 64 data words are -* transmitted to the EEPROM, the data word +* transmitted to the EEPROM, the data word * address will “roll over” and previous data will be -* overwritten. The address “roll over” during write +* overwritten. The address “roll over” during write * is from the last byte of the current page to the * first byte of the same page. **************************************************************************/ diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/stack.c b/bacnet-stack/ports/bdk-atxx4-mstp/stack.c index e5108463..29c247b5 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/stack.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/stack.c @@ -23,6 +23,8 @@ * *********************************************************************/ #include "hardware.h" +/* me */ +#include "stack.h" /* stack checking */ extern uint8_t _end; diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/test.c b/bacnet-stack/ports/bdk-atxx4-mstp/test.c index c908259a..b8232dde 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/test.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/test.c @@ -30,6 +30,8 @@ #include "serial.h" #include "input.h" #include "bo.h" +/* me */ +#include "test.h" /* timer for test task */ static struct itimer Test_Timer;