Hi
Although your project compiles for me, I have spotted some issues with it.
for example, within main you have a loop with While true, so it will always be running.
However, you have an Enable timer interrupt within the loop.
Timer interrupt Eanalbes should only be run once (unless a timer Disable icon is used first), so you must move it above the loop.
You have a component, calculation and connection point below the loop, which will never be accessed, as the loop will be running forever.
My guess is you meant to have a goto connection within the loop, but it got missed out.
Try and use loops instead of goto connections whenever you can
Withing the SaveData interrupt macro you have a fair few FileSD components and a Disable timer icon.
All interrupts should be as short as possible and the components that are used within the interrupt e.g FileSD should not be used in any other user macros otherwise corruption will occur.
The compiler messages is warning you about this, they are called
non-reentrant functions
If you see that warning, don't ignore it. for example, you have messages like:
Code: Select all
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC\PIC_CAL_Delay.c: 85: non-reentrant function "_delay_us" appears in multiple call graphs and has been duplicated by the compiler
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC\PIC_CAL_String.c: 132: non-reentrant function "_FCI_GETLENGTH" appears in multiple call graphs and has been duplicated by the compiler
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC\PIC_CAL_String.c: 377: non-reentrant function "_FCI_TOSTRING" appears in multiple call graphs and has been duplicated by the compiler
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC\PIC_CAL_String.c: 542: non-reentrant function "_FCI_FLOAT_TO_STRING" appears in multiple call graphs and has been duplicated by the compiler
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC\PIC_CAL_SPI.c: 285: non-reentrant function "_FC_CAL_SPI_Master_Byte_1" appears in multiple call graphs and has been duplicated by the compiler
I have left a fair few messages off the list.
I have found in the past, that there is an issue if you disable an interrupt within an interrupt.
my advice would be to set a flag within the interrupt. then move all the components and Interrupt Disable to a new user macro.
Then within the new user macro, you clear the flag.
Instead of timer enables and disable's, you could use another flag called Timer4 disable for example, within the interrupt, to bypass setting the interrupt flag.
I can generate an example for you if it will help.
I hope this helps you out.