Scs (#3)
* Add send scs * Create scs dict * Fix compilation errors * Fix compile error * Change default include * Add Timer SCS manager * Remove unused files * Fix bugs * Add documentation * Add SCS manager bozza * Refactor * Use same naming convention * Add tick provider * Update header * Fix header bit translation * Test HandleNext OK * Remove linting * Remove indents * Add documentation * Improve docs * Remove pointer * Remove mailbox * Remove useless comment * Add newline * Fix compile errors * Separate scs entries from manager * Refactor * Fix include guards Co-authored-by: nicolagutierrez <nicolagutierrez.ng@gmail.com>
This commit was merged in pull request #3.
This commit is contained in:
committed by
GitHub
parent
7aa61ed9ad
commit
4d5c1934a4
+14
-9
@@ -17,7 +17,7 @@ typedef struct {
|
||||
|
||||
static HalStatus receiveOne(ReceptionParams *rp);
|
||||
static HalStatus receiveAll(ReceptionParams *rp);
|
||||
static bool headerIsMultiFrame(MmrCanHeader *header, CanId targetId);
|
||||
static bool headerIsMultiFrame(MmrCanHeader header, CanId targetId);
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ HalStatus MMR_CAN_Receive(CanHandle *hcan, MmrCanMessage *result) {
|
||||
}
|
||||
|
||||
result->header = rp.headers.mmr;
|
||||
if (MMR_CAN_IsMultiFrame(&rp.headers.mmr)) {
|
||||
if (MMR_CAN_IsMultiFrame(rp.headers.mmr)) {
|
||||
status |= receiveAll(&rp);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,9 @@ static HalStatus receiveAll(ReceptionParams *rp) {
|
||||
do {
|
||||
rp->result += MMR_CAN_MAX_DATA_LENGTH;
|
||||
status |= receiveOne(rp);
|
||||
} while (
|
||||
headerIsMultiFrame(&rp->headers.mmr, targetId) && status == HAL_OK
|
||||
}
|
||||
while (
|
||||
headerIsMultiFrame(rp->headers.mmr, targetId) && status == HAL_OK
|
||||
);
|
||||
|
||||
return status;
|
||||
@@ -64,17 +65,21 @@ static HalStatus receiveAll(ReceptionParams *rp) {
|
||||
|
||||
|
||||
static HalStatus receiveOne(ReceptionParams *rp) {
|
||||
HalStatus status =
|
||||
HAL_CAN_GetRxMessage(rp->handle, rp->fifo, &(rp->headers.rx), rp->result);
|
||||
HalStatus status = HAL_CAN_GetRxMessage(
|
||||
rp->handle,
|
||||
rp->fifo,
|
||||
&rp->headers.rx,
|
||||
rp->result
|
||||
);
|
||||
|
||||
rp->headers.mmr = convertTo(MmrCanHeader, rp->headers.rx.ExtId);
|
||||
rp->headers.mmr = MMR_CAN_HeaderFromBits(rp->headers.rx.ExtId);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
static always_inline bool headerIsMultiFrame(MmrCanHeader *header, CanId targetId) {
|
||||
static bool headerIsMultiFrame(MmrCanHeader header, CanId targetId) {
|
||||
return
|
||||
MMR_CAN_IsMultiFrame(header) &&
|
||||
!MMR_CAN_IsMultiFrameEnd(header) &&
|
||||
header->senderId == targetId;
|
||||
header.senderId == targetId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user