提交 14126060 编写于 作者: A Arsham Skrenes 提交者: Me No Dev

Properly allocate string and remove warning (#2652)

* Properly allocate string and remove warning

The former way generates the following warning:
ISO C++ forbids converting a string constant to 'char*'

This change makes a character array the size of the string with null ending. It's clearer and gets rid of the warning.

* Better way

Since this is technically immutable, the type should reflect this too.
上级 25c0b522
......@@ -51,7 +51,7 @@ void InitESPNow() {
// config AP SSID
void configDeviceAP() {
char* SSID = "Slave_1";
const char *SSID = "Slave_1";
bool result = WiFi.softAP(SSID, "Slave_1_Password", CHANNEL, 0);
if (!result) {
Serial.println("AP Config failed.");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册