ArduinoLowPower icon indicating copy to clipboard operation
ArduinoLowPower copied to clipboard

Boards without SERIAL_PORT_USBVIRTUAL

Open maxholgasson opened this issue 5 years ago • 1 comments

When using a SAMD21 on a custom pcb without a USB connector and commented out (//#define SERIAL_PORT_USBVIRTUAL SerialUSB) in variant.h there appears an error.

Would it be possible to add a check whether it's defined in variant.h or not?

Error message: ArduinoLowPower-master/src/samd/ArduinoLowPower.cpp:41:6: error: 'SERIAL_PORT_USBVIRTUAL' was not declared in this scope if (SERIAL_PORT_USBVIRTUAL) {

maxholgasson avatar Nov 14 '20 21:11 maxholgasson

Hi @maxholgasson , the right approach to remove USB from a SAMD board is adding this line to its boards.txt entry: <board>.build.usb_flags= It removes all USB initialization code too. Then, the bug you reported is real, so if you could send a PR I'd be glad to merge it (to preserve attribution)

facchinm avatar Nov 16 '20 08:11 facchinm