Revision 1678f270 core/inc/aos_system.h

View differences:

core/inc/aos_system.h
1 1
/*
2 2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4 4

  
5 5
This program is free software: you can redistribute it and/or modify
6 6
it under the terms of the GNU General Public License as published by
......
27 27
#ifndef _AMIROOS_SYSTEM_H_
28 28
#define _AMIROOS_SYSTEM_H_
29 29

  
30
#include <time.h>
30 31
#include <aos_iostream.h>
31 32
#include <amiro-lld.h>
32 33
#include <aos_shell.h>
......
63 64
 */
64 65
#define AOS_SYSTEM_EVENTFLAGS_RESTART           (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 4))
65 66

  
66
#if (AMIROOS_CFG_SSSP_ENABLE == true)
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
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
67 80

  
68 81
/**
69 82
 * @brief   Major version of the implemented SSSP.
......
81 94
 */
82 95
#define AOS_SYSTEM_SSSP_TIMEOUT                 (10 * AMIROOS_CFG_SSSP_SIGNALDELAY)
83 96

  
84
#endif
85

  
86
/**
87
 * @brief   Enumerator to identify shutdown types.
88
 */
89
typedef enum aos_shutdown {
90
  AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
91
  AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
92
  AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
93
  AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
94
  AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
95
  AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
96
} aos_shutdown_t;
97

  
98
#if (AMIROOS_CFG_SSSP_ENABLE == true)
99

  
100 97
/**
101 98
 * @brief   Enumerator of the several stages of SSSP.
102 99
 */
......
119 116
  AOS_SSSP_SHUTDOWN_3   = 0x38, /**< Identifier of SSSP shutdown phase stage 3. */
120 117
} aos_ssspstage_t;
121 118

  
122
#endif
123

  
124
#if (AMIROOS_CFG_SSSP_ENABLE == true)
125 119
/**
126 120
 * @brief   Type to represent module IDs.
127 121
 */
128 122
typedef uint16_t aos_ssspmoduleid_t;
129
#endif
130 123

  
124
#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
131 125

  
132 126
/**
133 127
 * @brief   AMiRo-OS base system structure.
134 128
 */
135 129
typedef struct aos_system {
136
#if (AMIROOS_CFG_SSSP_ENABLE == true)
130
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
137 131
  /**
138 132
   * @brief   SSSP relevant data.
139 133
   */
......
150 144
     */
151 145
    aos_ssspmoduleid_t moduleId;
152 146
  } sssp;
153
#endif
147
#endif /* AMIROOS_CFG_SSSP_ENABLE == true */
148

  
154 149
  /**
155 150
   * @brief   System I/O stream.
156 151
   */
......
202 197
  void aosSysInit(void);
203 198
#endif
204 199
  void aosSysStart(void);
205
  #if (AMIROOS_CFG_SSSP_ENABLE == true)
200
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined (__DOXYGEN__)
206 201
  eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener);
207 202
#endif
208 203
  void aosSysGetUptimeX(aos_timestamp_t* ut);

Also available in: Unified diff