??? 03/16/06 11:28 Read: times |
#112294 - Obscure code... Responding to: ???'s previous message |
Pathipati,
I must say that I thought your method of range checking the buffer indexes is a bit obscure... why do you not just do something like a simple if (index > BUF_SIZE)... To me it reads easily, I had to really think what your code did and without a bit of thinking, I cannot figure how your receive interrupt code works. Your code also relies on the buffer sizes being nice powers of two in size. Pity you or anyone who has to maintain this code in the future. It's obvious you're using a firebreather of a cpu, so are you trying to save every possible cycle by writing obscure code? Leave that to the people who program PICs in assembler! The secret to writing defect free code? Don't put the defects in - keep your code simple and make it read easily. Jan - great suggestion by using the led. I've been doing that stuff for years, so simple but so many people overlook it. |