2013-08-02 11:45:33 +00:00
|
|
|
/*
|
2015-01-11 13:56:55 +00:00
|
|
|
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2013-11-19 15:16:41 +00:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2013-11-19 15:16:41 +00:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2013-11-19 15:16:41 +00:00
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2013-08-02 11:45:33 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file osal.c
|
|
|
|
* @brief OSAL module code.
|
|
|
|
*
|
|
|
|
* @addtogroup OSAL
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "osal.h"
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module local definitions. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module exported variables. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Pointer to a halt error message.
|
|
|
|
* @note The message is meant to be retrieved by the debugger after the
|
|
|
|
* system halt caused by an unexpected error.
|
|
|
|
*/
|
|
|
|
const char *osal_halt_msg;
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module local types. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module local variables. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module local functions. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Module exported functions. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief OSAL module initialization.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void osalInit(void) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief System halt with error message.
|
|
|
|
*
|
|
|
|
* @param[in] reason the halt message pointer
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
#if !defined(__DOXYGEN__)
|
|
|
|
__attribute__((weak, noreturn))
|
|
|
|
#endif
|
|
|
|
void osalSysHalt(const char *reason) {
|
|
|
|
|
2014-11-02 16:38:13 +00:00
|
|
|
osalSysDisable();
|
2013-08-02 11:45:33 +00:00
|
|
|
osal_halt_msg = reason;
|
2015-03-08 21:19:58 +00:00
|
|
|
while (true) {
|
|
|
|
}
|
2013-08-02 11:45:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-02 16:38:13 +00:00
|
|
|
* @brief Dequeues and wakes up one thread from the queue, if any.
|
2013-08-02 11:45:33 +00:00
|
|
|
*
|
|
|
|
* @param[in] tqp pointer to the threads queue object
|
2014-11-02 16:38:13 +00:00
|
|
|
* @param[in] msg the message code
|
2013-08-02 11:45:33 +00:00
|
|
|
*
|
2014-11-02 16:38:13 +00:00
|
|
|
* @iclass
|
2013-08-02 11:45:33 +00:00
|
|
|
*/
|
2014-11-02 16:38:13 +00:00
|
|
|
void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) {
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2014-11-02 16:38:13 +00:00
|
|
|
(void)tqp;
|
|
|
|
(void)msg;
|
|
|
|
}
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2014-11-02 16:38:13 +00:00
|
|
|
/**
|
|
|
|
* @brief Dequeues and wakes up all threads from the queue.
|
|
|
|
*
|
|
|
|
* @param[in] tqp pointer to the threads queue object
|
|
|
|
* @param[in] msg the message code
|
|
|
|
*
|
|
|
|
* @iclass
|
|
|
|
*/
|
|
|
|
void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) {
|
2013-08-02 11:45:33 +00:00
|
|
|
|
2014-11-02 16:38:13 +00:00
|
|
|
(void)tqp;
|
|
|
|
(void)msg;
|
2013-08-02 11:45:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @} */
|