first commit

This commit is contained in:
liyp
2025-12-24 17:18:34 +08:00
parent a7eb3fb3d9
commit 0f8ea19850
61 changed files with 765 additions and 156 deletions

47
Src/CanProtocol.cpp Normal file
View File

@@ -0,0 +1,47 @@
#include "CanProtocol.h"
#include "System.h"
// 一个任务函数C 风格
void Task1(void* param) {
while (true) {
std::cout << "Task1 running\n";
vTaskDelay(1000); // 延时 1000ms
}
}
// 另一个任务函数
void Task2(void* param) {
while (true) {
std::cout << "Task2 running\n";
vTaskDelay(500); // 延时 500ms
}
}
void CanRecive(void)
{
// 创建“任务”,用 std::thread 代替 FreeRTOS 任务
std::thread t1(Task1, nullptr);
std::thread t2(Task2, nullptr);
// 如果想模拟 FreeRTOS通常任务一直运行主函数也可以阻塞
t1.join();
t2.join();
}
//打开CAN盒子同时如果有初始化这里也会初始化
uint8_t CanOpen(uint8_t Product, int DeviceType, int Chnl, int Baud, int OtherTyp1, int OtherType2)
{
switch (Product)
{
case SC_HHS:
break;
case ZLG:
break;
case GC:
break;
case PEAK_CAN:
break;
default:
break;
}
}