MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / hasScanThread

Method hasScanThread

Tactility/Source/app/i2cscanner/I2cScanner.cpp:257–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257bool I2cScannerApp::hasScanThread() {
258 bool has_thread;
259 if (mutex.lock(100 / portTICK_PERIOD_MS)) {
260 has_thread = scanTimer != nullptr;
261 mutex.unlock();
262 return has_thread;
263 } else {
264 // Unsafe way
265 logger.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "hasScanTimer");
266 return scanTimer != nullptr;
267 }
268}
269
270void I2cScannerApp::startScanning() {
271 if (hasScanThread()) {

Callers

nothing calls this directly

Calls 3

warnMethod · 0.80
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected