From 4aa922fe633c34cbacd54990e053ae1421241c24 Mon Sep 17 00:00:00 2001 From: akchu Date: Sun, 3 Oct 2004 16:23:12 +0000 Subject: [PATCH] Fixed up compiler warnings about missing definition and such. --- bacnet-stack/bytes.h | 29 +++++++++++++++++++++++++++++ bacnet-stack/main.c | 4 +++- bacnet-stack/mstp.h | 3 +++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/bacnet-stack/bytes.h b/bacnet-stack/bytes.h index 97dce0bd..da209113 100644 --- a/bacnet-stack/bytes.h +++ b/bacnet-stack/bytes.h @@ -1,5 +1,6 @@ // Defines the bit/byte/word/long conversions that are used in code + #ifndef BYTES_H #define BYTES_H @@ -11,32 +12,60 @@ #ifndef HI_NIB #define HI_NIB(b) ((b) >> 4) + #endif + + #ifndef LO_BYTE + #define LO_BYTE(w) ((uint8_t)(w)) + #endif + + #ifndef HI_BYTE + #define HI_BYTE(w) ((uint8_t)((uint16_t)(w) >> 8)) + #endif + + #ifndef LO_WORD + #define LO_WORD(x) ((uint16_t)(x)) + #endif + + #ifndef HI_WORD + #define HI_WORD(x) ((uint16_t)((uint32_t)(x) >> 16)) + #endif + + #ifndef MAKE_WORD + #define MAKE_WORD(lo,hi) \ ((uint16_t)(((uint8_t)(lo))|(((uint16_t)((uint8_t)(hi)))<<8))) + #endif + + #ifndef MAKE_LONG + #define MAKE_LONG(lo,hi) \ ((uint32_t)(((uint16_t)(lo))|(((uint32_t)((uint16_t)(hi)))<<16))) + #endif + + #endif // end of header file + diff --git a/bacnet-stack/main.c b/bacnet-stack/main.c index c54fdc5b..39b6862f 100644 --- a/bacnet-stack/main.c +++ b/bacnet-stack/main.c @@ -41,7 +41,7 @@ #include "rs485.h" #include "ringbuf.h" -void main(void) +int main(void) { struct mstp_port_struct_t mstp_port; // port data uint8_t my_mac = 0x05; // local MAC address @@ -60,4 +60,6 @@ void main(void) MSTP_Master_Node_FSM(&mstp_port); } + + return 0; } diff --git a/bacnet-stack/mstp.h b/bacnet-stack/mstp.h index 6ec810c3..79a175c3 100644 --- a/bacnet-stack/mstp.h +++ b/bacnet-stack/mstp.h @@ -224,6 +224,9 @@ struct mstp_port_struct_t // At 9600 baud, 40 bit times would be about 4.166 milliseconds #define Tturnaround 40; +void MSTP_Init( + struct mstp_port_struct_t *mstp_port, + uint8_t this_station_mac); void MSTP_Millisecond_Timer(struct mstp_port_struct_t *mstp_port); void MSTP_Receive_Frame_FSM(struct mstp_port_struct_t *mstp_port); void MSTP_Master_Node_FSM(struct mstp_port_struct_t *mstp_port);