Revision c53ef0b1 core/inc/aos_types.h

View differences:

core/inc/aos_types.h
46 46
/******************************************************************************/
47 47

  
48 48
/**
49
 * @brief   Error and status type generally used in AMiRo-OS.
49
 * @brief   Status type generally used in AMiRo-OS.
50
 * @details By definition, the most significant bit (MSB) indicates whether an error occurred (e.g. the function call failed).
51
 *          All other bits can be used to specify the issue in more detail.
52
 *          If the MSB is unset, all other bits can still be used to indicate and specify non-critical warnings.
53
 *          As a result, a value of 0 (no bit set) indicates a flawles success.
50 54
 */
51 55
typedef uint8_t aos_status_t;
52 56

  
......
58 62
/**
59 63
 * @brief   Success: no error or warning occurred.
60 64
 */
61
#define AOS_SUCCESS                             ((aos_status_t)0x00u)
65
#define AOS_SUCCESS                             AOS_OK
62 66

  
63 67
/**
64 68
 * @brief   Some unspecified waring occurred.
......
73 77
/**
74 78
 * @brief   An error occurred.
75 79
 */
76
#define AOS_ERROR                               ((aos_status_t)0x80u)
80
#define AOS_ERROR                               ((aos_status_t)(1 << ((sizeof(aos_status_t) * 8) - 1)))
77 81

  
78 82
/**
79 83
 * @brief   An error occurred.
80 84
 */
81
#define AOS_FAILURE                             ((aos_status_t)0x80u)
85
#define AOS_FAILURE                             AOS_ERROR
82 86

  
83 87
/******************************************************************************/
84 88
/* MACROS                                                                     */

Also available in: Unified diff