Some boards, like ESP32 based boards, give some unintelligible data when connecting to them via Serial. This is sometimes data that is send with the wrong baud rate (hard baked into the boot loader), or something else. It's hard to prevent this from happening. When a build is uploaded to the ESP board for unit testing, the decoding of the incoming stream should not fail the test due to some garbled content. Since the read data is validated on line 95, any garbage is automatically ignored and only outputted to the console.
On boards like the Arduino Micro, when in bootloader mode it appears ModemManager interferes with the programming process and result in a catastrophic failure with no end of different errors including, but not limited to:
```
error: programmer did not respond to command: write block
error: butterfly programmer uses avr_write_page() but does not provide a cmd() method.
error: programmer did not respond to command: set addr
```
After this, the device could appear to be completely non-functional, refusing to enumerate or appear for programming, but thankfully a double-reset will usually recover it, but the underlying ModemManager issue will still prevent successful programming. Hence the additional rules.
This affects not only PlatformIO, but also the Arduino IDE (on linux).
* Better environement integration :
- Environement can be selected in the build target menu of CLion
- Platformio target runs on the selected environment
- Changing environment changes defined preprocessor variables and includes accordingly
- Added 'All' build profile that runs targets on all environment if there are multiple of them (Original behaviour)
* Calling get_project_dir() only once.
* Fixed include path not being converted to unix style.
Removed duplicate and not normalized definition