If module `arduino_serial_stdio` is used and `ARDUINO_UART_DEV` is `UART_UNDEF`, the STDIO is used for `Serial`. It requires that the used `stdio` backend implements `stdio_available`.
Not all boards that provide a Arduino pin layout break out all GPIOs. A good example are Adafruit `feather-m0` boards. GPIOs that are not broken out have to be defined as `GPIO_UNDEF` to preserve the Arduino pin layout. However, GPIO functions lead to a complete system lock on `feather-m0` boards if a pin is used that is defined as `GPIO_UNDEF`. Therefore, at least an assert should blow up in this case.
This fixes building tests/pkg_arduino_sdi_12 for the hifive1b board.
The problem is, in build/pkg/arduino_api/api/Common.h millis is defined
within an extern "C" block. While in sys/arduino/include/arduino.hpp it
was not.
This fixes the error:
$ BOARD=arduino-mega2560 make -C tests/pkg_arduino_sdi_12/
[...]
[...]/RIOT/build/pkg/arduino_sdi_12/src/SDI12.cpp:379:7: error: ‘interrupts’ was not declared in this scope
There is no clear reason why this should be configurable and causes an abstraction of USEMODULE.
The true reason is to make Kconfig easier but it seems having a variable in USEMODULE is a bit strange.
To make it possible to use an Arduino library, a new pseudomodule arduino_lib is introduced. This pseudomodule enables implicitly module arduino but avoids that a sketch is required or generated and compiled. Thus, it is possible to compile and use a package or directory with some source files from an Arduino library in RIOT applications.
Arduino is always enabling C++11 support, so sketches and libs are depending on
it. Every C++ compiler has been enabling C++11 by default for some years now.
Still, Ubuntu's avr-gcc is so **horrible** out of date, that it is not enabled
there. As a simple work around, -std=c++11 is now passed to the C++ compiler if
Arduino is used.
Arduino libraries often include Arduino.h. For source code compatibility this header file is required. Header guards in file arduino.hpp had to be renamed.
This is quick solution to avoid wrapping around after 4294967 milliseconds.
It uses xtimer_now_usec64 instead of xtimer_now_usec.
Notice that this is more expansive than the previous solution, especially
on AVR systems.
llvm-ar behaves weidly when creating thin archive. This only manifests
itself when using arduino sketches as these are built from the "bin"
directory.
Specifically, given a directory "m" and an object in "m/obj.o " an
invocation with CWD==m:
```
llvm-ar rcTs ../m.a obj.o
```
Will create a maformed archive. Binutils does not have any issue with this.
The following command, executed with CWD==m/.. works:
```
llvm-ar rcTs m.a m/obj.o
```
The trick used in this commit is to put the source files in a different
directory than the object files and compile from there.
- Serial.print() and Serial.println() have been extended to support:
- unsigned int
- long
- unsigned long
- The SerialFormat BIN has been implemented
- Serial.println(void) has been added