#pragma once
#include <cstdint>
#include <cstring>

// vTaskDelay(0) leaves a high-priority task runnable. The idle sender must
// actually block so the lower-priority physical-input loop can run.
constexpr uint32_t input_sender_idle_ticks(uint32_t converted_ticks)
{
    return converted_ticks ? converted_ticks : 1;
}

// Progress is cumulative, and a later ACK supersedes a failed one. A failed
// stop packet must not create a new error modal after playback was stopped.
inline bool input_sender_best_effort_control(const char* type) {
    return type && (!std::strcmp(type,"speech_progress") || !std::strcmp(type,"speech_stop"));
}
