1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00

Merge pull request #21039 from mguetschow/arduino-fixes

Arduino support layer: several fixes
This commit is contained in:
Marian Buschsieweke 2024-11-25 20:56:24 +00:00 committed by GitHub
commit c91aee08ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View File

@ -7,7 +7,8 @@
"files.insertFinalNewline": true,
"files.associations": {
"Makefile.*": "makefile",
"*.mk": "makefile"
"*.mk": "makefile",
"*.sketch": "cpp"
},
"[shellscript][c][cpp]": {
"editor.tabSize": 4,

View File

@ -60,6 +60,13 @@ extern "C" {
#define ARDUINO_I2C_UNO I2C_DEV(0)
/** @} */
/**
* @name on-board LED (LED1/D25)
* @{
*/
#define ARDUINO_LED (24)
/** @} */
/**
* @name Mapping of MCU pins to Arduino pins
* @{

View File

@ -10,6 +10,7 @@ BOARD ?= native
RIOTBASE ?= $(CURDIR)/../..
USEMODULE += arduino
USEMODULE += stdin
# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the

View File

@ -25,8 +25,9 @@
// Assign the default LED pin
int ledPin = ARDUINO_LED;
#define BUF_LEN 64
// input buffer for receiving chars on the serial port
int buf[64];
int buf[BUF_LEN];
// counter that counts the number of received chars
int count = 0;
@ -64,7 +65,7 @@ void loop(void)
count = 0;
}
// else we just remember the incoming char
else {
else if (count < BUF_LEN) {
buf[count++] = tmp;
}
}