¿ªÔÆÌåÓý

Re: lcd 3.5 display help sought


Jack Purdum
 

No, I think anything that helps anyone read code is a good thing. To anyone who thinks otherwise, skip the rest of this post...

When I had my software company, I strictly enforced a "function header rule" that had to be of the form:

/
? ?Purpose: This function (whatever it does)

? ?Parameter list:
? ? ? int x ? ? ? ? ? ? ? ? ?the x coordinate for the display
? ? ? int y ? ? ? ? ? ? ? ? ? ? ? ?y ? ? ? ? ? ? ? ? ?"

? ?Return value:
? ? ? int flag ? ? ? ? ? ? ?1 on success, 0 on fail

? ?CAUTION: (used to inform of global data or coupling action with other function(s)
/
int MyDisplay(int x, int y)
{
? ?// The rest of the function

By using this format, I wrote a filter that would read all of the project's?source code files and, upon seeing "/" it knew a function header was coming up and the closing "/" marked the end of the header and the next line would contain the function signature. The filter used the FILE macro to define the name of the source file and LINE gave me the line number. I then sorted on function name and wrote the header, signature, file name, and line number to an ASCII file. Voila: Documentation for all functions used in the project.?

Coding consistency makes it easier for a team to debug and maintain code. Any programmer who didn't do this had to buy beer and pizza for everyone on Friday for lunch. (The company was small.) It didn't take long for everyone to adopt the same style convention.

Jack, W8TEE



From: G4NQX <tasmod@...>
To: [email protected]
Sent: Sunday, February 5, 2017 11:11 AM
Subject: Re: [BITX20] lcd 3.5 display help sought

You probably won't like this but that code just isn't worth it, it's all about display.? You would be better deciding what you want and write your own or hack the display code about.??? Heck, use the Raduino code but rewrite for tft display,
Trouble is display coding for a tft display is not trivial compared to an lcd, even at 20x4 line lcd, that's easy !
Use Jacks rotary speedup for just one band use along with a simpler uncluttered tft display.? I know the filter stuff etc looks nice but it's not relevant to a BitX.
I can send you some code already done for tft's for you to look at and hack.? I use a 'basic' style of coding which is easy to read and follow.
One tip I find helps whenever you get code to look at, is to first segment the functions with the single comment and hashes (pounds). i.e.?? //#######################
That way you get a clear idea of program flow.

Better stop now as I suppose this isn't relevant to BitX group.
--
Rob G4NQX


Join [email protected] to automatically receive all group messages.