Fixed up compiler warnings about missing definition and such.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// Defines the bit/byte/word/long conversions that are used in code
|
// Defines the bit/byte/word/long conversions that are used in code
|
||||||
|
|
||||||
|
|
||||||
#ifndef BYTES_H
|
#ifndef BYTES_H
|
||||||
#define BYTES_H
|
#define BYTES_H
|
||||||
|
|
||||||
@@ -11,32 +12,60 @@
|
|||||||
|
|
||||||
#ifndef HI_NIB
|
#ifndef HI_NIB
|
||||||
#define HI_NIB(b) ((b) >> 4)
|
#define HI_NIB(b) ((b) >> 4)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef LO_BYTE
|
#ifndef LO_BYTE
|
||||||
|
|
||||||
#define LO_BYTE(w) ((uint8_t)(w))
|
#define LO_BYTE(w) ((uint8_t)(w))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HI_BYTE
|
#ifndef HI_BYTE
|
||||||
|
|
||||||
#define HI_BYTE(w) ((uint8_t)((uint16_t)(w) >> 8))
|
#define HI_BYTE(w) ((uint8_t)((uint16_t)(w) >> 8))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef LO_WORD
|
#ifndef LO_WORD
|
||||||
|
|
||||||
#define LO_WORD(x) ((uint16_t)(x))
|
#define LO_WORD(x) ((uint16_t)(x))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HI_WORD
|
#ifndef HI_WORD
|
||||||
|
|
||||||
#define HI_WORD(x) ((uint16_t)((uint32_t)(x) >> 16))
|
#define HI_WORD(x) ((uint16_t)((uint32_t)(x) >> 16))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MAKE_WORD
|
#ifndef MAKE_WORD
|
||||||
|
|
||||||
#define MAKE_WORD(lo,hi) \
|
#define MAKE_WORD(lo,hi) \
|
||||||
((uint16_t)(((uint8_t)(lo))|(((uint16_t)((uint8_t)(hi)))<<8)))
|
((uint16_t)(((uint8_t)(lo))|(((uint16_t)((uint8_t)(hi)))<<8)))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MAKE_LONG
|
#ifndef MAKE_LONG
|
||||||
|
|
||||||
#define MAKE_LONG(lo,hi) \
|
#define MAKE_LONG(lo,hi) \
|
||||||
((uint32_t)(((uint16_t)(lo))|(((uint32_t)((uint16_t)(hi)))<<16)))
|
((uint32_t)(((uint16_t)(lo))|(((uint32_t)((uint16_t)(hi)))<<16)))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // end of header file
|
#endif // end of header file
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -41,7 +41,7 @@
|
|||||||
#include "rs485.h"
|
#include "rs485.h"
|
||||||
#include "ringbuf.h"
|
#include "ringbuf.h"
|
||||||
|
|
||||||
void main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
struct mstp_port_struct_t mstp_port; // port data
|
struct mstp_port_struct_t mstp_port; // port data
|
||||||
uint8_t my_mac = 0x05; // local MAC address
|
uint8_t my_mac = 0x05; // local MAC address
|
||||||
@@ -60,4 +60,6 @@ void main(void)
|
|||||||
MSTP_Master_Node_FSM(&mstp_port);
|
MSTP_Master_Node_FSM(&mstp_port);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,6 +224,9 @@ struct mstp_port_struct_t
|
|||||||
// At 9600 baud, 40 bit times would be about 4.166 milliseconds
|
// At 9600 baud, 40 bit times would be about 4.166 milliseconds
|
||||||
#define Tturnaround 40;
|
#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_Millisecond_Timer(struct mstp_port_struct_t *mstp_port);
|
||||||
void MSTP_Receive_Frame_FSM(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);
|
void MSTP_Master_Node_FSM(struct mstp_port_struct_t *mstp_port);
|
||||||
|
|||||||
Reference in New Issue
Block a user