Updated prototypes and include as required and found by compile with extra checking.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
#include "hardware.h"
|
||||
/* me */
|
||||
#include "init.h"
|
||||
|
||||
void init(
|
||||
void)
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <stdbool.h>
|
||||
#include "hardware.h"
|
||||
#include "timer.h"
|
||||
/* me */
|
||||
#include "input.h"
|
||||
|
||||
static uint8_t Address_Switch;
|
||||
static uint8_t Buttons;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#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.
|
||||
**************************************************************************/
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
#include "hardware.h"
|
||||
/* me */
|
||||
#include "stack.h"
|
||||
|
||||
/* stack checking */
|
||||
extern uint8_t _end;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user