PicNaut:
Yes I keep all the include files that the particular "project" requires in the same folder.Do you keep all of your project's includes in the same folder as your .BAS or .PBP file?
Brian:
Let me describe how I use include files and perhaps it will make more sense. As I develop a project, I first decide what are the basic things about the project that can be broken into logical modules. This is of course just a first stab at it, since over time I figure out more and more things that can be redivided, or just new functions that I never thought of before. These modules in many cases will be new or unique to this project only. And as such are just as much in development as the main calling module, especially during the early development stages.Maybe I don't understand the problem but mytekcontrols' issue with not backing up include files seems a no brainer to me. I regard include files as a stable piece of code or compiler directives or whatever that was developed previously.
In the present StampVue project I am essentially writing an entire operating system in PBP which will end up being somewhere in the area of 40,000 bytes when assembled. I really don't want to scroll through that much code in one piece when I am developing it. Instead what I have done by modularizing it, is break it into more manageable chunks. Here are the present includes from the StampVue Project's calling routine thus far:
Believe me when I say this method of doing things really ends up being a time saver, and not a waste of time. There is also nothing "new" about this method of organizing source code. It is done all the time in Windows, Linux, Unix, ect. application development. Although in those environments there has traditionally been a massive amount of code to develop, something that has just recently begun to creep into the PIC embedded processor world with their ever increasing flash program space.Code:'=========================================================================== ' Includes '=========================================================================== Include "mod_DATA.bas" ' defaults for EEprom Include "18F2525_DEFINES.bas" ' specific defines for CPU Include "EQUATES_stampvue.bas" ' equates for entire project Include "IO_stampvue.bas" ' I/O pin assignments Include "mod_IRQ.bas" ' fast ISR module Include "mod_IRQL.bas" ' slow ISR module Include "mod_I2C.bas" ' video/rtc I2C module Include "mod_LM1247init.bas" ' video generator init module Include "mod_keybd.bas" ' PS2 keyboard module Include "mod_messages.bas" ' text message module Include "mod_DS1307rtc.bas" ' rtc low-level routines module Include "mod_ADCsample.bas" ' A/D low-level routines module Include "mod_windows.bas" ' pop-up windows module Include "mod_ADCdisp.bas" ' A/D display module Include "mod_TIMEdisp.bas" ' time display module Include "mod_DATEdisp.bas" ' date display module Include "mod_ENCDRdisp.bas" ' encoder/pulse display module Include "mod_AUTOconfig.bas" ' automatic display config module Include "mod_TXTSCRLconfig.bas" ' scrolling text config module Include "mod_HVhueconfig.bas" ' horz/vert/hue config module Include "mod_TXTSCRLdisp.bas" ' scrolling text display module Include "mod_colorSAMP.bas" ' color sample chip display module Include "mod_cbarATTR.bas" ' color bar attributes module Include "tbl_keybd.bas" ' table of keyscan values Include "tbl_vascii.bas" ' table for ascii-to-video translation Include "tbl_asciie.bas" ' table of re-mapped ROM characters Include "tbl_messages.bas" '===========================================================================
Brian:
To each his own, and whatever works for you, is of course the way you should do it. I just do it differently is all.I avoid include files and much prefer to see the whole code in the main file to make sure later (much later) revisions of the main code don't get tripped up by a change to the include file. I copy and paste the old code straight into my new code for completeness.
PicNaut:
I would certainly like to see this, but it might be worth while to take a poll on who uses multiple include files in their PBP development, in order to get a better feel for the priority of doing so.I may be able to rig up a routine that first looks to see if your include files are backed up. Then, it only checks each time to see if they've changed. If they have, then they get backed up. This get's messy though. I will probably leave that until later, unless everybody else wants that feature now.
As ObiWan would say "may the force be with you",
Bookmarks