Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/09/05 17:33
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#87020 - A couple of observations
Responding to: ???'s previous message
unsigned char RETURN;
It's not a good idea to use language keywords for identifiers - even if you have made it uppercase!
Initial_LCD(); // Run function Initial_LCD 
Init_CPU();    // do all initializations 
Comments like "Run function Initial_LCD" by a call to Initial_LCD add no value. The comment should explain why you call the function here.

Do you really want to initialise the LCD before you've run Init_CPU?
//define function convert 
unsigned char convert(unsigned char channel)
Again, this comment adds no value.
A useful function comment would:
  • State the purpose of the function;
  • Describe the parameters;
  • Describe any necessary pre-conditions;
  • State any global variable usage;
  • Describe the return value;
    etc

    http://www.ganssle.com/articles/Comments.htm
    http://www.ganssle.com/articles/astyle.htm
    http://www.ganssle.com/misc/fsm.doc

  • List of 12 messages in thread
    TopicAuthorDate
    8051 MicroC Voltage Meter--Please Help            01/01/70 00:00      
       woefully incomplete and a suggestion            01/01/70 00:00      
       congratulations            01/01/70 00:00      
       Real Code?            01/01/70 00:00      
       code compiles fine in MicroIDE            01/01/70 00:00      
          The Development Process            01/01/70 00:00      
          and so what            01/01/70 00:00      
          Code?            01/01/70 00:00      
          A couple of observations            01/01/70 00:00      
       almost there            01/01/70 00:00      
          absolutely            01/01/70 00:00      
             Sending data to the lcd            01/01/70 00:00      

    Back to Subject List