1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-09 23:02:23 +01:00

Fix clang-tidy header filter (#2385)

* Fix clang-tidy header filter

* Allow private members

* Fix clang-tidy detections

* Run clang-format

* Fix remaining detections

* Fix graph

* Run clang-format
This commit is contained in:
Otto Winter
2021-09-24 18:02:28 +02:00
committed by GitHub
parent 52dd79691b
commit aec02afcdc
76 changed files with 404 additions and 367 deletions

View File

@@ -26,33 +26,33 @@ namespace esp32_ble_tracker {
template<class T> class Queue {
public:
Queue() { m = xSemaphoreCreateMutex(); }
Queue() { m_ = xSemaphoreCreateMutex(); }
void push(T *element) {
if (element == nullptr)
return;
if (xSemaphoreTake(m, 5L / portTICK_PERIOD_MS)) {
q.push(element);
xSemaphoreGive(m);
if (xSemaphoreTake(m_, 5L / portTICK_PERIOD_MS)) {
q_.push(element);
xSemaphoreGive(m_);
}
}
T *pop() {
T *element = nullptr;
if (xSemaphoreTake(m, 5L / portTICK_PERIOD_MS)) {
if (!q.empty()) {
element = q.front();
q.pop();
if (xSemaphoreTake(m_, 5L / portTICK_PERIOD_MS)) {
if (!q_.empty()) {
element = q_.front();
q_.pop();
}
xSemaphoreGive(m);
xSemaphoreGive(m_);
}
return element;
}
protected:
std::queue<T *> q;
SemaphoreHandle_t m;
std::queue<T *> q_;
SemaphoreHandle_t m_;
};
// Received GAP and GATTC events are only queued, and get processed in the main loop().
@@ -87,12 +87,12 @@ class BLEEvent {
};
union {
struct gap_event {
struct gap_event { // NOLINT(readability-identifier-naming)
esp_gap_ble_cb_event_t gap_event;
esp_ble_gap_cb_param_t gap_param;
} gap;
struct gattc_event {
struct gattc_event { // NOLINT(readability-identifier-naming)
esp_gattc_cb_event_t gattc_event;
esp_gatt_if_t gattc_if;
esp_ble_gattc_cb_param_t gattc_param;