Skip to content

Commit 7edc6fd

Browse files
committed
🎈 perf(自定义控制器): 优化换函数执行顺序
1 parent 88bc91b commit 7edc6fd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

application/custom_controller/custom_controller_task.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define __weak __attribute__((weak))
2424
#endif /* __weak */
2525

26+
__weak void CustomControllerPublish(void);
2627
__weak void CustomControllerInit(void);
2728
__weak void CustomControllerHandleException(void);
2829
__weak void CustomControllerSetMode(void);
@@ -38,15 +39,16 @@ __weak void CustomControllerSendCmd(void);
3839
*/
3940
void custom_controller_task(void const * pvParameters)
4041
{
42+
CustomControllerPublish();
4143
vTaskDelay(CUSTOM_CONTROLLER_TASK_INIT_TIME);
4244
// 初始化
4345
CustomControllerInit();
4446

4547
while (1) {
46-
// 处理异常
47-
CustomControllerHandleException();
4848
// 更新状态量
4949
CustomControllerObserver();
50+
// 处理异常
51+
CustomControllerHandleException();
5052
// 设置模式
5153
CustomControllerSetMode();
5254
// 设置目标量
@@ -61,6 +63,12 @@ void custom_controller_task(void const * pvParameters)
6163
}
6264
}
6365

66+
__weak void CustomControllerPublish(void)
67+
{
68+
/*
69+
NOTE : 在其他文件中定义具体内容
70+
*/
71+
}
6472
__weak void CustomControllerInit(void)
6573
{
6674
/*

0 commit comments

Comments
 (0)