mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
test(twai): add cxx build test
This commit is contained in:
@ -7,6 +7,10 @@ if(CONFIG_SOC_I2C_SUPPORTED)
|
||||
list(APPEND srcs test_i2c_lcd.cpp)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_TWAI_SUPPORTED)
|
||||
list(APPEND srcs test_twai.cpp)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES driver esp_lcd
|
||||
|
15
tools/test_apps/system/cxx_build_test/main/test_twai.cpp
Normal file
15
tools/test_apps/system/cxx_build_test/main/test_twai.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
#include "driver/twai.h"
|
||||
|
||||
void test_twai_apis(void)
|
||||
{
|
||||
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
|
||||
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_0, GPIO_NUM_1, TWAI_MODE_NO_ACK);
|
||||
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_100KBITS();
|
||||
twai_driver_install(&g_config, &t_config, &f_config);
|
||||
twai_driver_uninstall();
|
||||
}
|
Reference in New Issue
Block a user