Dave
Always wear safety glasses while programming.
Thanks, That link is where I found the original info.
I even went to the trouble to include an excerpt in my original question
and state why it did not seem to fix all my problems.
That's HALF the solution to the two questions.
Quoting that link...again...in more detail...
@ DEVICE PIC16F628,XT_OSC
The PIC type is optional, if it is included and you accidentally compile for a chip other than that specified (a 16F628 in this example), the compiler will report an error as a reminder you're potentially doing something wrong.
End Quote.
You'll notice that the PIC type does NOT appear to set the PIC type for the compiler.
It seems to only illicit an error if the compiler command line PIC type differs.
That's consistent with my attempts to use it. If I remove the PIC type from
the compiler command line, it defaults to 16F84 and I get the wrong includes
no matter what I put on the DEVICE line inside the .bas file.
I want to ACTUALLY set the PIC type INSIDE the .bas file INSTEAD of on the command line.
The PIC type would then NOT be included on the command line, but taken from the .bas file.
ALL the required parameters would be encapsulated inside the .bas file.
I'd need only one batch file to compile all my programs and I wouldn't have to guess
which parameters to use next year when I try to edit the program.
How do I do that?
I do not think there is a way to do that. You would still need to tell the batch file where to look for the code. I make a batch file for each project and keep it in the project's directory.I want to ACTUALLY set the PIC type INSIDE the .bas file
Dave
Always wear safety glasses while programming.
Well, seems like that's what everyone would want to do.
Command line parameters should OVERRIDE what you put in the source file.
Let's look at a workaround. IF I put a new DEFINE in the .bas file, it seems to get
get passed through. If I edit the default .inc and .bas file to include a different
processor's .inc and .bas files, and don't specify the processor on the command
line, it seems to work.
I should be able to edit the pbproc.bas and pbproc.inc files to include files conditioned
by the new DEFINE. If I call all that without specifying a processor on the
command line, I get a bunch of redefinition errors. My lack of understanding how preprocessor directives and ifdef's work seems the problem. Or maybe the
DEFINES haven't been defined by the time I get to the .inc and .bas files.
Ideas?
Only other thing I think I know how to do is to parse the source file to pull out the
processor type in my new DEFINE and use that to fill in the proc type in the
pbpw command line.
Shouldn't be hard, just ugly.
I have more fun playing with the tools than the actual program.
You might find this interesting. It is all I use in a windows environment for the past year or so.
http://www.picbasic.co.uk/forum/cont...75-FineLineIDE
When on a linux box I do a batch file and write the code in gedit. I use to use emacs a lot, you might be able to do what you want with that tool.
Dave
Always wear safety glasses while programming.
Thanks,
FinelineIDE looks like a terrific program.
Unfortunately, it doesn't work for me.
Can't figure out how to get it to produce the .LST file.
Can't figure out how to use a Picstart+ programmer.
But the killer is that it doesn't like my touchpad mouse.
The mouse vertical scroll feature gets locked on and scrolls
all over the place.
Fineline default horizontal scroll cuts off the first 9 columns.
Can fix it with the horizontal scroll bar, but it pops back to cutting
off 9 after a vertical scroll.
If I actually use the mouse horizontal scroll, all it likes to pop to the
middle so nothing shows.
I can indent a couple of times so the program is visible most of the time,
but it still shifts horizontally against my will. To be fair, this is an
ancient touchpad with a win2k driver running on win7...but it seems to work
on everything else.
Can't use it for general programming, but it might come in handy
debugging those cases where I have nested IF statements with
the endifs in the wrong places.
I bit the bullet and used the DEFINE syntax to put Pictype in the .bas file.
Wrote a program to parse it out, construct a pbpw command line
then post-process the hex file to remove the configuration word for the
bootloader. One click and I got hex exactly like I want it from whatever
source file I use.
Thanks, mike
To bad about FineLine. It really is a nice program.
Just curious, what are you using to write your PBP code with and what did you use to write the parser/command line to create the hex?
Dave
Always wear safety glasses while programming.
Bookmarks