Skip to content

Commit 3b42864

Browse files
Includeガードの競合問題を解消
1 parent d43db52 commit 3b42864

File tree

12 files changed

+51
-20
lines changed

12 files changed

+51
-20
lines changed

ArduinOS/Samples/Blink/Blink.ino

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
DeclareTaskLoop(SerialTask);
3+
4+
void setup() {
5+
Serial.begin(19200);
6+
7+
pinMode(13, OUTPUT);
8+
9+
CreateTaskLoop(SerialTask, HIGH_PRIORITY);
10+
11+
12+
13+
}
14+
15+
void loop() {
16+
digitalWrite(13, HIGH);
17+
delay(1000);
18+
19+
digitalWrite(13, LOW);
20+
delay(1000);
21+
}
22+
23+
TaskLoop(SerialTask){
24+
25+
Serial.println(millis());
26+
DelayWithBlocked(1000);
27+
28+
}
29+

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/ArduinOS.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
// MegaOSからArduinOSへ名称変更
100100
// mainLoopTaskの優先度, およびスタックサイズをスケッチ内で変更できるようにした
101101
//
102+
// 2017/11/1:
103+
// Includeガードにかかりやすい問題を修正
102104
*/
103105

104106
/*

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/List.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ engineered and independently SIL3 certified version for use in safety and
8585
mission critical applications that require provable dependability.
8686
*/
8787

88-
#ifndef LIST_H
89-
#define LIST_H
88+
#ifndef ARDUINOS_LIST_H
89+
#define ARDUINOS_LIST_H
9090

9191
#ifdef __cplusplus
9292
extern "C" {

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/Malloc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
#ifndef MALLOC_H
3-
#define MALLOC_H
2+
#ifndef ARDUINOS_MALLOC_H
3+
#define ARDUINOS_MALLOC_H
44

55
#ifdef __cplusplus
66
extern "C" {

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/MallocOverride.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
#ifndef MALLOC_OVERRIDE_H
3-
#define MALLOC_OVERRIDE_H
2+
#ifndef ARDUINOS_MALLOC_OVERRIDE_H
3+
#define ARDUINOS_MALLOC_OVERRIDE_H
44

55
#include "Malloc.h"
66

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/PortMacro.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ mission critical applications that require provable dependability.
9090
// ---------------------------------------------------------
9191

9292

93-
#ifndef PORTMACRO_H
94-
#define PORTMACRO_H
93+
#ifndef ARDUINOS_PORTMACRO_H
94+
#define ARDUINOS_PORTMACRO_H
9595

9696
// C言語でコンパイルするように宣言
9797
// 関数が正しくリンクされるようにするため.

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/Portable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ mission critical applications that require provable dependability.
8585
*/
8686

8787

88-
#ifndef PORTABLE_H
89-
#define PORTABLE_H
88+
#ifndef ARDUINOS_PORTABLE_H
89+
#define ARDUINOS_PORTABLE_H
9090

9191
#include "PortMacro.h"
9292

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/ProjDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ engineered and independently SIL3 certified version for use in safety and
8585
mission critical applications that require provable dependability.
8686
*/
8787

88-
#ifndef PROJDEFS_H
89-
#define PROJDEFS_H
88+
#ifndef ARDUINOS_PROJDEFS_H
89+
#define ARDUINOS_PROJDEFS_H
9090

9191
//タスク関数が従うプロトタイプ
9292
//Defines the prototype to which task functions must conform

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/Queue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ mission critical applications that require provable dependability.
8686
*/
8787

8888

89-
#ifndef QUEUE_H
90-
#define QUEUE_H
89+
#ifndef ARDUINOS_QUEUE_H
90+
#define ARDUINOS_QUEUE_H
9191

9292
#ifndef ARDUINOS_H
9393
#error "include ArduinOS.h" must appear in source files before "include Queue.h"

ArduinOS/hardware/avr/cores/arduino.ArduinOS/ArduinOS/Semaphore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ engineered and independently SIL3 certified version for use in safety and
8585
mission critical applications that require provable dependability.
8686
*/
8787

88-
#ifndef SEMAPHORE_H
89-
#define SEMAPHORE_H
88+
#ifndef ARDUINOS_SEMAPHORE_H
89+
#define ARDUINOS_SEMAPHORE_H
9090

9191
#ifndef ARDUINOS_H
9292
#error "include ArduinOS.h" must appear in source files before "include Semaphore.h"

0 commit comments

Comments
 (0)