add button stuff and timer stuff
This commit is contained in:
44
disabled/testTask.c-disabled
Normal file
44
disabled/testTask.c-disabled
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* testTask.c
|
||||
*
|
||||
* Created on: 29.08.2016
|
||||
* Author: wn
|
||||
*/
|
||||
|
||||
#include "gpio.h"
|
||||
#include "testTask.h"
|
||||
#include "PontCoopScheduler.h"
|
||||
|
||||
|
||||
void testTaskInit(void *handleArg, tPin pin) {
|
||||
tTestTaskHandle *handle = handleArg;
|
||||
handle->pin = pin;
|
||||
handle->toggle = 0;
|
||||
}
|
||||
|
||||
|
||||
void testTaskSwitchOff(void *handleArg) {
|
||||
tTestTaskHandle *handle = handleArg;
|
||||
|
||||
if (handle->toggle == 0) {
|
||||
handle->toggle = 1;
|
||||
gpioSetPin(handle->pin, HIGH);
|
||||
} else {
|
||||
handle->toggle = 0;
|
||||
gpioSetPin(handle->pin, LOW);
|
||||
}
|
||||
}
|
||||
|
||||
void testTaskExec(void *handleArg) {
|
||||
tTestTaskHandle *handle = handleArg;
|
||||
if (handle->toggle == 0) {
|
||||
handle->toggle = 1;
|
||||
gpioSetPin(handle->pin, HIGH);
|
||||
} else {
|
||||
handle->toggle = 0;
|
||||
gpioSetPin(handle->pin, LOW);
|
||||
}
|
||||
|
||||
schAdd(testTaskSwitchOff, handle, 5, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user