static void mag_approach_interrupt_handler(void *para)
{
    GroveMagneticSwitch *g = (GroveMagneticSwitch *)para;
    if (millis() - g->time < 10)
    {
        return;
    }
    g->time = millis();
    suli_event_trigger(g->event, "mag_approached", *(g->io));
}
static void button_interrupt_handler(void *para)
{
    GroveButton *g = (GroveButton *)para;
    if (millis() - g->time < 10)
    {
        return;
    }
    g->time = millis();
    suli_event_trigger(g->event, "button_pressed", *(g->io));
}
Ejemplo n.º 3
0
static void pin_interrupt_handler(void *para)
{
    GroveExample *g = (GroveExample *)para;

    suli_event_trigger(g->event1, *(g->pin));
}
static void approach_interrupt_handler(void *para)
{
    GroveIRDistanceInterrupter *g = (GroveIRDistanceInterrupter *)para;

    suli_event_trigger(g->event, "ir_approached", *(g->io));
}