Всякие тесты неинтересные
This commit is contained in:
@@ -88,6 +88,19 @@ bool PulseReceiver::start(uint32_t expectedHz, float expectedDutyPct,
|
||||
return startCapture(false);
|
||||
}
|
||||
|
||||
bool PulseReceiver::startRaw() {
|
||||
if (!queue_ || running_) return false;
|
||||
#if OPTICAL_USE_MCPWM_CAPTURE
|
||||
if (!captureTimer_) return false;
|
||||
#endif
|
||||
#if !OPTICAL_USE_MCPWM_CAPTURE
|
||||
cpuTickHz_ = getCpuFrequencyMhz() * 1000000UL;
|
||||
if (!cpuTickHz_) return false;
|
||||
#endif
|
||||
resetStream();
|
||||
return startCapture(false);
|
||||
}
|
||||
|
||||
#if OPTICAL_USE_MCPWM_CAPTURE
|
||||
bool PulseReceiver::configureDriverTxCapture(bool risingEdge) {
|
||||
if (running_) return false;
|
||||
@@ -376,6 +389,18 @@ size_t PulseReceiver::readPeriods(PulsePeriod *periods, size_t capacity,
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t PulseReceiver::readRawEdges(CaptureEvent *events, size_t capacity,
|
||||
TickType_t waitTicks) {
|
||||
if (!events || !capacity) return 0;
|
||||
size_t count = 0;
|
||||
Edge edge = {};
|
||||
while (count < capacity && nextOrderedEdge(edge, count ? 0 : waitTicks)) {
|
||||
const TimedEdge timed = extendEdge(edge);
|
||||
events[count++] = {timed.tick, timed.rising, CaptureSource::RX};
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t PulseReceiver::readEvents(CaptureEvent *events, size_t capacity,
|
||||
TickType_t waitTicks) {
|
||||
if (!events || capacity < 3U || !txCaptureEnabled_ || !driverPulseTicks_ ||
|
||||
|
||||
Reference in New Issue
Block a user