Revision f3ac1c96 core/inc/aos_system.h

View differences:

core/inc/aos_system.h
34 34
#include <aos_time.h>
35 35
#include <chprintf.h>
36 36

  
37
/******************************************************************************/
38
/* CONSTANTS                                                                  */
39
/******************************************************************************/
40

  
37 41
/**
38 42
 * @brief   Resolution of the system time measurement.
39 43
 */
......
64 68
 */
65 69
#define AOS_SYSTEM_EVENTFLAGS_RESTART           (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 4))
66 70

  
67
/**
68
 * @brief   Enumerator to identify shutdown types.
69
 */
70
typedef enum aos_shutdown {
71
  AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
72
  AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
73
  AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
74
  AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
75
  AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
76
  AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
77
} aos_shutdown_t;
78

  
79 71
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
80 72

  
81 73
/**
......
94 86
 */
95 87
#define AOS_SYSTEM_SSSP_TIMEOUT                 (10 * AMIROOS_CFG_SSSP_SIGNALDELAY)
96 88

  
89
#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
90

  
91
/******************************************************************************/
92
/* SETTINGS                                                                   */
93
/******************************************************************************/
94

  
95
/******************************************************************************/
96
/* CHECKS                                                                     */
97
/******************************************************************************/
98

  
99
/******************************************************************************/
100
/* DATA STRUCTURES AND TYPES                                                  */
101
/******************************************************************************/
102

  
103
/**
104
 * @brief   Enumerator to identify shutdown types.
105
 */
106
typedef enum aos_shutdown {
107
  AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
108
  AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
109
  AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
110
  AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
111
  AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
112
  AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
113
} aos_shutdown_t;
114

  
115
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
116

  
97 117
/**
98 118
 * @brief   Enumerator of the several stages of SSSP.
99 119
 */
......
176 196

  
177 197
} aos_system_t;
178 198

  
179
/**
180
 * @brief   Global system object.
181
 */
182
extern aos_system_t aos;
199
/******************************************************************************/
200
/* MACROS                                                                     */
201
/******************************************************************************/
183 202

  
184 203
/**
185 204
 * @brief   Printf function that uses the default system I/O stream.
......
188 207
 */
189 208
#define aosprintf(fmt, ...)                     chprintf((BaseSequentialStream*)&aos.iostream, fmt, ##__VA_ARGS__)
190 209

  
210
/******************************************************************************/
211
/* EXTERN DECLARATIONS                                                        */
212
/******************************************************************************/
213

  
214
/**
215
 * @brief   Global system object.
216
 */
217
extern aos_system_t aos;
218

  
191 219
#ifdef __cplusplus
192 220
extern "C" {
193 221
#endif
......
211 239
}
212 240
#endif
213 241

  
242
/******************************************************************************/
243
/* INLINE FUNCTIONS                                                           */
244
/******************************************************************************/
245

  
214 246
/**
215 247
 * @brief   Retrieves the system uptime.
216 248
 *

Also available in: Unified diff