1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

72 Commits

Author SHA1 Message Date
a554738a0c
sys/arduino: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:45 +02:00
Benjamin Valentin
6e7d5ae2d3 codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
Marian Buschsieweke
8549ff2f7d
Merge pull request #17479 from gschorcht/cxxexflags_cpp+14
makefiles: use C++14 standard by default for C++ compilations
2022-01-17 13:42:41 +01:00
Gunar Schorcht
20dfe40330 sys: remove -std=c++11 2022-01-13 17:50:59 +01:00
Gunar Schorcht
2dcd761954 sys/arduino: enable arduino_serial_stdio if stdio_cdc_acm is used 2022-01-06 17:27:53 +01:00
Gunar Schorcht
725472cbc4 sys/arduino: add Serial over stdio support
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`.
2022-01-06 17:27:53 +01:00
Marian Buschsieweke
674fca2023
sys/arduino: use static_assert() instead of BUILD_BUG_ON() 2022-01-05 15:41:39 +01:00
Gunar Schorcht
ede5f9ebab sys/arduino: add assertion to gpio handling
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.
2021-12-27 11:38:05 +01:00
Leandro Lanzieri
8bcd7e53e8 sys/arduino/kconfig: use periph_uart 2021-12-15 10:31:19 +01:00
Leandro Lanzieri
004da59672
sys/ztimer/kconfig: enable xtimer compat only with timer backend
This also moves the selection of MODULE_ZTIMER_PERIPH_TIMER from
MODULE_ZTIMER_USEC to the visible symbol ZTIMER_USEC.
2021-12-02 09:38:06 +01:00
Gunar Schorcht
d00141b1d4 sys/arduino: update TwoWire class to new I2C API 2021-11-29 06:35:25 +01:00
Leandro Lanzieri
27a62efb63
sys/arduino/kconfig: do not imply arduino_pwm 2021-11-22 12:25:58 +01:00
Leandro Lanzieri
6769101c34
sys/arduino: add pseudomodule for the arduino_pwm feature 2021-11-22 12:25:58 +01:00
J. David Ibáñez
77df3eedbd sys/arduino: millis() expected to have C linkage
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.
2021-11-05 10:21:26 +01:00
Leandro Lanzieri
f64b166319
Merge pull request #16845 from MrKevinWeiss/pr/kconfig/supportstms
.murdock: Add nucleo boards to kconfig test
2021-11-01 09:55:22 +01:00
J. David Ibáñez
a651315fbe sys/arduino: add interrupts/noInterrupts
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
2021-10-28 15:59:48 +02:00
MrKevinWeiss
8140037e04
sys/arduino: Fix arduino_pwm Kconfig 2021-10-14 11:28:39 +02:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Marian Buschsieweke
2efc50be97
sys/arduino: update SPI class to new API 2021-09-01 21:38:40 +02:00
Jan Romann
b3d32fbc28
sys/arduino: fix ENABLE_DEBUG definition 2021-08-12 17:30:45 +02:00
MrKevinWeiss
652e4f41c1
cpp: Use modules for cpp and libstdcpp
Also add better error message when kconfig or make includes a .cpp without cpp module.
2021-07-02 15:11:10 +02:00
MrKevinWeiss
630f7a2102
sys/arduino: Add Kconfig model 2021-07-02 15:11:09 +02:00
MrKevinWeiss
6884927c3f
sys/arduino: Remove option
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.
2021-07-02 15:11:09 +02:00
746f56cc3f
sys/arduino: use ztimer as backend high-level timer 2021-06-17 10:23:21 +02:00
Marian Buschsieweke
45ed8bc330
sys/arduino: Bug and style fixes in SPI
- set is_transaction before releasing the SPI bus (and the mutex) to avoid
  data races
- adapt switch indent to coding convention
2021-02-02 09:45:46 +01:00
Marian Buschsieweke
45b8902659
Merge pull request #15314 from aabadie/pr/sys/arduino_print_float
sys/arduino: fix print float
2020-11-17 16:15:39 +01:00
Leandro Lanzieri
b2b704160e
sys/arduino: add module to Kconfig 2020-11-06 15:57:57 +01:00
1be6bd7567
sys/arduino: use fmt_float to print float values 2020-10-27 15:31:42 +01:00
eefcfd16e2
sys/arduino: fix typo 'adress' -> 'address' 2020-10-02 08:09:14 +02:00
Francisco Molina
e7a8c58de4
sys/arduino: include arduino_sketches in Makefile.dep 2020-06-25 11:02:02 +02:00
Gunar Schorcht
34555748dd sys/arduino: fix of compilation error with NDEBUG
When NDEBUG macro is defined during compilation, the assert macro produces empty code. Parameters or variables checked with assert are then unused.
2020-02-03 00:22:37 +01:00
c8b43b8ca4 sys/arduino: fix typos 2019-11-23 22:39:37 +01:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Gunar Schorcht
4b92ce289b sys/arduino: compilation of Arduino libraries
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.
2019-11-21 19:13:14 +01:00
Gunar Schorcht
e942338f78 sys/arduino: add type definitions often used
boolean and byte are data types defined in Arduino.h and very often used in Arduino code.
2019-11-21 17:22:38 +01:00
0845cac3b8
sys/arduino: provide implementation for analogWrite 2019-11-15 17:51:45 +01:00
fabian18
a8ff989db1 sys/arduino: Fixed frequency selection in SPI 2019-11-11 10:33:01 +01:00
Marian Buschsieweke
8a53e072f9
sys/arduino/doc: Removed SPI from ToDo
The SPI interface has been added, so it should no longer be listed on the ToDo
list.
2019-11-07 13:04:47 +01:00
Marian Buschsieweke
83a955fa49
sys/arduino/doc: Removed I2C from ToDo
The I2C (Wire) interface has been added, so it should no longer be listed on the
ToDo list.
2019-11-07 13:04:47 +01:00
Marian Buschsieweke
c449467125
sys/arduino: Enable C++11 support
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.
2019-11-07 13:04:47 +01:00
Marian Buschsieweke
cc50da690b
sys/arduino: Added SPI interface
Added an Arduino compatible SPI API on top of RIOT's SPI API.
2019-11-07 13:04:46 +01:00
Gunar Schorcht
3fc2c60f20 sys/arduino: add Wire (I2C) library implementation 2019-10-24 08:33:49 +02:00
Gunar Schorcht
1657606092 sys/arduino: add Arduino.h for compatibility
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.
2019-10-19 19:22:40 +02:00
c4bb2a2e17
sys/arduino: make ADC feature optional 2019-10-08 10:26:23 +02:00
Kees Bakker
d9e0c6c859 sys/arduino: use 64bit usec to compute millis()
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.
2019-09-19 19:52:43 +02:00
Gaëtan Harter
a1f0651170
Revert "sys/arduino: work around llvm-ar bug."
This reverts commit 72f934f13d.

Not required anymore as 'ar' is not executed in the object directory
anymore.
2019-09-16 15:52:36 +02:00
Juan Carrano
72f934f13d sys/arduino: work around llvm-ar bug.
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.
2019-09-10 17:53:07 +02:00
Kees Bakker
35c5869a2e
Merge pull request #12117 from maribu/arduino-println
sys/arduino: Extended Serial.print() / println()
2019-09-07 21:16:43 +02:00
Marian Buschsieweke
d4aeca7469
sys/arduino: Extended Serial.print() / println()
- 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
2019-09-04 21:36:20 +02:00
Marian Buschsieweke
8cff47304b
sys/arduino: Make use of US_PER_MS in delay() 2019-08-29 13:57:56 +02:00