Closed
Description
It would be great to be able to add an optional void (*arg)
argument to onRun and have that passed to your callback.
(poorly written) example
void shutoff(void (*arg)) {
uint8_t *pin = (uint8_t*)arg;
digitalWrite(pin, LOW);
}
void setup() {
Thread t1 = Thread();
t1.onRun(shutoff, 1);
Thread t1 = Thread();
t1.onRun(shutoff, 2);
}
This will dramatically simplify code by not requiring individual callbacks for each thread that perform the same function.
Metadata
Metadata
Assignees
Labels
No labels