4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-30 05:10:26 +08:00

Merge pull request #1250 from valeriyvan/fixmemcpy

Fix wrong memcpy parameter
This commit is contained in:
Bernard Xiong 2018-03-04 17:38:44 +08:00 committed by GitHub
commit bb2eb41b44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -415,7 +415,7 @@ void MCAN_SetSTDFilterElement(CAN_Type *base,
{
uint8_t *elementAddress = 0;
elementAddress = (uint8_t *)(MCAN_GetMsgRAMBase(base) + config->address + idx * 4U);
memcpy(elementAddress, filter, sizeof(filter));
memcpy(elementAddress, filter, sizeof(*filter));
}
void MCAN_SetEXTFilterElement(CAN_Type *base,
@ -425,7 +425,7 @@ void MCAN_SetEXTFilterElement(CAN_Type *base,
{
uint8_t *elementAddress = 0;
elementAddress = (uint8_t *)(MCAN_GetMsgRAMBase(base) + config->address + idx * 8U);
memcpy(elementAddress, filter, sizeof(filter));
memcpy(elementAddress, filter, sizeof(*filter));
}
static uint32_t MCAN_GetRxFifo0ElementAddress(CAN_Type *base)