Improving supplementary code editing
Posted: Thu Sep 25, 2025 8:50 pm
Supplementary code is a useful feature if you need to add a little more C to your flowchart than is comfortable in a code block.
However - editing it is a bit more awkward than a normal Flowcode macro - for example - you can't open another macro / view variables etc, it's a bit clunky to get to (project options - supplementary code) and get out of - save, modify too - and the editor has none of the advantages of a C editor such as syntax checking.
There is an easy solution to this - that I had used before in passing - but recently needing to work a fair bit with some code - and it really makes life easier.
In the supplementary code "Definitions and function declarations:" do:
and in the "Function implementations:" section do:
Create and edit the files my_header.h and my_functions.c (names can be changed to suit of course) - in your favourite editor (I use notepad++) - and then save any changes before compilation.
The files need to be in the compilers search path - and as I am currently using the esp32 I created a new directory 'include' in the project/main folder and added this to the search path by adding the folder to CMakeLists.txt (in main)
The technique will vary depending on target device however.
Martin
However - editing it is a bit more awkward than a normal Flowcode macro - for example - you can't open another macro / view variables etc, it's a bit clunky to get to (project options - supplementary code) and get out of - save, modify too - and the editor has none of the advantages of a C editor such as syntax checking.
There is an easy solution to this - that I had used before in passing - but recently needing to work a fair bit with some code - and it really makes life easier.
In the supplementary code "Definitions and function declarations:" do:
Code: Select all
#include <my_header.h>
Code: Select all
#include <my_functions.c>
The files need to be in the compilers search path - and as I am currently using the esp32 I created a new directory 'include' in the project/main folder and added this to the search path by adding the folder to CMakeLists.txt (in main)
Code: Select all
idf_component_register(SRCS "esp-project.c"
INCLUDE_DIRS "" "include")
Martin