Skip to content

Commit 82f105e

Browse files
committed
Fix IAR warning: Warning[Pe381]: extra ";" ignored
1 parent 549bee9 commit 82f105e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/class/usbtmc/usbtmc_device.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t pack
157157
static uint8_t termChar;
158158
static uint8_t termCharRequested = false;
159159

160-
OSAL_MUTEX_DEF(usbtmcLockBuffer);
161-
static osal_mutex_t usbtmcLock;
160+
#if OSAL_MUTEX_REQUIRED
161+
static OSAL_MUTEX_DEF(usbtmcLockBuffer);
162+
#endif
163+
osal_mutex_t usbtmcLock;
162164

163165
// Our own private lock, mostly for the state variable.
164166
#define criticalEnter() do { (void) osal_mutex_lock(usbtmcLock,OSAL_TIMEOUT_WAIT_FOREVER); } while (0)

src/osal/osal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef void (*osal_task_func_t)( void * );
4444
// Mutex is required when using a preempted RTOS or MCU has multiple cores
4545
#if (CFG_TUSB_OS == OPT_OS_NONE) && !TUP_MCU_MULTIPLE_CORE
4646
#define OSAL_MUTEX_REQUIRED 0
47-
#define OSAL_MUTEX_DEF(_name)
47+
#define OSAL_MUTEX_DEF(_name) uint8_t :0
4848
#else
4949
#define OSAL_MUTEX_REQUIRED 1
5050
#define OSAL_MUTEX_DEF(_name) osal_mutex_def_t _name

0 commit comments

Comments
 (0)