enforce following lf config
This commit is contained in:
@@ -61,7 +61,7 @@ size_t lf_count_edge_periods_ex(size_t max, bool wait, bool detect_gap) {
|
||||
adc_val = AT91C_BASE_SSC->SSC_RHR;
|
||||
periods++;
|
||||
|
||||
if (logging) logSample(adc_val, 1, 8, 0);
|
||||
if (logging) logSampleSimple(adc_val);
|
||||
|
||||
// Only test field changes if state of adc values matter
|
||||
if (!wait) {
|
||||
@@ -91,7 +91,7 @@ size_t lf_count_edge_periods_ex(size_t max, bool wait, bool detect_gap) {
|
||||
if (periods == max) return 0;
|
||||
}
|
||||
}
|
||||
if (logging) logSample(255, 1, 8, 0);
|
||||
if (logging) logSampleSimple(0xFF);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -206,14 +206,13 @@ size_t lf_detect_field_drop(size_t max) {
|
||||
}
|
||||
++checked;
|
||||
|
||||
// Watchdog hit
|
||||
WDT_HIT();
|
||||
|
||||
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
||||
periods++;
|
||||
adc_val = AT91C_BASE_SSC->SSC_RHR;
|
||||
|
||||
if (logging) logSample(adc_val, 1, 8, 0);
|
||||
if (logging) logSampleSimple(adc_val);
|
||||
|
||||
if (adc_val == 0) {
|
||||
rising_edge = false;
|
||||
|
||||
@@ -138,6 +138,10 @@ uint32_t getSampleCounter() {
|
||||
return samples.total_saved;
|
||||
}
|
||||
|
||||
void logSampleSimple(uint8_t sample) {
|
||||
logSample(sample, config.decimation, config.bits_per_sample, config.averaging);
|
||||
}
|
||||
|
||||
void logSample(uint8_t sample, uint8_t decimation, uint8_t bits_per_sample, bool avg) {
|
||||
|
||||
if (!data.buffer) return;
|
||||
|
||||
@@ -70,6 +70,7 @@ uint32_t DoAcquisition_config(bool verbose, uint32_t sample_size);
|
||||
* Refactoring of lf sampling buffer
|
||||
*/
|
||||
void initSampleBuffer(uint32_t *sample_size);
|
||||
void logSampleSimple(uint8_t sample);
|
||||
void logSample(uint8_t sample, uint8_t decimation, uint8_t bits_per_sample, bool avg);
|
||||
uint32_t getSampleCounter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user