Skip to content

Commit

Permalink
Revert "Fix CommandHandler semaphore initialization (#135)"
Browse files Browse the repository at this point in the history
This reverts commit e5ca8bf.
  • Loading branch information
LucHeart authored Jan 22, 2024
1 parent 62e855c commit e0bda5f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ bool CommandHandler::Init() {
return true;
}

// Initialize semaphores
s_rfTransmitterSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive(s_rfTransmitterSemaphore);
s_keepAliveSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive(s_keepAliveSemaphore);

auto& rfConfig = Config::GetRFConfig();

std::uint8_t txPin = rfConfig.txPin;
Expand All @@ -172,13 +166,17 @@ bool CommandHandler::Init() {
return false;
}

s_rfTransmitterSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive(s_rfTransmitterSemaphore);
s_rfTransmitter = std::make_unique<RFTransmitter>(txPin, 32);
if (!s_rfTransmitter->ok()) {
ESP_LOGE(TAG, "Failed to initialize RF Transmitter");
s_rfTransmitter = nullptr;
return false;
}

s_keepAliveSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive(s_keepAliveSemaphore);
if (rfConfig.keepAliveEnabled) {
_internalSetKeepAliveEnabled(true);
}
Expand Down

0 comments on commit e0bda5f

Please sign in to comment.