fix build (and autoformat in visual studio code)

This commit is contained in:
geeksville 2020-03-15 17:50:48 -07:00
parent 30a431788d
commit 5037fb830e

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <FreeRTOS/FreeRTOS.h> #include <freertos/FreeRTOS.h>
#include <FreeRTOS/semphr.h> #include <freertos/semphr.h>
namespace meshtastic namespace meshtastic
{ {
@ -9,11 +9,11 @@ namespace meshtastic
// Simple wrapper around FreeRTOS API for implementing a mutex lock. // Simple wrapper around FreeRTOS API for implementing a mutex lock.
class Lock class Lock
{ {
public: public:
Lock(); Lock();
Lock(const Lock&) = delete; Lock(const Lock &) = delete;
Lock& operator=(const Lock&) = delete; Lock &operator=(const Lock &) = delete;
/// Locks the lock. /// Locks the lock.
// //
@ -25,23 +25,22 @@ class Lock
// Must not be called from an ISR. // Must not be called from an ISR.
void unlock(); void unlock();
private: private:
SemaphoreHandle_t handle; SemaphoreHandle_t handle;
}; };
// RAII lock guard. // RAII lock guard.
class LockGuard class LockGuard
{ {
public: public:
LockGuard(Lock *lock); LockGuard(Lock *lock);
~LockGuard(); ~LockGuard();
LockGuard(const LockGuard&) = delete; LockGuard(const LockGuard &) = delete;
LockGuard& operator=(const LockGuard&) = delete; LockGuard &operator=(const LockGuard &) = delete;
private: private:
Lock* lock; Lock *lock;
}; };
} // namespace meshtastic } // namespace meshtastic