| 209 | } |
| 210 | |
| 211 | void Arduino::timerThreadFunc() |
| 212 | { |
| 213 | while (timer_running_) |
| 214 | { |
| 215 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
| 216 | if (!is_open_) |
| 217 | continue; |
| 218 | |
| 219 | bool arduino_enable_keys_local; |
| 220 | { |
| 221 | arduino_enable_keys_local = config.arduino_enable_keys; |
| 222 | } |
| 223 | |
| 224 | if (arduino_enable_keys_local || protocol_ == ArduinoProtocol::Teensy41) |
| 225 | { |
| 226 | if (!listening_) |
| 227 | { |
| 228 | startListening(); |
| 229 | } |
| 230 | } |
| 231 | else |
| 232 | { |
| 233 | if (listening_) |
| 234 | { |
| 235 | listening_ = false; |
| 236 | if (listening_thread_.joinable()) |
| 237 | { |
| 238 | listening_thread_.join(); |
| 239 | } |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | void Arduino::startListening() |
| 246 | { |
nothing calls this directly
no outgoing calls
no test coverage detected