Prechádzať zdrojové kódy

Furher optimized for nosy PD source

TC pushbot 5 1 rok pred
rodič
commit
c785ba8135
2 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 4 2
      firmware/reflow/reflow.ino
  2. 1 1
      firmware/reflow/utils.ino

+ 4 - 2
firmware/reflow/reflow.ino

@@ -20,6 +20,7 @@
 
 //Timing settings. Each cycle is approximately 100ms
 #define HOLDSTART_TIME 30  //START Button hold down time in cycles
+#define HOLDSTOP_TIME 10   //STOP Button hold down time in cycles
 #define SOAKING_TIME 600   //SOAKING temperature upkeep time in cycles
 
 /*
@@ -63,6 +64,7 @@ bool reflowComplete = false;  //Indicate if the stopping is done because of refl
 */
 int reflowStages = 0;
 int startCountdown = HOLDSTART_TIME;  //Hold for HOLDSTART_TIME to start to prevent accidental touches
+int stopcountdown = HOLDSTOP_TIME;    //Hold for HOLDSTOP_TIME to stop reflowing
 int cycleCounter = 0;                 //Record cycle time up to 10 seconds
 int soakingCountdown = SOAKING_TIME;
 
@@ -85,8 +87,8 @@ void setup() {
   TouchKey_begin((1 << 2) | (1 << 5));
 
   //refer to AN3891 MPR121 Baseline System for more details
-  TouchKey_SetMaxHalfDelta(192);      // increase if sensor value are more noisy
-  TouchKey_SetNoiseHalfDelta(4);      // If baseline need to adjust at higher rate, increase this value
+  TouchKey_SetMaxHalfDelta(128);      // increase if sensor value are more noisy
+  TouchKey_SetNoiseHalfDelta(8);      // If baseline need to adjust at higher rate, increase this value
   TouchKey_SetNoiseCountLimit(10);    // If baseline need to adjust faster, increase this value
   TouchKey_SetFilterDelayLimit(5);    // make overall adjustment slower
   TouchKey_SetTouchThreshold(220);    // Bigger touch pad can use a bigger value

+ 1 - 1
firmware/reflow/utils.ino

@@ -66,7 +66,7 @@ void updateKeyStates(){
   //Start button, require hold down for 3 seconds to start
   if (touchResult & (1 << 2)) {
     startCountdown--;
-    if (startCountdown <=0){
+    if (startCountdown <= 0 && !reflowing){
       /* START REFLOW PROCESS - PREHEAT */
       USBSerial_println("!!! Reflow Started !!!");
       reflowing = true;