2 Replies Latest reply on Feb 11, 2016 4:22 PM by jebi_333106

    Reference for register usage in order to write functional code

      Looking at the C example code made me realized that I don't know how to write my own code. For example, the example generates the following C code:




          /* Initialize baselines */


          /*when return value is 1, perform while loop*/
              /* Check whether the scanning of all enabled widgets is completed. */
              if(0u == CapSense_CSD_IsBusy())
                  /* Update all baselines */


                  /* Start scanning all enabled sensors */


              /* Display CapSense state using LEDs */


      I can't figure out where the "1u" comes from that the while() function is using (thus where the "0u" that the if statement is using).


      I assume that some register is loaded with a value that is checked by the while() loop as a result of the call to "CapSense_CSD_InitializeAllBaselines();" However, the capsense data sheet states that no value is returned as a result of the call to "CapSense_CSD_InitializeAllBaselines();" 


      So, is there a reference that I can read that would provide this information?


      What would lead me to write "while(1u);" if I didn't see this in the example?


      What if I had other modules that required use of the what() function, how would I differentiate what source the "1u" would be used for the while loops?


      Sincerely, Jeff