| 248 | } |
| 249 | |
| 250 | bool ParlioPeripheralESPImpl::enable() FL_NOEXCEPT { |
| 251 | FL_LOG_PARLIO("PARLIO_PERIPH: enable() called"); |
| 252 | if (mTxUnit == nullptr) { |
| 253 | FL_LOG_PARLIO("PARLIO_PERIPH: FAILED enable - not initialized"); |
| 254 | FL_WARN("ParlioPeripheralESP: Cannot enable - not initialized"); |
| 255 | return false; |
| 256 | } |
| 257 | |
| 258 | // Delegate to ESP-IDF |
| 259 | FL_LOG_PARLIO("PARLIO_PERIPH: Calling parlio_tx_unit_enable()"); |
| 260 | esp_err_t err = parlio_tx_unit_enable(mTxUnit); |
| 261 | if (err != ESP_OK) { |
| 262 | FL_WARN("ParlioPeripheralESP: Failed to enable TX unit: " |
| 263 | << esp_err_to_name(err) << " (" << err << ")"); |
| 264 | return false; |
| 265 | } |
| 266 | |
| 267 | mEnabled = true; |
| 268 | FL_LOG_PARLIO("PARLIO_PERIPH: enable() SUCCESS"); |
| 269 | return true; |
| 270 | } |
| 271 | |
| 272 | bool ParlioPeripheralESPImpl::disable() FL_NOEXCEPT { |
| 273 | if (mTxUnit == nullptr) { |
no test coverage detected