My program that just does gets and puts what was sent worked. But not my latest effort to get a menu program up and running. It doesn’t even seem to get to main().
Hmmm… I noticed that the compiler is inserting it’s own mult and div functions which it needs for atoi. Those were being located in RAM. That turned out to because I removed the _HOME section (among others) from crt0.s when I was trying to get things working. Now, I added it back in and those automatically added arithmetic functions are going to the right place.
Then, all of a sudden the flash programmer started failing. I traced that to the fact I was using the start rather than the iterator in the for loop that erases the sectors in the Arduino, so it was just erasing the first sector over and over. Which was fine when my program fit into one sector…. Literal growing pains.
And…..I seem to be in main() now executing an endless loop of basic pin manipulation that is appearing on the scope as hoped….. Whew!
By the way, I added a “C extension” which lets me specify a maximum buffer length for gets. If the user goes too high, it putchars a BEL. That will either beep or make puTTY flash.
And, now the puts works, but my printf with a %s is spamming a zero. Since the string’s first character is 0, that’s progress…..
There, fixed that bug…..
Now, I’m getting my first menu item spammed over and over….
That was easy enough to fix…..
And now it shows the menu and takes a value. But it didn’t seem to execute the code it’s supposed to…..
OK, my prompt code actually returns the zero based index and I was decrementing it….
And one more bug in my prompt interpreter…..
So I’ve got a couple of issues to take care of, but from having the program not working a few hours ago to this isn’t too bad.
Time to publish this post….