diff --git a/examples/Breaks_1/Breaks_1.ino b/examples/Breaks_1/Breaks_1.ino deleted file mode 100644 index fbb7922..0000000 --- a/examples/Breaks_1/Breaks_1.ino +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - -} \ No newline at end of file diff --git a/examples/Breaks_1/SharedVariables.h b/examples/Breaks_1/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_1/Thread.inot b/examples/Breaks_1/Thread.inot deleted file mode 100644 index 0c86dce..0000000 --- a/examples/Breaks_1/Thread.inot +++ /dev/null @@ -1,23 +0,0 @@ -/* This fails to compile because it doesn't look like a - * declaration and a definition but rather like an attempt - * to overload myFunc with the same signature (again) - * resulting in a compile error. - */ - -int myFunc(int const a, int const b); - -void setup() -{ - -} - -void loop() -{ - static int c = 0; - c += myFunc(0,c); -} - -int myFunc(int const a, int const b) -{ - return (a + b); -} \ No newline at end of file diff --git a/examples/Breaks_2/Breaks_2.ino b/examples/Breaks_2/Breaks_2.ino deleted file mode 100644 index fbb7922..0000000 --- a/examples/Breaks_2/Breaks_2.ino +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - -} \ No newline at end of file diff --git a/examples/Breaks_2/SharedVariables.h b/examples/Breaks_2/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_2/Thread.inot b/examples/Breaks_2/Thread.inot deleted file mode 100644 index 0eff097..0000000 --- a/examples/Breaks_2/Thread.inot +++ /dev/null @@ -1,21 +0,0 @@ -/* This fails to compile because myEventHandler has the - * function signature of 'void Thread::myEventHandler(void)' - * and is a member function of 'class Thread' while - * attachInterrupt expects a function with the signature - * 'void myEventHandler(void)' - */ - -void myEventHandler() -{ - /* Do something. */ -} - -void setup() -{ - attachInterrupt(digitalPinToInterrupt(2), myEventHandler, CHANGE); -} - -void loop() -{ - -} diff --git a/examples/Breaks_3/Breaks_3.ino b/examples/Breaks_3/Breaks_3.ino deleted file mode 100644 index fbb7922..0000000 --- a/examples/Breaks_3/Breaks_3.ino +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - -} \ No newline at end of file diff --git a/examples/Breaks_3/SharedVariables.h b/examples/Breaks_3/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_3/Thread.inot b/examples/Breaks_3/Thread.inot deleted file mode 100644 index 6b2b2b4..0000000 --- a/examples/Breaks_3/Thread.inot +++ /dev/null @@ -1,15 +0,0 @@ -/* This fails to compile because in-class-initialisation of - * a static member variable is forbidden. - */ - -static int my_global_variable = 0; - -void setup() -{ - -} - -void loop() -{ - -} diff --git a/examples/Breaks_4/Breaks_4.ino b/examples/Breaks_4/Breaks_4.ino deleted file mode 100644 index fbb7922..0000000 --- a/examples/Breaks_4/Breaks_4.ino +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - -} \ No newline at end of file diff --git a/examples/Breaks_4/SharedVariables.h b/examples/Breaks_4/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_4/Thread.inot b/examples/Breaks_4/Thread.inot deleted file mode 100644 index 2588a25..0000000 --- a/examples/Breaks_4/Thread.inot +++ /dev/null @@ -1,47 +0,0 @@ -/* Breaks for all kind of stuff ... - */ - -/************************************************************************************** - * CONSTANTS - **************************************************************************************/ - -static byte constexpr LSM6DSOX_ADDRESS = 0x6A; -static byte constexpr LSM6DSOX_WHO_AM_I_REG = 0x0F; - -/************************************************************************************** - * GLOBAL VARIABLES - **************************************************************************************/ - -BusDevice lsm6dsox(Wire, LSM6DSOX_ADDRESS); - -/************************************************************************************** - * FUNCTIONS - **************************************************************************************/ - -byte lsm6dsox_read_reg(byte reg_addr) -{ - byte read_buf = 0; - lsm6dsox.wire().writeThenRead(®_addr, 1, &read_buf, 1); - return read_buf; -} - -/************************************************************************************** - * SETUP/LOOP - **************************************************************************************/ - -void setup() -{ - Serial.begin(9600); -} - -void loop() -{ - /* Sleep between 5 and 500 ms */ - rtos::ThisThread::sleep_for(rtos::Kernel::Clock::duration_u32(random(5,500))); - /* Try to read some data from the LSM6DSOX. */ - byte const who_am_i = lsm6dsox_read_reg(LSM6DSOX_WHO_AM_I_REG); - /* Print thread id and chip id value to serial. */ - char msg[64] = {0}; - snprintf(msg, sizeof(msg), "%s: LSM6DSOX[WHO_AM_I] = 0x%X", rtos::ThisThread::get_name(), who_am_i); - Serial.println(msg); -} diff --git a/examples/Breaks_5/Breaks_5.ino b/examples/Breaks_5/Breaks_5.ino deleted file mode 100644 index fbb7922..0000000 --- a/examples/Breaks_5/Breaks_5.ino +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - -} \ No newline at end of file diff --git a/examples/Breaks_5/SharedVariables.h b/examples/Breaks_5/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_5/Thread.inot b/examples/Breaks_5/Thread.inot deleted file mode 100644 index c430b03..0000000 --- a/examples/Breaks_5/Thread.inot +++ /dev/null @@ -1,19 +0,0 @@ -/* This fails to compile because myEventHandler is declared - * after setup/loop and currently there's not automatic prototype - * generation as done for the ino file. - */ - -void setup() -{ - attachInterrupt(digitalPinToInterrupt(2), myEventHandler, CHANGE); -} - -void loop() -{ - -} - -void myEventHandler() -{ - /* Do something. */ -} diff --git a/examples/Breaks_6/Breaks_6.ino b/examples/Breaks_6/Breaks_6.ino deleted file mode 100644 index 86b3bfa..0000000 --- a/examples/Breaks_6/Breaks_6.ino +++ /dev/null @@ -1,15 +0,0 @@ -/* This example is in fact expected to break, since we try - * to access a thread-private variable. - */ - -#include - -void setup() -{ - Thread.start(); -} - -void loop() -{ - int const my_var = var; -} diff --git a/examples/Breaks_6/SharedVariables.h b/examples/Breaks_6/SharedVariables.h deleted file mode 100644 index e69de29..0000000 diff --git a/examples/Breaks_6/Thread.inot b/examples/Breaks_6/Thread.inot deleted file mode 100644 index b31007b..0000000 --- a/examples/Breaks_6/Thread.inot +++ /dev/null @@ -1,11 +0,0 @@ -void setup() -{ - -} - -void loop() -{ - -} - -int var = 0;