diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-03-04 20:25:26 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-03-04 23:16:32 -0500 |
commit | 02e76ec27b5737bce836a5460427b538076f01ef (patch) | |
tree | 30fb1f21caba0504ff414edc853474f0d365f790 /examples/test-serial-flush.cpp | |
parent | 7973deea3908f4f865f59c5e2df1eef6810cc70e (diff) | |
download | librambutan-02e76ec27b5737bce836a5460427b538076f01ef.tar.gz librambutan-02e76ec27b5737bce836a5460427b538076f01ef.zip |
Brought examples/ up to date; PIN_MAP bugfix for D24.
Diffstat (limited to 'examples/test-serial-flush.cpp')
-rw-r--r-- | examples/test-serial-flush.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/examples/test-serial-flush.cpp b/examples/test-serial-flush.cpp index d7fbf7a..1cd82b6 100644 --- a/examples/test-serial-flush.cpp +++ b/examples/test-serial-flush.cpp @@ -2,22 +2,13 @@ #include "wirish.h" -void setup() -{ +void setup() { /* Send a message out USART2 */ Serial2.begin(9600); Serial2.println("Hello world!"); } -int toggle = 0; - void loop() { - - Serial2.println("This is the first line."); - Serial2.end(); - Serial2.println("This is the second line."); - - Serial2.begin(9600); Serial2.println("Waiting for multiple input..."); while(Serial2.available() < 5) { } Serial2.println(Serial2.read()); @@ -29,13 +20,12 @@ void loop() { } // Force init to be called *first*, i.e. before static object allocation. -// Otherwise, statically allocated object that need libmaple may fail. - __attribute__(( constructor )) void premain() { +// Otherwise, statically allocated objects that need libmaple may fail. +__attribute__((constructor)) void premain() { init(); } -int main(void) -{ +int main(void) { setup(); while (1) { |