Skip to content

Commit

Permalink
Fix log calls and include order
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Sep 6, 2024
1 parent b4a5c52 commit d3afc51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/visual/MonoLedDriver.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <freertos/FreeRTOS.h>

#include "visual/MonoLedDriver.h"

const char* const TAG = "MonoLedDriver";
Expand All @@ -19,12 +21,12 @@ using namespace OpenShock;

MonoLedDriver::MonoLedDriver(gpio_num_t gpioPin) : m_gpioPin(GPIO_NUM_NC), m_pattern(), m_taskHandle(nullptr), m_taskMutex(xSemaphoreCreateMutex()) {
if (gpioPin == GPIO_NUM_NC) {
ESP_LOGE(TAG, "Pin is not set");
OS_LOGE(TAG, "Pin is not set");
return;
}

if (!IsValidOutputPin(gpioPin)) {
ESP_LOGE(TAG, "Pin %d is not a valid output pin", gpioPin);
OS_LOGE(TAG, "Pin %d is not a valid output pin", gpioPin);
return;
}

Expand Down Expand Up @@ -74,7 +76,7 @@ void MonoLedDriver::SetPattern(const State* pattern, std::size_t patternLength)
// Start the task
BaseType_t result = TaskUtils::TaskCreateUniversal(&Util::FnProxy<&MonoLedDriver::RunPattern>, name, 1024, this, 1, &m_taskHandle, 1); // PROFILED: 0.5KB stack usage
if (result != pdPASS) {
ESP_LOGE(TAG, "[pin-%u] Failed to create task: %d", m_gpioPin, result);
OS_LOGE(TAG, "[pin-%u] Failed to create task: %d", m_gpioPin, result);

m_taskHandle = nullptr;
m_pattern.clear();
Expand Down

0 comments on commit d3afc51

Please sign in to comment.