4 Replies Latest reply on Nov 29, 2016 11:39 PM by content.librarian

    PSoC 5LP, project with outsourced functions

    content.librarian

      Hello,

         

       

         

      I am writing a program for PSoC 5LP (Prototyping Kit) working with the RGB-sensor VEML6040 by Vishay.

         

      I try to outsource most of the functions and only have the core-code remaining in the file main.c. So i created two files: veml6040.h and veml6040.c and added them to the project (in header and source files).

         

       

         

      Extract from veml6040.h

         

       

         

      #include "veml6040.c"
      #include "main.c"
      #include <project.h>

         

      // definitions

         

      // function headers

         

       

         

      extract from veml6040.c

         

      #include "veml6040.h"

         

      uint16_t ReadSensor(uint8_t CommandCode)
      {
          // awesome code
      }

         

      // other functions ...

         

       

         

      When i do so and i change the files following message appears (translated from german by me):

         

      The file cannot be saved: (The process cannot access file "C:\Users\username\Documents\PSoC Creator\PSoC5LP-VEML6040\PSoC5LP-VEML6040.cydsn\main.c", because another process is accessing it.)

         

       

         

      None of the files can be saved (not even main.c). Also the Build ends with the PSoC Creator crashing.

         

      When i remove the files from the project, everything works fine again.

         

       

         

      Can someone help me with this problem?

         

       

         

       

         

      Best regards,

         

      Jeroen