[英]Invalid conversion from 'char' to 'const char*' [-fpermissive]
[英]freeRTOS xTimerCreate invalid conversion from 'char*' to 'const signed char*' [-fpermissive]
嗨,非常感謝您的貢獻,我添加了代碼以創建一個任務計時器,我需要定期運行一些工作,當我編譯它會給我一個錯誤,我不知道如何解決它時,我查看了各種討論,但是我什么都找不到。
#include “esp_common.h”
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include “esp_wps.h”
#include “freertos/timers.h”
#include “freertos/FreeRTOS.h”
#include “freertos/task.h”
#include “freertos/queue.h”
xTimerHandle timer;
void callback_timer (xTimerHandle xTimer)
{
}
timer = xTimerCreate("timer",5000/portTICK_RATE_MS,pdTRUE,(void *)0,
callback_timer);
[Clang IntelliSense]錯誤:沒有匹配的函數來調用'xTimerCreate'
從'char *'到'constsigned char *'的無效轉換出錯[-fpermissive]
請幫我
非常感謝
只需將“ timer”字符串轉換為const簽名的char
該代碼將如下所示:
timer = xTimerCreate((const signed char *)"timer",5000/portTICK_RATE_MS,pdTRUE,(void *)0,
callback_timer);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.