aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test-serial-flush.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test-serial-flush.cpp')
-rw-r--r--examples/test-serial-flush.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/examples/test-serial-flush.cpp b/examples/test-serial-flush.cpp
deleted file mode 100644
index 409d1f9..0000000
--- a/examples/test-serial-flush.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Tests the "flush" Serial function.
- */
-
-#include <wirish/wirish.h>
-
-void setup() {
- Serial1.begin(9600);
- Serial1.println("Hello world!");
-}
-
-void loop() {
- Serial1.println("Waiting for multiple input...");
- while (Serial1.available() < 5)
- ;
- Serial1.println(Serial1.read());
- Serial1.println(Serial1.read());
- Serial1.flush();
-
- if (Serial1.available()) {
- Serial1.println("FAIL! Still had junk in the buffer...");
- }
-}
-
-// 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();
-}
-
-int main(void) {
- setup();
-
- while (true) {
- loop();
- }
- return 0;
-}