/** 
 * \file retcode.h
 * \brief Return codes enum
 *
 * \author Juraj Golej
 * \version 1.0
 */ 


#ifndef RETCODE_H_
#define RETCODE_H_

/**
 * \brief Check condition, and if is true, return retCode value.
 */
#define Try(condition, retcode) if((condition)) return (retcode);

/**
 * \brief Return codes enum
 */
enum retCode {
	ENone = 0,				///< Everything OK
	EDenied = -1,			///< Access or changes denied
	EInvalidParameter = -2,	///< Invalid input parameter
	EBusy = -3,				///< Busy
	ENullPtr = -4,			///< Null pointer
	EOverflow = -5,			///< Overflow
	EHardwareProblem = -6,	///< Problem with hardware (for example: unconnected external crystal)
	ENoInit = -7,			///< Element (struct, array...) is not initialized
	EEof = -8,				///< End of file
};

#endif /* RETCODE_H_ */