Merck / Mbed OS SmartCap_OS5

Dependencies:   nRF51822

Revision:
53:4524fff577eb
Parent:
51:53fe9aff625a
--- a/Source/main.h	Mon Sep 21 14:22:56 2020 +0000
+++ b/Source/main.h	Tue Sep 29 15:44:41 2020 +0000
@@ -16,16 +16,18 @@
 #define FAST_TICK_SEC     1    // update rtc and run check cap rate while in init and test mode
 #define EOL_TICK_SEC      10   // update rtc and run check cap rate while in EOL mode
 #define VERY_FAST_TICK_SEC 0.1  // used for when the cap is almost off
-#define VERY_FAST_TICK_ON_TIME_SEC 2 // must be an integer
+#define VERY_FAST_TICK_ON_TIME_SEC 5 // must be an integer
 
-#define CAP_THRESHOLD_ON       42 // Cap on threshold.  Lower value means it triggers more easily
+#define CAP_THRESHOLD_ON        25 // Cap on threshold.  Lower value means it triggers more easily
 #define CAP_THRESHOLD_OFF1      35 // Cap off threshold.  Higher value means it triggers more easily
-#define CAP_THRESHOLD_OFF2      5  // Cap off threshold.  Higher value means it triggers more easily
-#define CAP_THRESHOLD_OFF_EOL   20 // Cap off threshold for EOL to ensure bluetooth advertising - FTD 08212020
+#define CAP_THRESHOLD_OFF2      11  // Cap off threshold.  Higher value means it triggers more easily
+#define CAP_THRESHOLD_OFF_EOL   25 // Cap off threshold for EOL to ensure bluetooth advertising - FTD 08212020
 
-#define CAP_THRESHOLD_ON_INITIAL 15 // initial value of adaptive cap_off threshold (Must be higher than CAPTHRESHOLD_OFF)
+#define CAP_THRESHOLD_ON_INITIAL 25 // initial value of adaptive cap_on threshold (Must be higher than CAPTHRESHOLD_OFF)
 #define CAP_THRESHOLD_ADAPT_RATE  192 // How fast the thresholf adapts. number 0 to 256. 256 means adapt immediately, 0 means no adapt.
-#define CAP_THRESHOLD_PERCENT_OF_PEAK  192 // What fraction of the peak on-off cap reading is used for the threshold. %*256, so 85% is .85*256=218
+#define CAP_THRESHOLD_PERCENT_OF_PEAK  218 // What fraction of the peak on-off cap reading is used for the threshold. %*256, so 85% is .85*256=218
+#define CAP_THRESHOLD_OFF_PERCENT_OF_PEAK 59 // What fraction of the peak on-off cap reading is used for the threshold. %*256, so 85% is .85*256=218
+#define CAP_THRESHOLD_TRIGGER_MULT 3 // Multiplier of cap off threshold used for trigger
 
 #define CAP_SAMPLES    2 // Number of samples used for cap sensor average - FTD 08212020