попытки запустится до 1 МГц
This commit is contained in:
@@ -18,8 +18,9 @@ class PulseReceiver {
|
||||
bool start(uint32_t expectedHz);
|
||||
void stop();
|
||||
void resetStream();
|
||||
bool poll(PulsePeriod &period);
|
||||
size_t readPeriods(PulsePeriod *periods, size_t capacity);
|
||||
bool overflowed();
|
||||
uint32_t takeDroppedItems();
|
||||
uint32_t tickHz() const;
|
||||
uint16_t receiveChunkSymbols() const { return receiveChunkSymbols_; }
|
||||
bool highRateBackend() const {
|
||||
@@ -34,13 +35,14 @@ class PulseReceiver {
|
||||
bool consumeEdge(const Edge &edge, PulsePeriod &period);
|
||||
|
||||
#if OPTICAL_USE_RMT_DMA
|
||||
static constexpr size_t BLOCK_SYMBOLS = 64;
|
||||
static constexpr size_t BLOCK_SYMBOLS = RMT_MAX_RECEIVE_SYMBOLS;
|
||||
struct SymbolBlock { uint16_t count; rmt_symbol_word_t symbols[BLOCK_SYMBOLS]; };
|
||||
static bool IRAM_ATTR onRmt(rmt_channel_handle_t, const rmt_rx_done_event_data_t *, void *);
|
||||
bool nextRmtEdge(Edge &edge);
|
||||
rmt_channel_handle_t channel_ = nullptr;
|
||||
rmt_symbol_word_t receiveBuffer_[RMT_MAX_RECEIVE_SYMBOLS];
|
||||
uint16_t receiveChunkSymbols_ = 0;
|
||||
SymbolBlock isrBlock_ = {};
|
||||
SymbolBlock block_ = {};
|
||||
uint16_t blockIndex_ = 0;
|
||||
uint8_t phase_ = 0;
|
||||
@@ -53,6 +55,7 @@ class PulseReceiver {
|
||||
#endif
|
||||
QueueHandle_t queue_ = nullptr;
|
||||
volatile bool overflow_ = false;
|
||||
volatile uint32_t droppedItems_ = 0;
|
||||
bool running_ = false;
|
||||
bool haveRise_ = false, haveFall_ = false, haveRawTick_ = false;
|
||||
uint32_t lastRawTick_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user