MCPcopy Create free account
hub / github.com/Santroller/Santroller / toggle

Method toggle

src/devices/toggle.cpp:21–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void 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
34bool ToggleDevice::using_pin(uint8_t pin)
35{

Callers 1

tickDigitalMethod · 0.80

Calls 2

millisFunction · 0.85
update_aux_toggleFunction · 0.85

Tested by

no test coverage detected