We've had several instances where we have had the compiler use an out of date source file, to the extent that it was reporting #Warnings from the source file that are no longer present. Eventually we worked out that there was a path (win 7) C:\Users\<user>\AppData\Local\VirtualStore\Swordfish, where it was keeping out of date copies of some source files, and bringing those in instead of the ones in the project directory. I'll refrain from commenting about my lost days trying to figure that one, but deleting the Swordfish directory under this path seems to improve the situation. As I have more faith in the Swordfish compiler than I do in Microsoft, I'll assume this is some problem with Microsofts cacheing that is invisible to the compiler.
Since then we've seen continuing issues with the compiler picking up similarly named files from other projects it has been used on that day instead of the current project. We've been through the process of using absolute references in the include statements (ig INCLUDE "M:\COMMON\USART.bas", mapping M: to the relevant directory using DOS Subst), and more recently relative references to avoid the Subst command eg (..\COMMON\USART.bas). We've followed the guidance in this topic.. http://sfcompiler.co.uk/phpBB3/viewtopi ... hilit=path, and now use the forward slash instead of the back slash in paths for includes and now have a single main file in the project directory and below it subdirectories with code separated relating to the various functional blocks (USART, I2C etc).
Sadly, that still has not totally solved the problem.
We are still left with another completely unexplainable issue, and I throw myself upon the mercy of this forum for some help in resolving it !
We have a project we compile with and without USB functionality, and use #define Include_USB_Code as a switch set in the main file to build in USB functions (or a USART if the USB is not included). The following bit of code is quite literally nearly driving me to a breakdown....
Code: Select all
Include "COMMON/BITDEFS.bas"
Include "NM_SENSOR/S_GLOB_VAR.bas"
<snip>
' CC1101 GD02 on RP24 is mapped to INT3
Public Dim Radio_GDo2_Int_Pri As INT3IP
Public Dim Radio_GDo2_Int_Edge As INTEDG3
Public Dim Radio_GDo2_Int_Flag As INT3IF
Public Dim Radio_GDo2_Int_En As INT3IE
When built WITHOUT USB, it works.
When built WITH USB, it fails on the line (and every subsequent line) referencing any peripheral control bit (the first being INT3IP). Inserting #Warning statements into the BITDEFS.bas Include file shows the file is NOT being included, BUT if you intentionally corrupt the file name, it complains that it can't find it.
Comment out the #define Include_USB_Code in the main code (which doesn't directly affect any of these parts of the code), and suddenly the #warnings from BitDefs.bas show up in compilation and it compiles and runs correctly !
We've looked at this older thread which is not specified as resolved.... http://sfcompiler.co.uk/phpBB3/viewtopi ... lude#p7982, and of course other sections of the code do have Include statements for the USB functions within #if statements (or even nested #if statements). But nothing in this file selectively includes depending on the USB functions. It simply works without the USB and doesn't with it.
WHAT is making the compiler complete ignore the content of the BITDEFS file when I include the #define for the USB ?
For my 2 cents worth, I'm not blaming the USB code. it might be any section of code that's selectively brought in. There is some unexplained process causing the compiler to fail here, and I really am tearing my hair out.
I will happily send a project zip file to anyone who can show me how to solve it please (but just moving stuff around till it `goes away without explanation` isn't a solution, as this sort of problem keeps recurring).
Thanks for reading this far, and even more thanks if you can try and help.
Nigel Mills
BSc CEng FIET and generally decent chap with too little hair to keep tearing out.
PC: Vanilla Core i7, SSD C: Win 7. - Identical problems on two similar workstations (and my behemoth PC at home)