From c247c54e79781771507d0062e6cfeecbcc946d3d Mon Sep 17 00:00:00 2001 From: jhchun Date: Thu, 25 Jun 2026 18:08:48 +0900 Subject: [PATCH] =?UTF-8?q?reb:=20=ED=8C=A8=ED=82=B7=20ADC=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=83=98=ED=94=8C=20=EC=88=98=2080~117=20?= =?UTF-8?q?=EC=A0=95=EC=9D=98=20=EB=B0=8F=20=EA=B2=80=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drivers/echo_adc/echo_adc.h | 2 +- src/parser.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/echo_adc/echo_adc.h b/src/drivers/echo_adc/echo_adc.h index 213e3a9..82ba6f9 100644 --- a/src/drivers/echo_adc/echo_adc.h +++ b/src/drivers/echo_adc/echo_adc.h @@ -8,7 +8,7 @@ #include -#define ECHO_ADC_MAX_SAMPLES 100 +#define ECHO_ADC_MAX_SAMPLES 117 int echo_adc_init(void); int echo_adc_wake(void); diff --git a/src/parser.c b/src/parser.c index 9827f84..fc1d1dc 100644 --- a/src/parser.c +++ b/src/parser.c @@ -45,6 +45,8 @@ #define PIEZO_CFG_AVG_DEFAULT 3 #define PIEZO_CFG_AVG_MAX 10 +#define PIEZO_CFG_SAMPLES_MIN 80 +#define PIEZO_CFG_SAMPLES_MAX 117 #define PIEZO_CFG_DELAY_MAX_US 50 #define PIEZO_POST_SELECT_SETTLE_US 500 #define PIEZO_AVG_INTER_BURST_GAP_US 500 @@ -98,7 +100,8 @@ static bool piezo_config_validate(const piezo_config_t *cfg) return false; } - if ((cfg->samples == 0U) || (cfg->samples > ECHO_ADC_MAX_SAMPLES)) + if ((cfg->samples < PIEZO_CFG_SAMPLES_MIN) || + (cfg->samples > PIEZO_CFG_SAMPLES_MAX)) { return false; }