git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7151 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
3ff810e5ee
commit
07339aeb0e
|
@ -731,6 +731,8 @@ static inline msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp,
|
|||
*/
|
||||
static inline void osalEventObjectInit(event_source_t *esp) {
|
||||
|
||||
osalDbgCheck(esp != NULL);
|
||||
|
||||
esp->flags = 0;
|
||||
esp->cb = NULL;
|
||||
esp->param = NULL;
|
||||
|
@ -747,6 +749,8 @@ static inline void osalEventObjectInit(event_source_t *esp) {
|
|||
static inline void osalEventBroadcastFlagsI(event_source_t *esp,
|
||||
eventflags_t flags) {
|
||||
|
||||
osalDbgCheck(esp != NULL);
|
||||
|
||||
esp->flags |= flags;
|
||||
if (esp->cb != NULL)
|
||||
esp->cb(esp);
|
||||
|
@ -763,12 +767,37 @@ static inline void osalEventBroadcastFlagsI(event_source_t *esp,
|
|||
static inline void osalEventBroadcastFlags(event_source_t *esp,
|
||||
eventflags_t flags) {
|
||||
|
||||
osalDbgCheck(esp != NULL);
|
||||
|
||||
chSysLock();
|
||||
osalEventBroadcastFlagsI(esp, flags);
|
||||
chSchRescheduleS();
|
||||
chSysUnlock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Event callback setup.
|
||||
* @note The callback is invoked from ISR context and can
|
||||
* only invoke I-Class functions. The callback is meant
|
||||
* to wakeup the task that will handle the event by
|
||||
* calling @p osalEventGetAndClearFlagsI().
|
||||
*
|
||||
* @param[in] esp pointer to the event flags object
|
||||
* @param[in] cb pointer to the callback function
|
||||
* @param[in] param parameter to be passed to the callback function
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
static inline void osalEventSetCallback(event_source_t *esp,
|
||||
eventcallback_t cb,
|
||||
void *param) {
|
||||
|
||||
osalDbgCheck(esp != NULL);
|
||||
|
||||
esp->cb = cb;
|
||||
esp->param = param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes s @p mutex_t object.
|
||||
*
|
||||
|
|
|
@ -391,8 +391,10 @@ typedef struct {
|
|||
* @brief Panic message.
|
||||
* @note This field is only present if some debug options have been
|
||||
* activated.
|
||||
* @note Accesses to this pointer must never be optimized out so the
|
||||
* field itself is declared volatile.
|
||||
*/
|
||||
const char *dbg_panic_msg;
|
||||
const char * volatile dbg_panic_msg;
|
||||
#endif
|
||||
} nil_system_t;
|
||||
|
||||
|
|
Loading…
Reference in New Issue