BasicMicro - Forums

www.basicmicro.com
It is currently Thu Sep 09, 2010 9:18 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: More wish list items
PostPosted: Fri Dec 18, 2009 5:50 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
I have lots of different wish list items. I will put a couple of simple ones here:

1) On BAP28 I wish I can use HSERIAL or HSERIAL2 for the one set of hardware serial port. That way I can write code using HSERIAL2 that runs on the TTL level hardware serial port on both BAP28 and BAP40.

2) Wish there were some standardized defines that you can #ifdef your code for both BAP28 and Bap40. I have used #ifdef TMA and works... (defined on 28 not on 40). Likewise a processor speed definition would be nice especially if newer versions run at different speeds...

3) Wish for a way to know how many characters that were transfered as part of a serin. This is interesting in both cases of reading in strings with termination characters or if a timeout happens. Could be as simple as some system variable gets set. Could be optional parameter, could be returned by serin...

Some more complex ones:
4)Wish there was more parameter testing going to gosubs. If you don't pass in the right number you will probably fault sooner or later.

5) wish there was some form of scope for variables. Ie I wish we had local variables in functions (this one is probably more complex.

Would be nice to also add commands for things that are used in several different programs, like support for PS2, Xbee, etc. Maybe define a way to add commands externally.

That is all for now.
Kurt


Top
 Profile  
 
 Post subject: Re: More wish list items
PostPosted: Tue Mar 02, 2010 5:49 pm 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
Wish You could build a longtable with addresses of other variables. Should be able to do it as the addresses are know at compile time. What I would like to be be able to do directly is something like:

Code:
_TT1      bytetable    "RR Hip Hor", 0
_TT2      bytetable   "RR Hip Vert",0
_TT3      bytetable   "RR Knee", 0
...
TT_TABLE   longtable   @_TT1, @_TT2, @_TT3, ...
...
p      var      POINTER

; To print out a index number
p = TT_TABLE(i)
serout s_out, i9600, [str @p20\0]

Note it would be even better if there was a pointertable... But above works.

Note: I have emulated reasonably, at the end of my defines I put in:
Code:
goto AfterTable
BEGINASMSUB
ASM{
TT_TABLE:
   .long (_TT1 + 0x20000)
   .long (_TT2 + 0x20000)
   .long (_TT3 + 0x20000)
...
}
ENDASMSUB
AfterTable:

I put the goto and label in as the compiler put in some code stuff and it wanted to fall through to run the table as code. Also the compiler did not know what TT_TABLE was so it did not like indexing it like an array. I have assembly code to emulate an array lookup.
Code:
      ; Need to get to text name for servo
      xor.l   er0, er0   ; zero out the whole thing
      mov.b   @I, r0l
      shal.l   er0
      shal.l   er0            ; multiply by 4 bytes per...
      mov.l   #TT_TABLE:24, er1
      add.l   er0, er1         ; should have the address now
      mov.l   @er1, er0
      mov.l   er0, @P


Probably not a high priority, but would make table driven things work a little better.

Kurt


Top
 Profile  
 
 Post subject: Re: More wish list items
PostPosted: Fri Mar 19, 2010 3:00 pm 
Offline
Site Admin

Joined: Thu Mar 01, 2001 11:00 am
Posts: 329
Location: Temecula, CA
Anything defined in ASM is NOT know about in the compiler which is why it didn't know anything about TT_TABLE.

4 and 5 are not going to happen anytime soon. They would require a major re-write of the compiler.

1 to 3 are in my list and I'll try to implement them.

_________________
Nathan Scherdin
Visit BasicMicro

Datasheets:
Servo Controller - ARC32
Microcontroller - AtomPro
Motor Controller - Robo Claw
RC Lighting - Cylon LED


Top
 Profile E-mail  
 
 Post subject: Re: More wish list items
PostPosted: Sat Jul 03, 2010 9:04 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 291
An Alternative to #1. I wish the basic would allow me to abstract away which way the IO is happening without having to change APIS for each call! That is, I wish for example serout might allow me to specify a hardware port/mode and it would automatically redirect to the underlying API. For example if a pin of -1 implies Hardware serial port and -2 implies Hardware serial port 2. Then one could simply have some quick defines at the start of the program and the rest of the code goes unchanged. You could in this case either ignore the baudmode or compares it to the last one and if it changes does a call to sethserial, probably defaulting to 8 bit, no parity, 1 stop bit...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO