Fixed up compiler warnings about missing definition and such.

This commit is contained in:
akchu
2004-10-03 16:23:12 +00:00
parent b27c45d756
commit 4aa922fe63
3 changed files with 35 additions and 1 deletions
+29
View File
@@ -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
+3 -1
View File
@@ -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;
}
+3
View File
@@ -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);