Shop OBEX P1 Docs P2 Docs Learn Events
SX/B - Bringing multiple test programs into a singel final program — Parallax Forums

SX/B - Bringing multiple test programs into a singel final program

John KauffmanJohn Kauffman Posts: 653
edited 2008-03-06 12:27 in General Discussion
I am finishing up a hobbyist exercise in SX/B to sense, timestamp, store and display simple data like temperature and voltage.
·
I wrote five individual test programs in SX/B for interfaces with five externals: EEPROM, DS1302 clock, LCD display, A/D and the temperature sensor. Each test program works fine on its own.

Each program is broken by comments into sections from the SX template: Constants, Variables, Start: SUB declaration table and subroutines. Every variable, SUB and pin has a globally unique name. No ISR in the project.
·
Any thoughts on the *best* way to bring them together for the final project?
·
So far I have just been copying the Constant sections from each test program into the Constants section of the master program. Then I repeat for Variables, etc. The result is that the constants are all in one place, but the package of code for one objective is split up. It is time-consuming to swap in an improvement that I have made in a test program.
·
Is there a way to package up a set of code (including variables, start:, sub declarations table and constants) so that I can insert an entire functional unit into the main program in one copy/paste?
·
Thanks.
·
·

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-03-06 11:06
    If all the elements can share a few generic variables, your SRAM space will be much freer. Variables store in SRAM and in many cases may only be used momentarily.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • BeanBean Posts: 8,129
    edited 2008-03-06 12:27
    John,
    I would use "LOAD" to pull in the individule files.
    You may need to split each module into two pieces: A header file, and a code file. This is sometimes needed to get the pieces in the right place.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
Sign In or Register to comment.