Re: Software architecture using C for mid-range PIC.
- From: Hans-Bernhard Bröker <HBBroeker@xxxxxxxxxxx>
- Date: Sat, 12 Sep 2009 00:27:49 +0200
Fevric J. Glandules wrote:
Hans-Bernhard Bröker wrote:Fevric J. Glandules wrote:
The command set is fixed, and consists of about 30 ASCII triplets, and with any luck won't change too much.
Encoding a mere 30 commands as three-letter tokens is excessively redundant. I would strongly suggest to abbreviate further, to one or two letters. In the process you would both reduce your communication load and speed up the interpretation.
Meanwhile I've got a little less than 4K of RAM to play with <grin>.
You could still use a perfect hash function. That would basically amount to letting a machine condense your command set to single letters, in whichever way it liked.
Or you could combine all three letters into a single number, then switch() directly on that:
switch((u16)buf[0]<<16 + (u16)buf[1]<<8 + (u16)buf[2]<<0)
and let the compiler decide how to implement that most efficiently.
.
- Follow-Ups:
- Re: Software architecture using C for mid-range PIC.
- From: Fevric J. Glandules
- Re: Software architecture using C for mid-range PIC.
- From: Stef
- Re: Software architecture using C for mid-range PIC.
- References:
- Software architecture using C for mid-range PIC.
- From: Fevric J. Glandules
- Re: Software architecture using C for mid-range PIC.
- From: nospam
- Re: Software architecture using C for mid-range PIC.
- From: Fevric J. Glandules
- Re: Software architecture using C for mid-range PIC.
- From: Joe Chisolm
- Re: Software architecture using C for mid-range PIC.
- From: Fevric J. Glandules
- Re: Software architecture using C for mid-range PIC.
- From: Hans-Bernhard Bröker
- Re: Software architecture using C for mid-range PIC.
- From: Fevric J. Glandules
- Software architecture using C for mid-range PIC.
- Prev by Date: Re: Software architecture using C for mid-range PIC.
- Next by Date: Re: Software architecture using C for mid-range PIC.
- Previous by thread: Re: Software architecture using C for mid-range PIC.
- Next by thread: Re: Software architecture using C for mid-range PIC.
- Index(es):
Relevant Pages
|