/***************************************************************************** * * * LOGIC.H * * * ***************************************************************************** * * Logic Definitions Header File * *****************************************************************************/ /***************************************************************************** * * * CONSTANTS * * * *****************************************************************************/ /* * TRUE and FALSE Synonyms */ #ifndef FALSE /* "FALSE" not defined? */ #define FALSE 0 #define TRUE ~FALSE #endif #ifndef YES /* "YES" not defined? */ #define YES TRUE #endif #ifndef NO /* "NO" not defined? */ #define NO FALSE #endif #ifndef ON /* "ON" not defined? */ #define ON TRUE #endif #ifndef OFF /* "OFF" not defined? */ #define OFF FALSE #endif #define ENABLE TRUE #define DISABLE FALSE /***************************************************************************** * * * MACROS * * * *****************************************************************************/ /***************************************************************************** * * * IS(...) * * * ***************************************************************************** * * Is. Is the specifed bit "b" set in "a"? * * Input: "a" - bit field. * "b" - bit to check if set in bit field. * Return: TRUE - if bit set in bit field. * *****************************************************************************/ #define IS(a,b) ((a) & (b)) /***************************************************************************** * * * SET_FLG(...) * * * ***************************************************************************** * * Set flag. * * Input: "flag" - flag to set. * Return: "flag" - set. * *****************************************************************************/ #define SET_FLG(flag) flag = TRUE /***************************************************************************** * * * CLR_FLG(...) * * * ***************************************************************************** * * Clear flag. * * Input: "flag" - flag to clear. * Return: "flag" - cleared. * *****************************************************************************/ #define CLR_FLG(flag) flag = FALSE