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
streammaster
Posts: 78
Joined: Mon Jul 31, 2017 11:14 am
Has thanked: 7 times
Been thanked: 13 times
Contact:

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 ERC12832-1.zip
(8.07 KiB) Downloaded 269 times
I would appreciate anyone's idea which can direct me to the success.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Importing C code program to FC8

Post by Benj »

Hello,

This seems to be working.
LibCode.zip
(10.09 KiB) Downloaded 312 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.

Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Importing C code program to FC8

Post by Kisen »

Hello,

I just tried to download this Libcode.zip file as i was hoping it would show me how to import pre existing c files. I just get an unexpected end of archive error.

Is there a more direct tutorial for doing this sort of thing?

Post Reply