summaryrefslogtreecommitdiff
path: root/src/osal
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-10-31 17:22:24 +0100
committerHiFiPhile <[email protected]>2025-10-31 17:22:24 +0100
commita1b0aa4e3ac738e6232c776c6eaddaef2fc7066a (patch)
tree85b214dd01a63181e02675c28902ce67ea526621 /src/osal
parent30132e8e6d39447c0633f96594ff4bdac06d6bc8 (diff)
parentdfcab8747d48b18290a5f93ce893541644a9bac6 (diff)
Merge remote-tracking branch 'tinyusb/master' into copilot/fix-dcd-edpt-xfer-issue
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/osal')
-rw-r--r--src/osal/osal.h21
-rw-r--r--src/osal/osal_none.h6
2 files changed, 13 insertions, 14 deletions
diff --git a/src/osal/osal.h b/src/osal/osal.h
index a33280425..44521620f 100644
--- a/src/osal/osal.h
+++ b/src/osal/osal.h
@@ -24,8 +24,8 @@
* This file is part of the TinyUSB stack.
*/
-#ifndef _TUSB_OSAL_H_
-#define _TUSB_OSAL_H_
+#ifndef TUSB_OSAL_H_
+#define TUSB_OSAL_H_
#ifdef __cplusplus
extern "C" {
@@ -33,7 +33,7 @@
#include "common/tusb_common.h"
-typedef void (*osal_task_func_t)( void * );
+typedef void (*osal_task_func_t)(void* param);
// Timeout
#define OSAL_TIMEOUT_NOTIMEOUT (0) // Return immediately
@@ -71,10 +71,9 @@ typedef void (*osal_task_func_t)( void * );
#error OS is not supported yet
#endif
-//--------------------------------------------------------------------+
-// OSAL Porting API
-// Should be implemented as static inline function in osal_port.h header
-/*
+/*--------------------------------------------------------------------
+ OSAL Porting API
+ Should be implemented as static inline function in osal_port.h header
void osal_spin_init(osal_spinlock_t *ctx);
void osal_spin_lock(osal_spinlock_t *ctx, bool in_isr)
void osal_spin_unlock(osal_spinlock_t *ctx, bool in_isr);
@@ -83,7 +82,7 @@ typedef void (*osal_task_func_t)( void * );
bool osal_semaphore_delete(osal_semaphore_t semd_hdl);
bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr);
bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec);
- void osal_semaphore_reset(osal_semaphore_t sem_hdl); // TODO removed
+ void osal_semaphore_reset(osal_semaphore_t sem_hdl);
osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef);
bool osal_mutex_delete(osal_mutex_t mutex_hdl)
@@ -95,11 +94,11 @@ typedef void (*osal_task_func_t)( void * );
bool osal_queue_receive(osal_queue_t qhdl, void* data, uint32_t msec);
bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr);
bool osal_queue_empty(osal_queue_t qhdl);
-*/
-//--------------------------------------------------------------------+
+--------------------------------------------------------------------------*/
+
#ifdef __cplusplus
}
#endif
-#endif /* _TUSB_OSAL_H_ */
+#endif
diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h
index 3e397ef35..bc86dcb28 100644
--- a/src/osal/osal_none.h
+++ b/src/osal/osal_none.h
@@ -35,7 +35,7 @@ extern "C" {
// Spinlock API
//--------------------------------------------------------------------+
typedef struct {
- void (* interrupt_set)(bool);
+ void (* interrupt_set)(bool enabled);
} osal_spinlock_t;
// For SMP, spinlock must be locked by hardware, cannot just use interrupt
@@ -141,7 +141,7 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_mutex_unlock(osal_mutex_t mutex_hd
#include "common/tusb_fifo.h"
typedef struct {
- void (* interrupt_set)(bool);
+ void (* interrupt_set)(bool enabled);
tu_fifo_t ff;
} osal_queue_def_t;
@@ -156,7 +156,7 @@ typedef osal_queue_def_t* osal_queue_t;
}
TU_ATTR_ALWAYS_INLINE static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef) {
- tu_fifo_clear(&qdef->ff);
+ (void) tu_fifo_clear(&qdef->ff);
return (osal_queue_t) qdef;
}