修复SPI通道错误的问题,增加看门狗功能

This commit is contained in:
cbb
2025-10-02 23:50:12 +08:00
parent 20fbb30067
commit d755715363
9 changed files with 152 additions and 113 deletions
+21 -17
View File
@@ -4,9 +4,11 @@
#include "Timer.h"
#include "adc.h"
#include "initial.h"
#include "sys/initial.h"
#include "systick.h"
#include "core_cm4.h"
#include "tle5012b.h"
#include <cinttypes>
#include <cstdio>
@@ -26,29 +28,31 @@ int main(void) {
tle5012b_spi_init();
// cdd_TLI5012_Init();
watchdog_init(1000);
// 初始化CAN回环测试
// can_loopback_init();
// can_loopback_test();
// TLI5012B测试
// Test_TLI5012B();
extern u16 adc_value[7];
while (1) {
/* value print */
printf(" the temperature data is %2.2f degrees Celsius\r\n",
get_mcu_temp());
printf(" the drv_temperature data is %2.2f degrees Celsius\r\n",
get_drv_temp());
printf(" the U current data is %2.2f mA\r\n",get_current('U'));
printf(" the V current data is %2.2f mA\r\n",get_current('V'));
printf(" the W current data is %2.2f mA\r\n",get_current('W'));
printf(" the VBUS is %2.2f V\r\n",get_vbus_voltage());
printf("\n----------------------------------------------------\n");
/* clear the FWDGT reset flag */
fwdgt_counter_reload();
// can_loopback_test();
// /* value print */
// printf(" the temperature data is %2.2f degrees Celsius\r\n",
// get_mcu_temp());
// printf(" the drv_temperature data is %2.2f degrees Celsius\r\n",
// get_drv_temp());
// printf(" the U current data is %2.2f mA\r\n",get_current('U'));
// printf(" the V current data is %2.2f mA\r\n",get_current('V'));
// printf(" the W current data is %2.2f mA\r\n",get_current('W'));
// printf(" the VBUS is %2.2f V\r\n",get_vbus_voltage());
// printf("\n----------------------------------------------------\n");
delay_1ms(200);
// TLI5012B测试
// Test_TLI5012B();
Set_Pwm(0, 1500);
}
}