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:
commit
c91aee08ea
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -7,7 +7,8 @@
|
||||
"files.insertFinalNewline": true,
|
||||
"files.associations": {
|
||||
"Makefile.*": "makefile",
|
||||
"*.mk": "makefile"
|
||||
"*.mk": "makefile",
|
||||
"*.sketch": "cpp"
|
||||
},
|
||||
"[shellscript][c][cpp]": {
|
||||
"editor.tabSize": 4,
|
||||
|
||||
@ -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
|
||||
* @{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user