chegewara / EspTinyUSB

ESP32S2 native USB library. Implemented few common classes, like MIDI, CDC, HID or DFU (update).
MIT License
473 stars 70 forks source link

Arduino IDE 2.0.2 warning #126

Closed crasheg closed 1 year ago

crasheg commented 1 year ago

While compiling USB_CDC project for ESP32S2 i have warning

In file included from \libraries\EspTinyUSB-2.0.2\src\device\msc\flashdisk.cpp:1:
\libraries\EspTinyUSB-2.0.2\src/flashdisk.h:15:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     bool init(char* path = "/fatfs",char* label = NULL);

change \src\flashdisk.h:15 bool init(char* path = "/fatfs",char* label = NULL);

to

bool init(char* path = (char*)"/fatfs",char* label = NULL);

resolves this problem great idea to add examples for changing manufacturer, product and e.g. in users projects to compile without warnings.

for my project i used this method: in global space: char *manufacturer = (char*)"BELAUTOMATIC GROUP";

in setup function: USBSerial.manufacturer(manufacturer);

and there is no warnings and Ubuntu got all parameters, but Windows 10 x64 как обычно, сука, ебет мозг(