From f8181a10d1aac8e5ac9824aa7809ba8d46d33a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 22 Feb 2018 13:46:21 +0100 Subject: [PATCH] fix a bug in fcap conf --- units/fcap/_fcap_settings.c | 2 +- units/fcap/unit_fcap.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/units/fcap/_fcap_settings.c b/units/fcap/_fcap_settings.c index 9d61a66..c6ba14b 100644 --- a/units/fcap/_fcap_settings.c +++ b/units/fcap/_fcap_settings.c @@ -100,7 +100,7 @@ void UFCAP_writeIni(Unit *unit, IniWriter *iw) iw_entry(iw, "active-level", "%d", (int)priv->conf.active_level); iw_comment(iw, "Input filtering (0-15)"); - iw_entry(iw, "input-filter", "%d", (int)priv->conf.active_level); + iw_entry(iw, "input-filter", "%d", (int)priv->conf.dfilter); iw_comment(iw, "Pulse counter pre-divider (1,2,4,8)"); iw_entry(iw, "direct-presc", "%d", (int)priv->conf.direct_presc); diff --git a/units/fcap/unit_fcap.c b/units/fcap/unit_fcap.c index f01c400..863b700 100644 --- a/units/fcap/unit_fcap.c +++ b/units/fcap/unit_fcap.c @@ -22,19 +22,21 @@ enum FcapCmd_ { CMD_DIRECT_BURST_START = 4, // wait and reply CMD_FREECOUNT_START = 5, // keep counting pulses until stopped, read on reply - CMD_MEASURE_SINGLE_PULSE = 6, - CMD_FREECOUNT_CLEAR = 7, + CMD_MEASURE_SINGLE_PULSE = 6, // measure the first incoming pulse of the right polarity. NOTE: can glitch if the signal starts in the active level + CMD_FREECOUNT_CLEAR = 7, // clear the free counter, return last value // Results readout for continuous modes CMD_INDIRECT_CONT_READ = 10, CMD_DIRECT_CONT_READ = 11, CMD_FREECOUNT_READ = 12, + // configs CMD_SET_POLARITY = 20, CMD_SET_DIR_PRESC = 21, CMD_SET_INPUT_FILTER = 22, CMD_SET_DIR_MSEC = 23, + // go back to the configured settings CMD_RESTORE_DEFAULTS = 30, };