/*
* Steves standard copyright notice removed for brevity
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
/
*-----------------------------------------------------------------------
*/
// This file serves as a place to enable/disable various
functionality.
//
// The suggested naming convention for constants is:
// <developer initials>_<functionality name>_MOD
//
// Where the developer initials really just serve as a namespace.
/
*-----------------------------------------------------------------------
*/
/
*************************************************************************/
// Show current-data values as the lock screen instead of the BWLogger
logo
#define JJL_LOCKSCREEN_MOD
#define LOCKSCREEN_MODE 1
/
*************************************************************************/
// Record daily high/low values for temp/pressure/altitude, make them
// available on the main screen via the line selection menu
#define JJL_DAILYHIGHLOW_MOD
/
*************************************************************************/
// Add a couple of getter functions for accessing clock data
#define JJL_CLOCKACCESS_MOD
/
*-----------------------------------------------------------------------
*/
// Additional option configuration can be done in this section, i.e.
// if there are dependencies between options, this is where you can
test
// to make sure everything is enabled that needs to be enabled.
/
*-----------------------------------------------------------------------
*/
/
*************************************************************************/
// If the lock screen mod is enabled but the mode is not defined,
define the mode
#ifdef JJL_LOCKSCREEN_MOD
# ifndef LOCKSCREEN_MODE
# define LOCKSCREEN_MODE 0
# endif
#endif
/
*************************************************************************/
// If the DailyHighLow mod is enabled but the Clock mod is not, enable
it
// The high/low mod uses clock access functions to detect the new day
// and reset the high/low values
#ifdef JJL_DAILYHIGHLOW_MOD
# ifndef JJL_CLOCKACCESS_MOD
# define JJL_CLOCKACCESS_MOD
# endif
#endif
#endif /* _CONFIG_H_ */
//
// The suggested naming convention for constants is:
// <developer initials>_<functionality name>_MOD
And some related discussion - when is it appropriate to check in
changes to the main code base?
#define SOME_MOD
which would use a test like
#ifdef SOME_MOD or #if defined(SOME_MOD)
And you proposed a symbol
#define SOME_MOD 1
which would use a test like
#if (1 == SOME_MOD)
I think for an enable/disable, the intent is more clear with a "is it
defined or not". To me, checking for a specific value implies that
the value is what matters and is more prone to errors. What happens
if the definition gets changed to
#define SOME_MOD 2
or
#define SOME_MOD
In your convention both cases would disable the mod while in mine
neither would.
Yes, we are all developers and this type of project is not likely to
get many "newbies". Yes, there will undoubtedly be a comment that
explains the convention being used. I guess part of it is my
personal style and what Im used to but part of it is what I see as
less error prone and easier to maintain.
Other folks have any thoughts on the subject?
On Nov 30, 2:10 pm, Steve Chamberlin <steve.chamber...@gmail.com>
wrote:
I just sent you the files for review. They contain modifications for:
* Showing current data on the lock screen instead of the BWLogger logo
* Track daily high/low values for temp/altitude/pressure. Add them to
the list of items that can be displayed on the Current Data screen.
They are also available to show on the lock screen.
* Add a couple of functions to access date and time. Used by the
daily high/low mod but could be of general use.
I am really enjoying this; it has been way too long since I got to
work on a small platform.
Jay
On Dec 1, 1:32 pm, Steve Chamberlin <steve.chamber...@gmail.com>
wrote:
> Hi guys,
>
> I'm OK with just defining the symbol instead of giving it a value of 0 or 1, although the 0/1 usage is the norm in most projects I've seen. I did a quick Google search for "config.h", and the first three examples all use the 0/1 pattern:
>