-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be extra explicit with include guards.
I believe that this is only a problem for Arduino because Arduino brings in header files that are not actually #included. This solution is a little bit of a hack because it should not be necessary to add this extra #ifndef, but it solves the problem and it should be mostly harmless for users that do not target Arduino.
- Loading branch information
1 parent
6c3a1b8
commit 9b7d3fb
Showing
4 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
target C { | ||
platform: { | ||
name: "arduino", | ||
board: "arduino:avr:mega" | ||
} | ||
} | ||
|
||
reactor Blinker { | ||
input in_port:bool | ||
|
||
reaction(startup) {= | ||
pinMode(LED_BUILTIN, OUTPUT); | ||
=} | ||
|
||
reaction(in_port) {= | ||
digitalWrite(LED_BUILTIN, in_port->value ? HIGH : LOW); | ||
=} | ||
} | ||
|
||
reactor Timer { | ||
timer t1(0, 500 msec) | ||
state on_off:bool = false | ||
output out_port:bool | ||
|
||
reaction (t1) -> out_port {= | ||
self->on_off = !self->on_off; | ||
lf_set(out_port, self->on_off); | ||
=} | ||
} | ||
|
||
main reactor { | ||
the_blinker = new Blinker() | ||
the_timer = new Timer() | ||
the_timer.out_port -> the_blinker.in_port; | ||
} |