| 19 | } |
| 20 | |
| 21 | void ToggleDevice::toggle() |
| 22 | { |
| 23 | if (millis() - m_last < 100) { |
| 24 | return; |
| 25 | } |
| 26 | m_last = millis(); |
| 27 | m_current_value = !m_current_value; |
| 28 | proto_Event event = {which_event : proto_Event_toggle_tag, event : {toggle : {m_id, m_current_value}}}; |
| 29 | HIDConfigDevice::send_event(event, true); |
| 30 | printf("toggle updated: %d %d\r\n", m_id, m_current_value); |
| 31 | update_aux_toggle(m_id, m_current_value); |
| 32 | } |
| 33 | |
| 34 | bool ToggleDevice::using_pin(uint8_t pin) |
| 35 | { |
no test coverage detected