1 Reply Latest reply on Dec 1, 2015 1:48 AM by rahb

    Modify the CapSense threshold in program

    dong.chen

      Now I am developing two models with CapSense feature. These two models share same source code. But the CapSense sensitivity is different. So I want to define different thresholds according to macro definition. I find the thresholds are const type.

         

      const uint16 CapSense_fingerThreshold[] = {
          40u, 40u, 30u, 60u, 800u, 
      };

         

      So I modify the source code like this. So I can redefine the threshold.

         

      const uint16 __attribute__((weak)) CapSense_fingerThreshold[] = {
          40u, 40u, 30u, 60u, 800u, 
      };

         

      So I can redefine the threshold.

         

      #ifndef MYLAR_COVER
      const uint16 CapSense_fingerThreshold[] = {
          60u, 60u, 60u, 90u, 800u, 
      };
      #endif

         

      So I suggest Cypress to improve the PSoC creator. So that it could generate the source code with weak attribute.