/* timeout.h -- external defs for RunState timeout library
 */
#ifndef timeout_h
#define timeout_h

// get basic types
#include <Arduino.h>

// (new)input States ... bit mapped for the most part...
//  sent from SensorTask to RunTask
// initial start
#define iSTART	 0x0000	// startup while collecting baseline values
#define iREADY	 0x1000	// ready to run, ORed with everything else
// Timeout (1 bit)
#define iTIMEOUT 0x8000	// Time elapsed

// RunTask state
extern word runState;
#define rINIT 0x0000	// initial running state
#define rWAIT 0x8000	// WAIT running state


// external methods
extern void startTMO( word samples );
extern void startTMOwait( word samples, word rState );
extern void stopTMO();
extern word execTMO(void);

#endif //timeout_h
