WIP
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "mmr_can.h"
|
||||
|
||||
|
||||
#define cast(pmsg, to) (*(to*)(pmsg->store))
|
||||
|
||||
|
||||
uint16_t MMR_CAN_GetUInt16(MmrCanMessage *message) {
|
||||
return cast(message, uint16_t);
|
||||
}
|
||||
|
||||
uint32_t MMR_CAN_GetUInt32(MmrCanMessage *message) {
|
||||
return cast(message, uint32_t);
|
||||
}
|
||||
|
||||
uint64_t MMR_CAN_GetUInt64(MmrCanMessage *message) {
|
||||
return cast(message, uint64_t);
|
||||
}
|
||||
|
||||
float MMR_CAN_GetFloat(MmrCanMessage *message) {
|
||||
return cast(message, float);
|
||||
}
|
||||
|
||||
|
||||
MmrResult MMR_CAN_TryReceive(MmrCan *can, MmrCanMessage *result) {
|
||||
size_t pendingMessages =
|
||||
HAL_CAN_GetRxFifoFillLevel(hcan, MMR_CAN_RX_FIFO);
|
||||
|
||||
Reference in New Issue
Block a user