2025-10-14 00:49:58 +08:00
|
|
|
#include "adc.h"
|
2026-03-15 02:38:50 +08:00
|
|
|
#include "config.h"
|
2025-10-14 00:49:58 +08:00
|
|
|
#include <cstdio>
|
|
|
|
|
|
2026-03-15 02:38:50 +08:00
|
|
|
// TEST 调试宏定义
|
|
|
|
|
#if TEST_DEBUG
|
|
|
|
|
#define TEST_DEBUG_PRINT(fmt, ...) printf(fmt, ##__VA_ARGS__)
|
|
|
|
|
#else
|
|
|
|
|
#define TEST_DEBUG_PRINT(fmt, ...) ((void)0)
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-10-14 00:49:58 +08:00
|
|
|
constexpr int status_print = 0;
|
2025-10-19 23:20:28 +08:00
|
|
|
extern sampler sampler;
|
2025-10-14 00:49:58 +08:00
|
|
|
void test_1111() {
|
2026-03-15 02:38:50 +08:00
|
|
|
// 初始化 CAN 回环测试
|
2025-10-14 00:49:58 +08:00
|
|
|
// can_loopback_init();
|
|
|
|
|
// can_config();
|
|
|
|
|
if (status_print) {
|
|
|
|
|
/* value print */
|
2026-03-15 02:38:50 +08:00
|
|
|
TEST_DEBUG_PRINT(" the temperature data is %2.2f degrees Celsius\r\n",
|
2025-11-01 20:29:11 +08:00
|
|
|
sampler.get_mcu_temp());
|
2026-03-15 02:38:50 +08:00
|
|
|
TEST_DEBUG_PRINT(" the drv_temperature data is %2.2f degrees Celsius\r\n",
|
2025-10-19 23:20:28 +08:00
|
|
|
sampler.get_drv_temp());
|
2026-03-15 02:38:50 +08:00
|
|
|
TEST_DEBUG_PRINT(" the U current data is %2.2f mA\r\n", sampler.get_current('U'));
|
|
|
|
|
TEST_DEBUG_PRINT(" the V current data is %2.2f mA\r\n", sampler.get_current('V'));
|
|
|
|
|
TEST_DEBUG_PRINT(" the W current data is %2.2f mA\r\n", sampler.get_current('W'));
|
|
|
|
|
TEST_DEBUG_PRINT(" the VBUS is %2.2f V\r\n", sampler.get_vbus_voltage());
|
|
|
|
|
// TEST_DEBUG_PRINT(" the angle is %2.2f\r\n", tle5012b_read());
|
2025-10-14 00:49:58 +08:00
|
|
|
|
2026-03-15 02:38:50 +08:00
|
|
|
TEST_DEBUG_PRINT("\n----------------------------------------------------\n");
|
2025-10-14 00:49:58 +08:00
|
|
|
}
|
|
|
|
|
// can_loopback_test();
|
|
|
|
|
}
|