Page 1 of 1

Global C-Code

Posted: Mon Oct 13, 2025 10:57 pm
by Alan_37
Hello

Is there a way to make a C block function Global ( can be called from all Macros ), other than putting it in the supplementary code ?
or can we just add a C file to the supplementary code?

If not, I think it should be possible to create a component that lets us add a C file

Re: Global C-Code

Posted: Tue Oct 14, 2025 8:49 am
by Steve-Matrix
You can create a normal macro in Flowcode that has the suitable parameters and return type for that function. In this macro add a single C-code icon and put the code of that function into that icon, matching the parameters of your C function with the parameters of the macro.

Or you can just use supplementary code. There was a discussion about this recently on this forum. A search for the word "supplementary" will bring that up:

https://www.flowcode.co.uk/forums/searc ... plementary

Re: Global C-Code

Posted: Tue Oct 14, 2025 1:41 pm
by Alan_37
Hi Steve,

Thanks for your reply, that was exactly what I needed, to include a file and then use my favorite Editor .

The Absolute Path ended up being a bit complicated, but it worked
#include "Z:\\Mega_2\\STM ILLUMINATI\\FlowCode Base\\Suplimentary_Code\\UART3_DMA.c"

Thanks again

Regards