Importing C code program to FC8

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Posts: 78
Joined: Mon Jul 31, 2017 11:14 am

Importing C code program to FC8

Post by streammaster »

I never tried to do this, but i hope it is possible.
I would like to reuse the driver modules with source in C in a FC8 project. What would be the best practice to do so to import working C project or part of it?
Here is a practical example. There is a display driver as part of the working project in microchip MPLAB. I would like to extract the c code from driver main and from the header file(s) (or just simply include a header files), and place them in to FC and create FC macros which i can (re) use in FC environment. I tried to create the project and place the c code in to the FC, hoping for miracle, but compiler is creating tones of errors, which are mostly related to the variable and function definitions (missing definitions) in this process i managed to fix all missing files errors by defining exact paths to files. I can see as possibly conflicting point the hardware configuration, but i hope this is possible to define using C as well in FC8.
Could you guide me here please?
Once i figure it out and have success i will document procedure and publish back to forum how to do it document for everyone as the reference.
In particular case, with this display driver, a first step is to implement all macro functions without simulation and hardware configuration in FC. Once this stage is completed i will try to make the FC simulation, and configuration interface which will lead to have a FC component which then could be used in any FC project with any hardware.
I attached relevant source files for the display driver which needs to be imported in the FC.
Microchip source code
(8.07 KiB) Downloaded 79 times
I would appreciate anyone's idea which can direct me to the success.

User avatar
Matrix Staff
Posts: 14851
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd

Re: Importing C code program to FC8

Post by Benj »


This seems to be working.
(10.09 KiB) Downloaded 102 times
I've included the library via the Build -> Project Options -> Supplementary Code.

I had to comment out a few lines in the library as the clock speed was being redefined and it had a dependancy it couldn't find but this didn't seem to actually be required. Currently compiling fine for me.

Post Reply