Exemplo n.º 1
0
void ButtonIO::update() {
    int value = digitalRead(_pin);
    int i = 0;
    for (; i < 3; i++) {
        Action &action = _actions[i];

        // Is set
        if (action.pin > -1) {
            
            switch(action.type) {
                case TypePressed:
                    handle_pressed(action, value);
                    break;
                case TypeHold:
                    handle_hold(action, value);
                    break;
                case TypeBetween:
                    handle_between(action, value);
                    break;
            }
            
            action.lastState = value;
        }
    }
}
Exemplo n.º 2
0
/*
    callback called at the end of DVENA pulse
*/
void ti_fdc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
	m_DVENA = CLEAR_LINE;
	handle_hold();
}