In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Ray, I attached a template source file, together with a library include file. The library consists of macros to easily include uart,timer,stack,queue,i2c. Unfortunately SPI is not included (never got around to do that). The library allows you to define VP's in the ram bank areas. For identical VP's, the vp code is inserted only once, but each vp declaration has its own data area. For example, if you define 3 transmit uarts, the code for a transmit uart is included only once, but there are 3 data areas. Also the threads in the isr are setup as defined by a ratio number that you supply with the vp declaration. See the template source for how vp's are declared. Assemble and study the generated listing file. The library is by no means perfect. I believe the code in it to be correct. It may give you an idea how a library could be setup. I tried to put the different vp's in their own file, but the assembler would not allow more than 9 includes, so instead I just use 1 file. All code is wrapped into macros, so no code is generated unless called by the main source. Please comment on this setup or start a new thread for library development. It would be nice if the library was made compatible with SX/B (if possible). regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=103788#m103818 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)