Page 225 - The Art of Designing Embedded Systems
P. 225

21 2  THE ART OF  DESIGNING EMBEDDED SYSTEMS


                           ; Created by          :  author’s name
                           ; Date created        :  date
                           ; Description         :  detailed description
                           ; Notes               :  restrictions, odd modes
                           ..................................................
                           ,


                           Module Names
                           Though long module names are a wonderful aid to identifying what-
                      goes-where, all too many compilers and debuggers don’t properly handle
                      names longer than 8 characters. In some cases this may be a fault inherent
                      in the object file format or a debugging file. Limit names to 8 characters
                      or less.
                           Never include the project’s name or acronym as part of each module
                      name. It’s much better to use separate directories for each project.
                           Big projects may require many dozens of modules; scrolling through
                      a directory listing looking for the one containing function main() can be
                      frustrating  and confusing. Therefore store function main()  in a module
                      named main.c or main.asm.
                           File extensions will be:

                           C Source Code                Fi1eName.c
                           C Header File                FileName. h
                           Assembler files              FileName.asm
                           Assembler include files      FileNamehc
                           Object Code                  FileName.obj
                           Libraries                    FileName.lib
                           Shell Scripts                FileName. bat
                           Directory Contents           README
                           Build rules for make         Project . mak




                           Variables
                           Names
                           Regardless of language, use long names to clearly specify the vari-
                      able’s meaning. If your tools do not support long names, get new tools.
                           Separate words within the variables by underscores. Do not use cap-
                      ital letters as separators. Consider how much harder IcantReadThis is on
                      the eyes versus I-can-read-this.
   220   221   222   223   224   225   226   227   228   229   230