aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/blinky.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/blinky.cpp b/examples/blinky.cpp
index fad71f8..751475e 100644
--- a/examples/blinky.cpp
+++ b/examples/blinky.cpp
@@ -6,18 +6,11 @@ void setup() {
pinMode(BOARD_LED_PIN, OUTPUT);
}
-int toggle = 1;
-
void loop() {
- // You could just use toggleLED() instead, but this illustrates
- // the use of digitalWrite():
- digitalWrite(BOARD_LED_PIN, toggle);
- toggle ^= 1;
+ togglePin(BOARD_LED_PIN);
delay(100);
}
-// Force init to be called *first*, i.e. before static object allocation.
-// Otherwise, statically allocated objects that need libmaple may fail.
__attribute__((constructor)) void premain() {
init();
}