Thanks for the quick reply. :) Yea, that's what I was thinking, have a small library of just the=20 changed items in the project lib. These probably won't get used much, so=20 that should work well. If I need them in another project, I always can=20 copy the items to the new project. And this is with MPLAB and C18. Last night, with the lib files in the=20 project directory, I must have missed something. I needed to change the=20 tool suite to MPASM and select "build library target" to produce the=20 *.o files, then change back to C18, and build the project. I had tried=20 #including the files global in the C file. I thought that C18 would go=20 and assemble them. I didn't use the library Bat files. On 8/24/2010 10:32 AM, Isaac Marino Bavaresco wrote: > Em 24/8/2010 10:39, Carl Denk escreveu: > =20 >> I am in need of 2.5 serial ports on the 18F1320, (1) RS-232, (1) RS485, >> and (1) Serial LCD, Tx only). The RS-232 would be the hardware USART, >> and the others would be Software Uart's. I understand the part of >> modifying the specific Library files, and rebuilding after revising the >> PORT numbers. Here's the approach I'm thinking: >> 1: Copy 2 sets of the library sw_uart files to the project directory. >> 2: Rename one of the sets of files, say append "_2". >> 3: On the first set of files change the ports, function, and file >> references to match the first UART. >> 4: On the 2nd set of files do the same. >> 5: Rebuild both sets of library files. >> 6: There will be 2 sets of function calls with different names >> >> A couple of questions: >> 1: Is there a way to economize on code size? I'm thinking that could add >> an arguement to the functions where need be to specify which software >> ports we are pointing. >> =20 > It is a good idea, not only to save code (perhaps not that much savings > anyway), but to have a more homogeneous and flexible approach. > > I posted some code in the thread "[PIC] C18 function prototypes > (pic18f8627)", related to SPI, but the idea is the same. > > > =20 >> 2: I haven't looked in detail, but, I'm assuming not all of the >> sw_uart's files are port dependent, and will have no changes. Since they >> are small and storage in project directory isn't an issue, is there a >> reason to rebuild them, or will they just come along for the ride? >> =20 > By keeping the files in the project tree, you don't need to rebuild the > library, but if you stop using some of them, you must remember to remove > them from the source files list or else they will still be linked and > wasting program memory. > If you build a library, then the linker ignores the functions that are > not called. > > You don't need to rebuild the compiler's library, you could create a > smaller library with just your new functions and add this library to the > project. If the functions in your library have the same name as some in > the original library, then your library must be listed before the > original one in the project. > > > It is only worth the hassle of rebuilding the library if you plan to use > these functions on several projects. If they are intended for one > project only, then add the files directly to the project or create a > smaller library. > > I at first keep the files added directly to the project. If I feel that > the files may be useful for other projects, and after they are very > stable, tested and bug-free, then I move them to a library. > > =20 >> Thanks for comments. :) >> =20 > Best regards, > > Isaac > > > __________________________________________________ > Fale com seus amigos de gra=E7a com o novo Yahoo! Messenger > http://br.messenger.yahoo.com/ > > =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .