Hi Yan,
> Ooooh boy.
>
> That's what started this whole mess. The particular monster I am
> fighting started with the keypad driver. Then various chunks got
> grafted in from other programs, with pointers, PEEK/POKE, and other
> sundry stuff, all with different programming styles and methods. Now
> it's a nearly unmaintainable 1,000 lines of code.
>
> It all worked, though - mostly.
>
> So I decided to "clean up the code" at which point the whole house of
> cards came down and the driver quit working.
I hate that when that happens ... its happened to us all.
Now I tend to keep two code sets;
1) Low-level tests that test specific functionality,
eg. loopback test on a uart, toggle I/O etc.
These are all written, as much as possible, as single
file programs.
2) Full function code;
C/C++ making full use of libraries etc.
Then when stuff breaks, I can start off with a 'small
pile of cards', rather than a big mess of cards ;)
> I'll follow up on the assembler tomorrow. I'll also read up on
> readb/writeb and friends; I forgot about those.
Yeah, I'm not sure if it'll help in this case.
If TS have found that a specific assembly instruction
is required, then you may want to rename their PEEK
and POKE as fpga_in_le16(), fpga_out_le16(), or 'be' if
the processor is running in big-endian mode (I forget).
At least then the code will look more standard than
with PEEK and POKE scattered through-out.
Cheers,
Dave
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|