![](/img/trans.png)
[英]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.