Fix compile error
This commit is contained in:
@@ -14,11 +14,11 @@ typedef struct {
|
|||||||
uint32_t delayStart;
|
uint32_t delayStart;
|
||||||
} MmrCanScsDictEntry;
|
} MmrCanScsDictEntry;
|
||||||
|
|
||||||
typedef MmrCanScsDictEntry MmrCanScsDictionary[MMR_SCS_DICTIONARY_SIZE];
|
typedef MmrCanScsDictEntry MmrCanScsDictionary[MMR_CAN_SCS_DICTIONARY_SIZE];
|
||||||
typedef void(*MmrCanScsDictAction)(MmrCanScsDictEntry *entry);
|
typedef void(*MmrCanScsDictAction)(MmrCanScsDictEntry *entry);
|
||||||
|
|
||||||
|
|
||||||
uint32_t MMR_CAN_ScsDictPut(MmrCanScsDictEntry entry);
|
void MMR_CAN_ScsDictPut(MmrCanScsDictEntry entry);
|
||||||
void MMR_CAN_ScsDictRemove(uint32_t key);
|
void MMR_CAN_ScsDictRemove(uint32_t key);
|
||||||
void MMR_CAN_ScsDictForeach(MmrCanScsDictAction action);
|
void MMR_CAN_ScsDictForeach(MmrCanScsDictAction action);
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "mmr_can_scs.h"
|
#include "mmr_can_scs_dict.h"
|
||||||
|
|
||||||
static MmrCanScsDictionary _dictionary;
|
static MmrCanScsDictionary _dictionary;
|
||||||
|
|
||||||
|
|
||||||
uint32_t MMR_CAN_ScsDictPut(MmrCanScsDictEntry entry) {
|
void MMR_CAN_ScsDictPut(MmrCanScsDictEntry entry) {
|
||||||
_dictionary[entry.key % MMR_CAN_SCS_DICTIONARY_SIZE] = entry.delayStart;
|
_dictionary[entry.key % MMR_CAN_SCS_DICTIONARY_SIZE] = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMR_CAN_ScsDictRemove(uint32_t key) {
|
void MMR_CAN_ScsDictRemove(uint32_t key) {
|
||||||
_dictionary[key] = {};
|
_dictionary[key] = (MmrCanScsDictEntry){};
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMR_CAN_ScsDictForeach(MmrCanScsDictAction action) {
|
void MMR_CAN_ScsDictForeach(MmrCanScsDictAction action) {
|
||||||
@@ -27,4 +27,4 @@ uint32_t MMR_CAN_ScsMessageAsKey(MmrCanMessage *message) {
|
|||||||
uint16_t lowerHalf = message->header.messageType;
|
uint16_t lowerHalf = message->header.messageType;
|
||||||
|
|
||||||
return (upperHalf << 16) | lowerHalf;
|
return (upperHalf << 16) | lowerHalf;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user