初级会员
- 积分
- 96
- 金钱
- 96
- 注册时间
- 2020-1-14
- 在线时间
- 13 小时
|
5金钱
本帖最后由 yexiachensi11 于 2020-12-15 10:55 编辑
如题。挂起函数ret返回值是RT_EOK。但是调试的时候,该线程还是在不停的运行。
还有另外一个线程等待获取队列消息。没其他线程了。
- static void led2_thread_entry(void* parameter)
- {
- rt_err_t ret;
- uint8_t finishFlg = 0;
- while(1)
- {
- ledAllClose();
- AW9110B_set_luminance(LED_BATT_WHITE_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(20);
- AW9110B_set_luminance(LED_BATT_ORG_CHANN, 0);
- rt_thread_delay(20);
- AW9110B_set_luminance(LED_BATT_RED_CHANN, 0);
- rt_thread_delay(200);
- AW9110B_set_luminance(LED_CLEAN_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(200);
- AW9110B_set_luminance(LED_LOCK_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(200);
- AW9110B_set_luminance(LED_SPEED_LOW_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(200);
- AW9110B_set_luminance(LED_SPEED_MID_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(200);
- AW9110B_set_luminance(LED_SPEED_HIGH_CHANN, MAX_LED_WHITE_VAL);
- rt_thread_delay(200);
- finishFlg = 1;
- ret = rt_mq_send(testMq, &finishFlg, sizeof(finishFlg));
- if(RT_EOK != ret)
- {
- rt_kprintf("发送失败,错误代码:%x\r\n", ret);
- }
- ret = rt_thread_suspend(led2_thread);
- if(RT_EOK != ret)
- {
- rt_kprintf("线程挂起失败,错误代码:%x\r\n", ret);
- }
- }
- }
复制代码
|
|