Skip to content

Commit ae5de83

Browse files
committed
Prevent unreachable statements and correct variable sizes.
1 parent 306e144 commit ae5de83

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

drivers/USBAudio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ class USBAudio: protected USBDevice {
373373
usb_ep_t _episo_in; // tx endpoint
374374

375375
// channel config in the configuration descriptor: master, left, right
376-
uint8_t _channel_config_rx;
377-
uint8_t _channel_config_tx;
376+
uint16_t _channel_config_rx;
377+
uint16_t _channel_config_tx;
378378

379379
// configuration descriptor
380380
uint8_t _config_descriptor[183];

rtos/source/Semaphore.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ osStatus Semaphore::release(void)
212212
return osErrorResource;
213213
}
214214
} while (!core_util_atomic_cas_s32(&_count, &old_count, old_count + 1));
215-
#endif
215+
216216
return osOK;
217+
#endif // MBED_CONF_RTOS_PRESENT
217218
}
218219

219220
Semaphore::~Semaphore()

rtos/source/TARGET_CORTEX/mbed_rtos_rtx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ MBED_NORETURN void mbed_rtos_start()
114114
}
115115

116116
osKernelStart();
117+
#if MBED_TRAP_ERRORS_ENABLED
117118
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Failed to start RTOS");
119+
#else
118120
while (1); // Code should never get here
121+
#endif // MBED_TRAP_ERRORS_ENABLED
119122
}

rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ __NO_RETURN void osRtxIdleThread(void *argument)
5353

5454
__NO_RETURN uint32_t osRtxErrorNotify(uint32_t code, void *object_id)
5555
{
56+
#if MBED_TRAP_ERRORS_ENABLED
5657
switch (code) {
5758
case osRtxErrorStackUnderflow:
5859
// Stack underflow detected for thread (thread_id=object_id)
@@ -80,9 +81,10 @@ __NO_RETURN uint32_t osRtxErrorNotify(uint32_t code, void *object_id)
8081
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_KERNEL, MBED_ERROR_CODE_UNKNOWN), "CMSIS-RTOS error: Unknown", code);
8182
break;
8283
}
83-
84+
#else
8485
/* That shouldn't be reached */
8586
for (;;) {}
87+
#endif // MBED_TRAP_ERRORS_ENABLED
8688
}
8789

8890
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED

0 commit comments

Comments
 (0)