git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7759 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
18202523f8
commit
fc2af0f589
|
@ -203,17 +203,17 @@ typedef struct {
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/** @brief No pending conditions.*/
|
/** @brief No pending conditions.*/
|
||||||
#define CHN_NO_ERROR 0
|
#define CHN_NO_ERROR (eventflags_t)0
|
||||||
/** @brief Connection happened.*/
|
/** @brief Connection happened.*/
|
||||||
#define CHN_CONNECTED 1
|
#define CHN_CONNECTED (eventflags_t)1
|
||||||
/** @brief Disconnection happened.*/
|
/** @brief Disconnection happened.*/
|
||||||
#define CHN_DISCONNECTED 2
|
#define CHN_DISCONNECTED (eventflags_t)2
|
||||||
/** @brief Data available in the input queue.*/
|
/** @brief Data available in the input queue.*/
|
||||||
#define CHN_INPUT_AVAILABLE 4
|
#define CHN_INPUT_AVAILABLE (eventflags_t)4
|
||||||
/** @brief Output queue empty.*/
|
/** @brief Output queue empty.*/
|
||||||
#define CHN_OUTPUT_EMPTY 8
|
#define CHN_OUTPUT_EMPTY (eventflags_t)8
|
||||||
/** @brief Transmission end.*/
|
/** @brief Transmission end.*/
|
||||||
#define CHN_TRANSMISSION_END 16
|
#define CHN_TRANSMISSION_END (eventflags_t)16
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
#define Q_OK MSG_OK /**< @brief Operation successful. */
|
#define Q_OK MSG_OK /**< @brief Operation successful. */
|
||||||
#define Q_TIMEOUT MSG_TIMEOUT /**< @brief Timeout condition. */
|
#define Q_TIMEOUT MSG_TIMEOUT /**< @brief Timeout condition. */
|
||||||
#define Q_RESET MSG_RESET /**< @brief Queue has been reset. */
|
#define Q_RESET MSG_RESET /**< @brief Queue has been reset. */
|
||||||
#define Q_EMPTY -3 /**< @brief Queue empty. */
|
#define Q_EMPTY (msg_t)-3 /**< @brief Queue empty. */
|
||||||
#define Q_FULL -4 /**< @brief Queue full, */
|
#define Q_FULL (msg_t)-4 /**< @brief Queue full, */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,11 +38,11 @@
|
||||||
* @name Serial status flags
|
* @name Serial status flags
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define SD_PARITY_ERROR 32 /**< @brief Parity error happened. */
|
#define SD_PARITY_ERROR (eventflags_t)32 /**< @brief Parity. */
|
||||||
#define SD_FRAMING_ERROR 64 /**< @brief Framing error happened. */
|
#define SD_FRAMING_ERROR (eventflags_t)64 /**< @brief Framing. */
|
||||||
#define SD_OVERRUN_ERROR 128 /**< @brief Overflow happened. */
|
#define SD_OVERRUN_ERROR (eventflags_t)128 /**< @brief Overflow. */
|
||||||
#define SD_NOISE_ERROR 256 /**< @brief Noise on the line. */
|
#define SD_NOISE_ERROR (eventflags_t)256 /**< @brief Line noise. */
|
||||||
#define SD_BREAK_DETECTED 512 /**< @brief Break detected. */
|
#define SD_BREAK_DETECTED (eventflags_t)512 /**< @brief LIN Break. */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -105,7 +105,7 @@ void canStart(CANDriver *canp, const CANConfig *config) {
|
||||||
(canp->state == CAN_READY),
|
(canp->state == CAN_READY),
|
||||||
"invalid state");
|
"invalid state");
|
||||||
while (canp->state == CAN_STARTING) {
|
while (canp->state == CAN_STARTING) {
|
||||||
osalThreadSleepS(1);
|
osalThreadSleepS((systime_t)1);
|
||||||
}
|
}
|
||||||
if (canp->state == CAN_STOP) {
|
if (canp->state == CAN_STOP) {
|
||||||
canp->config = config;
|
canp->config = config;
|
||||||
|
@ -253,7 +253,7 @@ void canSleep(CANDriver *canp) {
|
||||||
if (canp->state == CAN_READY) {
|
if (canp->state == CAN_READY) {
|
||||||
can_lld_sleep(canp);
|
can_lld_sleep(canp);
|
||||||
canp->state = CAN_SLEEP;
|
canp->state = CAN_SLEEP;
|
||||||
osalEventBroadcastFlagsI(&canp->sleep_event, 0);
|
osalEventBroadcastFlagsI(&canp->sleep_event, (eventflags_t)0);
|
||||||
osalOsRescheduleS();
|
osalOsRescheduleS();
|
||||||
}
|
}
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
|
@ -276,7 +276,7 @@ void canWakeup(CANDriver *canp) {
|
||||||
if (canp->state == CAN_SLEEP) {
|
if (canp->state == CAN_SLEEP) {
|
||||||
can_lld_wakeup(canp);
|
can_lld_wakeup(canp);
|
||||||
canp->state = CAN_READY;
|
canp->state = CAN_READY;
|
||||||
osalEventBroadcastFlagsI(&canp->wakeup_event, 0);
|
osalEventBroadcastFlagsI(&canp->wakeup_event, (eventflags_t)0);
|
||||||
osalOsRescheduleS();
|
osalOsRescheduleS();
|
||||||
}
|
}
|
||||||
osalSysUnlock();
|
osalSysUnlock();
|
||||||
|
|
|
@ -156,7 +156,7 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp,
|
||||||
osalDbgAssert(macp->state == MAC_ACTIVE, "not active");
|
osalDbgAssert(macp->state == MAC_ACTIVE, "not active");
|
||||||
|
|
||||||
while (((msg = mac_lld_get_transmit_descriptor(macp, tdp)) != MSG_OK) &&
|
while (((msg = mac_lld_get_transmit_descriptor(macp, tdp)) != MSG_OK) &&
|
||||||
(timeout > 0U)) {
|
(timeout > (systime_t)0)) {
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
now = osalOsGetSystemTimeX();
|
now = osalOsGetSystemTimeX();
|
||||||
msg = osalThreadEnqueueTimeoutS(&macp->tdqueue, timeout);
|
msg = osalThreadEnqueueTimeoutS(&macp->tdqueue, timeout);
|
||||||
|
@ -216,7 +216,7 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp,
|
||||||
osalDbgAssert(macp->state == MAC_ACTIVE, "not active");
|
osalDbgAssert(macp->state == MAC_ACTIVE, "not active");
|
||||||
|
|
||||||
while (((msg = mac_lld_get_receive_descriptor(macp, rdp)) != MSG_OK) &&
|
while (((msg = mac_lld_get_receive_descriptor(macp, rdp)) != MSG_OK) &&
|
||||||
(timeout > 0U)) {
|
(timeout > (systime_t)0)) {
|
||||||
osalSysLock();
|
osalSysLock();
|
||||||
now = osalOsGetSystemTimeX();
|
now = osalOsGetSystemTimeX();
|
||||||
msg = osalThreadEnqueueTimeoutS(&macp->rdqueue, timeout);
|
msg = osalThreadEnqueueTimeoutS(&macp->rdqueue, timeout);
|
||||||
|
|
|
@ -182,7 +182,7 @@ static void wait(MMCDriver *mmcp) {
|
||||||
}
|
}
|
||||||
#if MMC_NICE_WAITING == TRUE
|
#if MMC_NICE_WAITING == TRUE
|
||||||
/* Trying to be nice with the other threads.*/
|
/* Trying to be nice with the other threads.*/
|
||||||
osalThreadSleep(1);
|
osalThreadSleepMilliseconds(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ static void sync(MMCDriver *mmcp) {
|
||||||
}
|
}
|
||||||
#if MMC_NICE_WAITING == TRUE
|
#if MMC_NICE_WAITING == TRUE
|
||||||
/* Trying to be nice with the other threads.*/
|
/* Trying to be nice with the other threads.*/
|
||||||
osalThreadSleep(1);
|
osalThreadSleepMilliseconds(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
spiUnselect(mmcp->config->spip);
|
spiUnselect(mmcp->config->spip);
|
||||||
|
|
|
@ -45,17 +45,17 @@
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OSAL_SUCCESS FALSE
|
#define OSAL_SUCCESS false
|
||||||
#define OSAL_FAILED TRUE
|
#define OSAL_FAILED true
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Messages
|
* @name Messages
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define MSG_OK 0
|
#define MSG_OK (msg_t)0
|
||||||
#define MSG_RESET -1
|
#define MSG_RESET (msg_t)-1
|
||||||
#define MSG_TIMEOUT -2
|
#define MSG_TIMEOUT (msg_t)-2
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ typedef struct {
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define OSAL_S2ST(sec) \
|
#define OSAL_S2ST(sec) \
|
||||||
((systime_t)((sec) * OSAL_ST_FREQUENCY))
|
((systime_t)((uint32_t)(sec) * (uint32_t)OSAL_ST_FREQUENCY))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Milliseconds to system ticks.
|
* @brief Milliseconds to system ticks.
|
||||||
|
@ -321,8 +321,8 @@ typedef struct {
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define OSAL_MS2ST(msec) \
|
#define OSAL_MS2ST(msec) \
|
||||||
((systime_t)((((((uint32_t)(msec)) * ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) /\
|
((systime_t)((((((uint32_t)(msec)) * \
|
||||||
1000UL) + 1UL))
|
((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000UL) + 1UL))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Microseconds to system ticks.
|
* @brief Microseconds to system ticks.
|
||||||
|
@ -335,8 +335,8 @@ typedef struct {
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define OSAL_US2ST(usec) \
|
#define OSAL_US2ST(usec) \
|
||||||
((systime_t)((((((uint32_t)(usec)) * ((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) /\
|
((systime_t)((((((uint32_t)(usec)) * \
|
||||||
1000000UL) + 1UL))
|
((uint32_t)OSAL_ST_FREQUENCY)) - 1UL) / 1000000UL) + 1UL))
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -485,7 +485,7 @@ static inline void osalSysUnlockFromISR(void) {
|
||||||
*/
|
*/
|
||||||
static inline syssts_t osalSysGetStatusAndLockX(void) {
|
static inline syssts_t osalSysGetStatusAndLockX(void) {
|
||||||
|
|
||||||
return 0;
|
return (syssts_t)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -555,7 +555,7 @@ static inline void osalOsRescheduleS(void) {
|
||||||
*/
|
*/
|
||||||
static inline systime_t osalOsGetSystemTimeX(void) {
|
static inline systime_t osalOsGetSystemTimeX(void) {
|
||||||
|
|
||||||
return 0;
|
return (systime_t)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -745,7 +745,7 @@ static inline void osalEventObjectInit(event_source_t *esp) {
|
||||||
|
|
||||||
osalDbgCheck(esp != NULL);
|
osalDbgCheck(esp != NULL);
|
||||||
|
|
||||||
esp->flags = 0;
|
esp->flags = (eventflags_t)0;
|
||||||
esp->cb = NULL;
|
esp->cb = NULL;
|
||||||
esp->param = NULL;
|
esp->param = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,6 +127,7 @@ TCSRC =
|
||||||
TCPPSRC =
|
TCPPSRC =
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here
|
||||||
|
PORTASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
|
||||||
ASMSRC = $(PORTASM)
|
ASMSRC = $(PORTASM)
|
||||||
|
|
||||||
PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \
|
PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \
|
||||||
|
|
Loading…
Reference in New Issue