make libCLS more independen of HW
goal is to reuse libCLS on an diffrent MCU
This commit is contained in:
@@ -202,6 +202,40 @@ void test_CanData_removeEvent() {
|
||||
}
|
||||
|
||||
|
||||
void test_CanData_regDataManualMsg(void) {
|
||||
CanDataHandler_init(); // Reset the state of the module
|
||||
|
||||
{
|
||||
CanDataId canids[] = {1, 2, 3};
|
||||
size_t id_count = sizeof(canids) / sizeof(canids[0]);
|
||||
CLS_BSP_CAN_UniversalFilter filter = {
|
||||
.filterDestination = CLS_CAN_FILTER_TO_RXFIFO0,
|
||||
.filterMode = 0xff,
|
||||
.id0 = 0x7ff,
|
||||
.id1 = 0x003,
|
||||
};
|
||||
|
||||
size_t result = CanData_regDataManualMsg(canids, id_count, &filter);
|
||||
TEST_ASSERT_EQUAL(id_count, result);
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
CanDataId canids[] = {4, 5, 7};
|
||||
size_t id_count = sizeof(canids) / sizeof(canids[0]);
|
||||
CLS_BSP_CAN_UniversalFilter filter = {
|
||||
.filterDestination = CLS_CAN_FILTER_TO_RXFIFO0,
|
||||
.filterMode = 0xf8,
|
||||
.id0 = 0x777,
|
||||
.id1 = 0x073,
|
||||
};
|
||||
|
||||
size_t result = CanData_regDataManualMsg(canids, id_count, &filter);
|
||||
|
||||
TEST_ASSERT_EQUAL(id_count, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create a test runner function
|
||||
@@ -217,4 +251,5 @@ void test_CanData(void) {
|
||||
RUN_TEST(test_CanData_canFifo0RxCallback_data_invalid);
|
||||
RUN_TEST(test_CanData_canFifo1RxCallback_data_valid);
|
||||
RUN_TEST(test_CanData_removeEvent);
|
||||
RUN_TEST(test_CanData_regDataManualMsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user