You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
489 B
26 lines
489 B
4 years ago
|
#include <M5StickC.h>
|
||
|
#include "Kernel.h"
|
||
|
|
||
|
int UserInput(int pid, unsigned int signal)
|
||
|
{
|
||
|
Serial.println("UserInput called");
|
||
|
if (signal & SIGNAL_START)
|
||
|
{
|
||
|
Kernel_signal_mask(pid, SIGNAL_START | SIGNAL_STOP | SIGNAL_TICK);
|
||
|
}
|
||
|
if (signal & SIGNAL_TICK)
|
||
|
{
|
||
|
if (Kernel_read_input(KERNEL_INPUT_BUTTON_A))
|
||
|
{
|
||
|
Kernel_signal(SIGNAL_INPUT_A);
|
||
|
}
|
||
|
|
||
|
if (Kernel_read_input(KERNEL_INPUT_BUTTON_B))
|
||
|
{
|
||
|
Kernel_signal(SIGNAL_INPUT_B);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|