#define TICKRATE_HZ1 (100) /* 1/TickRate_HZ = PERIOD MS, 20 ms */ #define TEST_CCAN_BAUD_RATE 500000 CCAN_MSG_OBJ_T msg_obj; [color=#66f]uint8_t crc8table[256] = { 0x00, 0x1D, 0x3A, 0x27, 0x74, 0x69, 0x4E, 0x53, 0xE8, 0xF5, 0xD2, 0xCF, 0x9C, 0x81, 0xA6, 0xBB, 0xCD, 0xD0, 0xF7, 0xEA, 0xB9, 0xA4, 0x83, 0x9E, 0x25, 0x38, 0x1F, 0x02, 0x51, 0x4C, 0x6B, 0x76, ...}; [/color] |
int main(void) { uint32_t CanApiClkInitTable[2]; /* Publish CAN Callback Functions */ CCAN_CALLBACKS_T callbacks = { CAN_rx, CAN_tx, CAN_error, NULL, NULL, NULL, NULL, NULL, }; SystemCoreClockUpdate(); Board_Init(); /* Enable and setup SysTick Timer at a periodic rate */ SysTick_Config(SystemCoreClock/ TICKRATE_HZ1); baudrateCalculate(TEST_CCAN_BAUD_RATE, CanApiClkInitTable); [color=#f00]LPC_CCAN_API->init_can(&CanApiClkInitTable[0], TRUE);[/color] /* Configure the CAN callback functions */ LPC_CCAN_API->config_calb(&callbacks); |
#include "board.h" [color=#f00]#include "cr_section_macros.h"[/color] /***************************************************************************** * Private types/enumerations/variables ****************************************************************************/ #define TEST_CCAN_BAUD_RATE 500000 [color=#f00] //reserve CAN ROM-RAM 0x1000 0050 - 0x1000 00B9 __BSS(RESERVED) char CAN_driver_memory[0xC0]; [/color] CCAN_MSG_OBJ_T msg_obj; ... |
int main(void) { uint32_t CanApiClkInitTable[2]; /* Publish CAN Callback Functions */ CCAN_CALLBACKS_T callbacks = { CAN_rx, CAN_tx, CAN_error, NULL, NULL, NULL, NULL, NULL, }; //reserve CAN ROM-RAM 0x1000 0050 - 0x1000 00B9 [color=#66f]__BSS(RESERVED) char CAN_driver_memory[0xC0];[/color] SystemCoreClockUpdate(); Board_Init(); /* Enable and setup SysTick Timer at a periodic rate */ SysTick_Config(SystemCoreClock/ TICKRATE_HZ1); baudrateCalculate(TEST_CCAN_BAUD_RATE, CanApiClkInitTable); LPC_CCAN_API->init_can(&CanApiClkInitTable[0], TRUE); /* Configure the CAN callback functions */ LPC_CCAN_API->config_calb(&callbacks); /* Enable the CAN Interrupt */ NVIC_EnableIRQ(CAN_IRQn); |
//reserve CAN ROM-RAM 0x1000 0050 - 0x1000 00B9 __BSS(RESERVED) char CAN_driver_memory[0xC0]; |
static uint8_t crc8table[256] = ... |