Revision 510b93cc
core/src/aos_main.cpp | ||
---|---|---|
408 | 408 |
} |
409 | 409 |
} |
410 | 410 |
#else /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
411 |
while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCES)) { |
|
411 |
while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCESS)) {
|
|
412 | 412 |
/* |
413 | 413 |
* This code is executed if the received event was not about a deactivation of the snychronization signal. |
414 | 414 |
* The received event could be caused by any listener. |
core/src/aos_sssp.c | ||
---|---|---|
44 | 44 |
/* LOCAL VARIABLES */ |
45 | 45 |
/******************************************************************************/ |
46 | 46 |
|
47 |
#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__) |
|
48 |
|
|
49 | 47 |
/** |
50 | 48 |
* @brief A timer event based delays. |
51 | 49 |
*/ |
... | ... | |
61 | 59 |
*/ |
62 | 60 |
static event_listener_t _eventListenerDelay; |
63 | 61 |
|
64 |
#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
|
65 |
|
|
66 | 62 |
/******************************************************************************/ |
67 | 63 |
/* LOCAL FUNCTIONS */ |
68 | 64 |
/******************************************************************************/ |
69 | 65 |
|
70 |
#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__) |
|
71 |
|
|
72 | 66 |
/** |
73 | 67 |
* @brief General callback function to be used for any local timers. |
74 | 68 |
* |
... | ... | |
85 | 79 |
return; |
86 | 80 |
} |
87 | 81 |
|
88 |
#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
|
89 |
|
|
90 | 82 |
/** |
91 | 83 |
* @brief Waits for the S signal to switch to the desired state. |
92 | 84 |
* |
... | ... | |
120 | 112 |
return AOS_FAILURE; |
121 | 113 |
} |
122 | 114 |
|
123 |
#if (AMIROOS_CFG_SSSP_MASTER == true) || defined(__DOXYGEN__) |
|
124 |
|
|
125 | 115 |
/** |
126 | 116 |
* @brief Uses the local delay timer to setup a timed event and waits for it to fire. |
127 | 117 |
* |
... | ... | |
156 | 146 |
return AOS_FAILURE; |
157 | 147 |
} |
158 | 148 |
|
159 |
#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
|
160 |
|
|
161 | 149 |
/******************************************************************************/ |
162 | 150 |
/* EXPORTED FUNCTIONS */ |
163 | 151 |
/******************************************************************************/ |
... | ... | |
167 | 155 |
*/ |
168 | 156 |
void aosSsspInit(void) |
169 | 157 |
{ |
170 |
#if (AMIROOS_CFG_SSSP_MSI == true) |
|
171 |
// module ID is initialized as 'invalid' |
|
172 |
aos.sssp.moduleId = AOS_SSSP_MODULEID_INVALID; |
|
173 |
#endif /* (AMIROOS_CFG_SSSP_MSI == true) */ |
|
158 |
// local variables |
|
159 |
apalControlGpioState_t state; |
|
174 | 160 |
|
175 | 161 |
#if (AMIROOS_CFG_SSSP_STARTUP == true) |
176 | 162 |
// AMiRo-OS has to perform the basic initialization |
177 | 163 |
aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_1_1; |
178 |
#if (AMIROOS_CFG_DBG == true) |
|
179 |
// check whether the initial signal configuration is correct |
|
180 |
{ |
|
181 |
apalControlGpioState_t state; |
|
182 |
// S signal |
|
183 |
apalControlGpioGet(&moduleSsspGpioS, &state); |
|
184 |
aosDbgAssert(state == APAL_GPIO_ON); |
|
185 |
// PD signal |
|
186 |
apalControlGpioGet(&moduleSsspGpioPD, &state); |
|
187 |
aosDbgAssert(state == APAL_GPIO_OFF); |
|
188 |
} |
|
189 |
#endif /* (AMIROOS_CFG_DBG == true) */ |
|
190 | 164 |
#else /* (AMIROOS_CFG_SSSP_STARTUP == true) */ |
191 | 165 |
// basic initialization was already performed by a bootloader |
192 | 166 |
aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_2_1; |
193 |
#if (AMIROOS_CFG_DBG == true) |
|
194 |
// check whether the initial signal configuration is correct |
|
195 |
{ |
|
196 |
apalControlGpioState_t state; |
|
197 |
// S signal |
|
198 |
apalControlGpioGet(&moduleSsspGpioS, &state); |
|
199 |
aosDbgAssert(state == APAL_GPIO_ON); |
|
200 |
// PD signal |
|
201 |
apalControlGpioGet(&moduleSsspGpioPD, &state); |
|
202 |
aosDbgAssert(state == APAL_GPIO_OFF); |
|
203 |
} |
|
204 |
#endif /* (AMIROOS_CFG_DBG == true) */ |
|
205 | 167 |
#endif /* (AMIROOS_CFG_SSSP_STARTUP == true) */ |
206 | 168 |
|
207 |
#if (AMIROOS_CFG_SSSP_MASTER == true) |
|
169 |
// check all SSSP signals for correct state |
|
170 |
apalControlGpioGet(&moduleSsspGpioS, &state); |
|
171 |
aosDbgAssert(state == APAL_GPIO_ON); |
|
172 |
apalControlGpioGet(&moduleSsspGpioPD, &state); |
|
173 |
aosDbgAssert(state == APAL_GPIO_OFF); |
|
174 |
#if (AMIROOS_CFG_SSSP_STACK_END != true) |
|
175 |
apalControlGpioGet(&moduleSsspGpioUP, &state); |
|
176 |
aosDbgAssert(state == APAL_GPIO_OFF); |
|
177 |
#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */ |
|
178 |
#if (AMIROOS_CFG_SSSP_STACK_START != true) |
|
179 |
apalControlGpioGet(&moduleSsspGpioDN, &state); |
|
180 |
aosDbgAssert(state == APAL_GPIO_OFF); |
|
181 |
#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */ |
|
182 |
|
|
183 |
#if (AMIROOS_CFG_SSSP_MSI == true) |
|
184 |
// module ID is initialized as 'invalid' |
|
185 |
aos.sssp.moduleId = AOS_SSSP_MODULEID_INVALID; |
|
186 |
#endif /* (AMIROOS_CFG_SSSP_MSI == true) */ |
|
187 |
|
|
208 | 188 |
// initialize static variables |
209 | 189 |
chVTObjectInit(&_delayTimer); |
210 | 190 |
chEvtObjectInit(&_eventSourceDelay); |
211 |
#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
|
212 | 191 |
|
213 | 192 |
return; |
214 | 193 |
} |
core/src/aos_system.c | ||
---|---|---|
574 | 574 |
#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) |
575 | 575 |
|
576 | 576 |
(void)argv; |
577 |
(void)argc; |
|
578 |
|
|
579 |
// broadcast shutdown event |
|
580 |
chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK); |
|
581 |
// set terminate flag so no further prompt will be printed |
|
582 |
chThdTerminate(chThdGetSelfX()); |
|
583 | 577 |
|
584 |
return AOS_OK; |
|
578 |
if (argc != 1) { |
|
579 |
// error |
|
580 |
chprintf(stream, "ERROR: no arguments allowed.\n"); |
|
581 |
return AOS_INVALIDARGUMENTS; |
|
582 |
} else { |
|
583 |
// broadcast shutdown event |
|
584 |
chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK); |
|
585 |
// set terminate flag so no further prompt will be printed |
|
586 |
chThdTerminate(chThdGetSelfX()); |
|
587 |
return AOS_OK; |
|
588 |
} |
|
585 | 589 |
|
586 | 590 |
#elif (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) |
587 | 591 |
|
modules/DiWheelDrive_1-1/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/DiWheelDrive_1-2/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/LightRing_1-0/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/LightRing_1-2/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/NUCLEO-F103RB/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/NUCLEO-F401RE/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
120 |
|
|
121 |
/** @} */ |
|
116 | 122 |
|
117 | 123 |
/*===========================================================================*/ |
118 | 124 |
/** |
modules/NUCLEO-F767ZI/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
120 |
|
|
121 |
/** @} */ |
|
116 | 122 |
|
117 | 123 |
/*===========================================================================*/ |
118 | 124 |
/** |
modules/NUCLEO-L476RG/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
120 |
|
|
121 |
/** @} */ |
|
116 | 122 |
|
117 | 123 |
/*===========================================================================*/ |
118 | 124 |
/** |
modules/PowerManagement_1-1/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/PowerManagement_1-2/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_AMiRoBLT |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
116 | 120 |
|
117 | 121 |
/** @} */ |
118 | 122 |
|
modules/STM32F407G-DISC1/aosconf.h | ||
---|---|---|
112 | 112 |
* @brief Identifier of the instaled bootloader (if any). |
113 | 113 |
* @note See aos_bootloader.h file for a list of available settings. |
114 | 114 |
*/ |
115 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
115 |
#if !defined(OS_CFG_BOOTLOADER) |
|
116 |
#define AMIROOS_CFG_BOOTLOADER AOS_BOOTLOADER_NONE |
|
117 |
#else /* !defined(OS_CFG_BOOTLOADER) */ |
|
118 |
#define AMIROOS_CFG_BOOTLOADER OS_CFG_BOOTLOADER |
|
119 |
#endif /* !defined(OS_CFG_BOOTLOADER) */ |
|
120 |
|
|
121 |
/** @} */ |
|
116 | 122 |
|
117 | 123 |
/*===========================================================================*/ |
118 | 124 |
/** |
Also available in: Unified diff