diff --git a/CanPorts.c b/CanPorts.c index af9edae..177dea1 100644 --- a/CanPorts.c +++ b/CanPorts.c @@ -59,6 +59,8 @@ static void vCanPort_InitCAN0RxTxPin() { GPIO_InitPins(GPIO_C, &tGpioInitStruct); } +uint32_t IdCanFilter[2] = {PROTOCOL_XCP_ID, 1}; + static void vCanPort_InitCan0() { vCanPort_InitCAN0RxTxPin(); @@ -76,6 +78,9 @@ static void vCanPort_InitCan0() { (uint8_t *)&g_aRxDataBuf[0], + 2, + IdCanFilter, + DMA1_IRQn, 0x55, 1, diff --git a/CanPorts.h b/CanPorts.h index fdcaf4d..edf31bf 100644 --- a/CanPorts.h +++ b/CanPorts.h @@ -7,6 +7,10 @@ #include "CanSerialPortFrame.h" +#define PROTOCOL_XCP_ID 0x123 + +#define PROTOCOL_XCP 0 + typedef struct { tCanSerialPortFrameFlagchip Can0; tSerialPortFrameIO Can0_IO;