/**************************************************************************** Filename: "LWFSYMBL.H" Project: EZ LWF. Language: CrossCode "C" compiler for the Motorola 68332 processor. Created on: 14-April-1995, 15:32 Created by: Tom V. J. Maglione, 29 Rice Rd, Wayland, MA 01778 (508) 655-9120 Revision History: Purpose: This file defines all of the symbolic constants used in the EZ LWF software package. Algorithms used: No special algorithms are used here. Inputs: None. Outputs: None. Global Variables referenced: Subroutines referenced: None. Referenced by: all software in the EZ LWF application. ****************************************************************************/ #include "OPSTATUS.H" /* Operating status bit definitions file */ #include "key.h" /* define old keycodes */ /**************************************************************************** The next section defines some universally useful constants: ****************************************************************************/ #define LWF /* This is the LWF application type */ #define TRUE 1 /* TRUE */ #define FALSE 0 /* FALSE */ #define MASK_LSBYTE 0x00FF /* mask for Least-Significant Byte */ #define RTC_READ_MASK 0x007F /* mask for reading Real Time Clock */ #define INTEGER_POS_MIN 1 /* the minimum positive integer */ #define ZERO 0 /* the ubiquitous additive identity */ #define FACTOR_TO_PERCENT 100 /* converts factors to percentages */ #define FACTOR_TO_PERCENT_FP 100.0 /* converts factors to percentages */ #define FP_ONE 1.0 /* Floating-point constant 1.0 */ #define FP_ONE_HALF 0.5 /* Floating-point constant 1/2 */ #define NSECS_PER_SEC 1E+9 /* the number of nanoseconds in each second */ #define NSECS_PER_MIN 60E+9 /* the number of nanoseconds in each minute */ #define SECS_PER_MIN 60 /* the number of seconds in each minute */ #define SECS_PER_HOUR 3600 /* the number of seconds in each hour */ #define SECS_PER_DAY 86400 /* the number of seconds in each day */ #define SAM_PER_MINUTE (SAM_PER_SECOND*SECS_PER_MIN) /* # samples per minute*/ #define SAM_PER_HOUR ((unsigned long int)SAM_PER_SECOND*SECS_PER_HOUR) /*samples*/ #define SAM_PER_DAY ((unsigned long int)SAM_PER_SECOND*SECS_PER_DAY) /*samples*/ #define MINS_PER_HOUR 60 /* the number of minutes in each hour */ #define HOURS_PER_DAY 24 /* the number of hours in each day */ #define DAYS_PER_YEAR 365 /* the number of days in one (non-leap) year */ #define MONTHS_PER_YEAR 12 /* the number of months in one year */ #define YEARS_PER_LEAP 4 /* the number of years between leap years */ #define YEARS_PER_CENTURY 100 /* the number of years in each century */ #define YEARS_DIFFERENCE_MAX 89 /* the max number of years to fit in 32768 days */ #define CENTURY_BASE_20 1900 /* base year for 20th century */ #define CENTURY_BASE_21 2000 /* base year for 21st century */ #define SECS_PER_SAMPLE (1.0/SAM_PER_SECOND) /* # seconds per sample cycle */ #define BITS_PER_NYBBLE 4 /* # of bits per nybble (half-byte) */ #define BITS_PER_BYTE 8 /* # of bits per char (byte) */ #define BYTES_PER_WORD 2 /* # of bytes per int word */ #define BYTES_PER_CRC 2 /* # of bytes per CRC word */ #define WORDS_PER_LONG 2 /* # of int words per long int */ #define BITS_PER_PLC12 12 /* # of bits to shift for function "plc12" */ #define BITS_PER_WORD 16 /* # of bits per int word */ #define WATCH_DOG_WRITE 1 /* value to write to satisfy the watchdog timer */ /**************************************************************************** The next set of constants for conversion between different units were obtained from the following sources: 1. page 13 of Frank's 1956 CRC handbook; 2. pages 8, 9, 10, 11 from the Fundamentals of Weighing chapter in the book "Weighing and Proportioning of Bulk Solids" by Hendrik Calijn, published by Trans Tech Publications, second edition (1983); 3. NIST Handbook 44 (1995), United States Department of Commerce Technology Administration, National Institute of Standards and Technology, Specifications, Tolerances, and other Technical Requirements for Weighing and Measuring Devices, as adopted by the 79th National Conference on Weights and Measures 1994. Note: All weights are Avoirdupois: ****************************************************************************/ #define INCHES_PER_FOOT 12 /* NIST EXACT # inches per foot */ #define METERS_PER_INCH 2.54E-2 /* NIST EXACT # meters per inch */ #define METERS_PER_FOOT (METERS_PER_INCH*INCHES_PER_FOOT) /* NIST EXACT */ #define POUNDS_PER_TON 2000 /* NIST EXACT # pounds per short ton */ #define POUNDS_PER_LTON 2240 /* NIST EXACT # pounds per long ton */ #define KGRAMS_PER_POUND 0.45359237 /* NIST EXACT # kilograms per pound */ #define KGRAMS_PER_MTON 1000 /* NIST EXACT # kgrams per metric ton*/ #define GRAMS_PER_KGRAM 1000 /* NIST EXACT # grams per kilogram */ #define GRAMS_PER_POUND (KGRAMS_PER_POUND*GRAMS_PER_KGRAM) /* NIST EXACT */ #define MTONS_PER_POUND (KGRAMS_PER_POUND/KGRAMS_PER_MTON) /* NIST EXACT */ #define FEET_PER_METER (1.0/METERS_PER_FOOT) /* NIST derived */ #define POUNDS_PER_GRAM (1.0/GRAMS_PER_POUND) /* NIST derived */ #define POUNDS_PER_KGRAM (1.0/KGRAMS_PER_POUND) /* NIST derived */ #define POUNDS_PER_MTON (1.0/MTONS_PER_POUND) /* NIST derived */ /* ruler: 12345678901234567890123456789012345678901234567890 */ #define COPYRIGHT_MSG "_copyright: DC.B '(C) Thayer Scale/Hyer Industries, Inc, 1992-2001 ',0 " #define DRIVER_SIGNATURE "DRIVER" /* driver header signature string */ /**************************************************************************** End of file "LWFSYMBL.H"... ****************************************************************************/