git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4350 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2012-06-27 18:03:31 +00:00
parent 9492ff4976
commit 38ac197ecd
7 changed files with 23 additions and 23 deletions

View File

@ -49,7 +49,7 @@ typedef enum {
BLK_DISCONNECTING = 4, /**< Disconnection in progress. */ BLK_DISCONNECTING = 4, /**< Disconnection in progress. */
BLK_READY = 5, /**< Device ready. */ BLK_READY = 5, /**< Device ready. */
BLK_READING = 6, /**< Read operation in progress. */ BLK_READING = 6, /**< Read operation in progress. */
BLK_WRITING = 7, /**< Write operation in progress. */ BLK_WRITING = 7 /**< Write operation in progress. */
} blkstate_t; } blkstate_t;
/** /**

View File

@ -215,7 +215,7 @@ typedef enum {
USB_STOP = 1, /**< Stopped. */ USB_STOP = 1, /**< Stopped. */
USB_READY = 2, /**< Ready, after bus reset. */ USB_READY = 2, /**< Ready, after bus reset. */
USB_SELECTED = 3, /**< Address assigned. */ USB_SELECTED = 3, /**< Address assigned. */
USB_ACTIVE = 4, /**< Active, configuration selected.*/ USB_ACTIVE = 4 /**< Active, configuration selected.*/
} usbstate_t; } usbstate_t;
/** /**
@ -248,7 +248,7 @@ typedef enum {
USB_EVENT_CONFIGURED = 2, /**< Configuration selected. */ USB_EVENT_CONFIGURED = 2, /**< Configuration selected. */
USB_EVENT_SUSPEND = 3, /**< Entering suspend mode. */ USB_EVENT_SUSPEND = 3, /**< Entering suspend mode. */
USB_EVENT_WAKEUP = 4, /**< Leaving suspend mode. */ USB_EVENT_WAKEUP = 4, /**< Leaving suspend mode. */
USB_EVENT_STALLED = 5, /**< Endpoint 0 error, stalled. */ USB_EVENT_STALLED = 5 /**< Endpoint 0 error, stalled. */
} usbevent_t; } usbevent_t;
/** /**
@ -322,7 +322,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
* @{ * @{
*/ */
/** /**
* @brief Returns the sriver state. * @brief Returns the driver state.
* *
* @param[in] usbp pointer to the @p USBDriver object * @param[in] usbp pointer to the @p USBDriver object
* @return The driver state. * @return The driver state.
@ -331,6 +331,15 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
*/ */
#define usbGetDriverStateI(usbp) ((usbp)->state) #define usbGetDriverStateI(usbp) ((usbp)->state)
/**
* @brief Fetches a 16 bits word value from an USB message.
*
* @param[in] p pointer to the 16 bits word
*
* @notapi
*/
#define usbFetchWord(p) ((uint16_t)*(p) | ((uint16_t)*((p) + 1) << 8))
/** /**
* @brief Connects the USB device. * @brief Connects the USB device.
* *

View File

@ -341,15 +341,6 @@ struct USBDriver {
/* Driver macros. */ /* Driver macros. */
/*===========================================================================*/ /*===========================================================================*/
/**
* @brief Fetches a 16 bits word value from an USB message.
*
* @param[in] p pointer to the 16 bits word
*
* @notapi
*/
#define usb_lld_fetch_word(p) (*(uint16_t *)(p))
/** /**
* @brief Returns the exact size of a receive transaction. * @brief Returns the exact size of a receive transaction.
* @details The received size can be different from the size specified in * @details The received size can be different from the size specified in

View File

@ -109,12 +109,12 @@ void _port_irq_epilogue(regarm_t lr) {
required or not.*/ required or not.*/
if (chSchIsPreemptionRequired()) { if (chSchIsPreemptionRequired()) {
/* Preemption is required we need to enforce a context switch.*/ /* Preemption is required we need to enforce a context switch.*/
ctxp->pc = _port_switch_from_isr; ctxp->pc = (void *)_port_switch_from_isr;
} }
else { else {
/* Preemption not required, we just need to exit the exception /* Preemption not required, we just need to exit the exception
atomically.*/ atomically.*/
ctxp->pc = _port_exit_from_isr; ctxp->pc = (void *)_port_exit_from_isr;
} }
/* Note, returning without unlocking is intentional, this is done in /* Note, returning without unlocking is intentional, this is done in

View File

@ -208,9 +208,9 @@ struct context {
tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \
wsize - \ wsize - \
sizeof(struct intctx)); \ sizeof(struct intctx)); \
tp->p_ctx.r13->r4 = pf; \ tp->p_ctx.r13->r4 = (void *)(pf); \
tp->p_ctx.r13->r5 = arg; \ tp->p_ctx.r13->r5 = (void *)(arg); \
tp->p_ctx.r13->lr = _port_thread_start; \ tp->p_ctx.r13->lr = (void *)(_port_thread_start); \
} }
/** /**

View File

@ -157,7 +157,7 @@ void _port_irq_epilogue(void) {
required or not.*/ required or not.*/
if (chSchIsPreemptionRequired()) { if (chSchIsPreemptionRequired()) {
/* Preemption is required we need to enforce a context switch.*/ /* Preemption is required we need to enforce a context switch.*/
ctxp->pc = _port_switch_from_isr; ctxp->pc = (void *)_port_switch_from_isr;
#if CORTEX_USE_FPU #if CORTEX_USE_FPU
/* Triggering a lazy FPU state save.*/ /* Triggering a lazy FPU state save.*/
asm volatile ("vmrs APSR_nzcv, FPSCR" : : : "memory"); asm volatile ("vmrs APSR_nzcv, FPSCR" : : : "memory");
@ -166,7 +166,7 @@ void _port_irq_epilogue(void) {
else { else {
/* Preemption not required, we just need to exit the exception /* Preemption not required, we just need to exit the exception
atomically.*/ atomically.*/
ctxp->pc = _port_exit_from_isr; ctxp->pc = (void *)_port_exit_from_isr;
} }
#if CORTEX_USE_FPU #if CORTEX_USE_FPU

View File

@ -308,9 +308,9 @@ struct context {
tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \
wsize - \ wsize - \
sizeof(struct intctx)); \ sizeof(struct intctx)); \
tp->p_ctx.r13->r4 = pf; \ tp->p_ctx.r13->r4 = (void *)(pf); \
tp->p_ctx.r13->r5 = arg; \ tp->p_ctx.r13->r5 = (void *)(arg); \
tp->p_ctx.r13->lr = _port_thread_start; \ tp->p_ctx.r13->lr = (void *)(_port_thread_start); \
} }
/** /**