diff options
Diffstat (limited to 'testhal/STM32/I2C/main.c')
-rw-r--r-- | testhal/STM32/I2C/main.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testhal/STM32/I2C/main.c b/testhal/STM32/I2C/main.c index 793f73f49..ce8cb5522 100644 --- a/testhal/STM32/I2C/main.c +++ b/testhal/STM32/I2C/main.c @@ -29,6 +29,23 @@ +/*
+ * Red LEDs blinker thread, times are in milliseconds.
+ */
+static WORKING_AREA(BlinkWA, 128);
+static msg_t Blink(void *arg) {
+ (void)arg;
+ while (TRUE) {
+ palClearPad(IOPORT3, GPIOC_LED);
+ chThdSleepMilliseconds(500);
+ palSetPad(IOPORT3, GPIOC_LED);
+ chThdSleepMilliseconds(500);
+ }
+ return 0;
+}
+
+
+
/* Temperature polling thread */
static WORKING_AREA(PollTmp75ThreadWA, 128);
static msg_t PollTmp75Thread(void *arg) {
@@ -110,6 +127,8 @@ int main(void) { PollAccelThread,
NULL);
+ /* Creates the blinker thread. */
+ chThdCreateStatic(BlinkWA, sizeof(BlinkWA), LOWPRIO, Blink, NULL);
/* main loop that do nothing */
while (TRUE) {
|