summaryrefslogtreecommitdiff
path: root/tinyusb/osal
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-27 00:24:15 +0700
committerhathach <[email protected]>2013-04-27 00:24:15 +0700
commit8bd077fa5c21ade1aa791b0339b66e637ad894e5 (patch)
treed2b334ebcd6b36b4a31d7318c7c1092a3af82121 /tinyusb/osal
parent33feba5cbc7a344f1bac67508e5658aa615e59bf (diff)
fix bug (wrong logic) with osal_task_delay in non OS configure
complete keyboard app with key state & event TODO handle & check for non-printable(control) keycode add unit test for osal_task_delay for non OS
Diffstat (limited to 'tinyusb/osal')
-rw-r--r--tinyusb/osal/osal_freeRTOS.h4
-rw-r--r--tinyusb/osal/osal_none.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/tinyusb/osal/osal_freeRTOS.h b/tinyusb/osal/osal_freeRTOS.h
index 6d091ed29..c54bb2ead 100644
--- a/tinyusb/osal/osal_freeRTOS.h
+++ b/tinyusb/osal/osal_freeRTOS.h
@@ -186,8 +186,8 @@ static inline void osal_queue_receive (osal_queue_handle_t const queue_hdl, void
(*p_error) = ( xQueueReceive(queue_hdl, p_data, osal_tick_from_msec(msec)) == pdPASS ) ? TUSB_ERROR_NONE : TUSB_ERROR_OSAL_TIMEOUT;
}
-static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, const void * data) ATTR_ALWAYS_INLINE;
-static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, const void * data)
+static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, void const * data) ATTR_ALWAYS_INLINE;
+static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, void const * data)
{
portBASE_TYPE taskWaken;
return ( xQueueSendFromISR(queue_hdl, data, &taskWaken) == pdTRUE ) ? TUSB_ERROR_NONE : TUSB_ERROR_OSAL_QUEUE_FAILED;
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h
index 9661278f7..a5635efd6 100644
--- a/tinyusb/osal/osal_none.h
+++ b/tinyusb/osal/osal_none.h
@@ -112,7 +112,7 @@ static inline volatile uint32_t osal_tick_get(void)
do {\
timeout = osal_tick_get();\
state = __LINE__; case __LINE__:\
- if ( timeout + osal_tick_from_msec(msec) < osal_tick_get() ) /* time out */ \
+ if ( timeout + osal_tick_from_msec(msec) > osal_tick_get() ) /* time out */ \
return TUSB_ERROR_OSAL_WAITING;\
}while(0)
@@ -230,8 +230,8 @@ static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue
}
// when queue is full, it will overwrite the oldest data in the queue
-static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, const void * data) ATTR_ALWAYS_INLINE;
-static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, const void * data)
+static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, void const * data) ATTR_ALWAYS_INLINE;
+static inline tusb_error_t osal_queue_send(osal_queue_handle_t const queue_hdl, void const * data)
{
//TODO mutex lock hal_interrupt_disable