Remove anonymous structures (#9)
This commit was merged in pull request #9.
This commit is contained in:
committed by
GitHub
parent
e764a9ba12
commit
a9fb248f3b
+3
-3
@@ -46,7 +46,7 @@ typedef uint32_t (*MmrCanTickProvider)();
|
||||
typedef uint8_t CanRxBuffer[MMR_CAN_MAX_DATA_LENGTH];
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct MmrCanFilterSettings {
|
||||
bool enabled;
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ typedef struct {
|
||||
* // 'p' has been sent.
|
||||
* }
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct MmrCanPacket {
|
||||
MmrCanHeader header;
|
||||
uint8_t *data;
|
||||
uint8_t length;
|
||||
@@ -154,7 +154,7 @@ typedef struct {
|
||||
* // be used.
|
||||
* }
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct MmrCanMessage {
|
||||
MmrCanHeader header;
|
||||
void *store;
|
||||
} MmrCanMessage;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
typedef void (*MmrCanEventHandler)(const MmrCanMessage *event);
|
||||
|
||||
typedef struct {
|
||||
typedef struct MmrCanEventList {
|
||||
const MmrCanEventHandler *handlers;
|
||||
const size_t count;
|
||||
} MmrCanEventList;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*
|
||||
* Constants with lower values have an higher priority.
|
||||
*/
|
||||
typedef enum {
|
||||
typedef enum MmrCanMessageType {
|
||||
MMR_CAN_MESSAGE_TYPE_SCS = B_(0000),
|
||||
MMR_CAN_MESSAGE_TYPE_ACK = B_(0001),
|
||||
MMR_CAN_MESSAGE_TYPE_MULTI_FRAME = B_(0010),
|
||||
@@ -36,7 +36,7 @@ typedef enum {
|
||||
} MmrCanMessageType;
|
||||
|
||||
|
||||
typedef enum {
|
||||
typedef enum MmrCanMessagePriority {
|
||||
MMR_CAN_MESSAGE_PRIORITY_LOW = B_(0010),
|
||||
MMR_CAN_MESSAGE_PRIORITY_NORMAL = B_(0001),
|
||||
MMR_CAN_MESSAGE_PRIORITY_HIGH = B_(0000),
|
||||
@@ -48,7 +48,7 @@ typedef enum {
|
||||
* This struct encodes the values stored inside the
|
||||
* extended id field of a CAN packet.
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct MmrCanHeader {
|
||||
MmrCanMessagePriority priority : 3;
|
||||
uint16_t messageId : 10;
|
||||
uint16_t senderId : 10;
|
||||
|
||||
@@ -11,11 +11,8 @@
|
||||
#ifndef INC_MMR_CAN_INCLUDES_H_
|
||||
#define INC_MMR_CAN_INCLUDES_H_
|
||||
|
||||
#include "stm32f3xx_hal.h"
|
||||
|
||||
#ifndef CAN
|
||||
#define CAN
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* INC_MMR_CAN_INCLUDES_H_ */
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
typedef enum MmrCanMessageId MmrCanMessageId;
|
||||
|
||||
typedef enum {
|
||||
typedef enum MmrCanMessageIdType {
|
||||
MMR_CAN_MESSAGE_ID_TYPE_SCS = 0,
|
||||
MMR_CAN_MESSAGE_ID_TYPE_DRIVE = 1,
|
||||
} MmrCanMessageIdType;
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ typedef uint32_t TimerRange;
|
||||
* Represents the base-struct to manage a single RTR
|
||||
* and allows to interface with the associated SCS's timer
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct MmrCanScsEntry {
|
||||
/**
|
||||
* @brief
|
||||
* The header used to index this entry.
|
||||
@@ -74,7 +74,7 @@ typedef struct {
|
||||
* @brief
|
||||
* The results of an scsCheck operation.
|
||||
*/
|
||||
typedef enum {
|
||||
typedef enum MmrCanScsCheckResult {
|
||||
/**
|
||||
* @brief No timeout error.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@
|
||||
*
|
||||
* Asynchronous logic can be easily implemented using State Machines
|
||||
*/
|
||||
typedef enum {
|
||||
typedef enum MmrAsyncResult {
|
||||
MMR_ASYNC_RESULT_ERROR,
|
||||
MMR_ASYNC_RESULT_PENDING,
|
||||
MMR_ASYNC_RESULT_COMPLETED,
|
||||
|
||||
Reference in New Issue
Block a user