Skip to content

Commit 55c6d07

Browse files
committed
fix more warnings
1 parent f39dcae commit 55c6d07

File tree

14 files changed

+33
-27
lines changed

14 files changed

+33
-27
lines changed

hw/bsp/board_api.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ static inline size_t board_usb_get_serial(uint16_t desc_str1[], size_t max_chars
154154
// TODO work with make, but not working with esp32s3 cmake
155155
uid_len = board_get_unique_id(uid, sizeof(uid));
156156

157-
if ( uid_len > max_chars / 2 ) uid_len = max_chars / 2;
157+
if ( uid_len > max_chars / 2u ) {
158+
uid_len = max_chars / 2u;
159+
}
158160

159161
for ( size_t i = 0; i < uid_len; i++ ) {
160162
for ( size_t j = 0; j < 2; j++ ) {
161-
const char nibble_to_hex[16] = {
163+
const unsigned char nibble_to_hex[16] = {
162164
'0', '1', '2', '3', '4', '5', '6', '7',
163165
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
164166
};

hw/bsp/samd5x_e5x/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ size_t board_get_unique_id(uint8_t id[], size_t max_len) {
179179
for (int i = 0; i < 4; i++) {
180180
uint32_t did = *((uint32_t const*) did_addr[i]);
181181
did = TU_BSWAP32(did); // swap endian to match samd51 uf2 bootloader
182-
memcpy(id + i * 4, &did, 4);
182+
memcpy(id + i * 4, &did, sizeof(uint32_t));
183183
}
184184

185185
return 16;

hw/bsp/stm32f4/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void OTG_HS_IRQHandler(void) {
5454
// MACRO TYPEDEF CONSTANT ENUM
5555
//--------------------------------------------------------------------+
5656
#ifdef UART_DEV
57-
UART_HandleTypeDef UartHandle = {
57+
static UART_HandleTypeDef UartHandle = {
5858
.Instance = UART_DEV,
5959
.Init = {
6060
.BaudRate = CFG_BOARD_UART_BAUDRATE,

hw/bsp/stm32f7/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ typedef struct {
4646
//--------------------------------------------------------------------+
4747

4848
#ifdef UART_DEV
49-
UART_HandleTypeDef UartHandle = {
49+
static UART_HandleTypeDef UartHandle = {
5050
.Instance = UART_DEV,
5151
.Init = {
5252
.BaudRate = CFG_BOARD_UART_BAUDRATE,

hw/bsp/stm32h7/family.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct {
4949
//--------------------------------------------------------------------+
5050

5151
#ifdef UART_DEV
52-
UART_HandleTypeDef UartHandle = {
52+
static UART_HandleTypeDef UartHandle = {
5353
.Instance = UART_DEV,
5454
.Init = {
5555
.BaudRate = CFG_BOARD_UART_BAUDRATE,
@@ -127,7 +127,7 @@ void board_init(void) {
127127

128128
#if CFG_TUSB_OS == OPT_OS_NONE
129129
// 1ms tick timer
130-
SysTick_Config(SystemCoreClock / 1000);
130+
SysTick_Config(SystemCoreClock / 1000u);
131131

132132
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
133133
// Explicitly disable systick to prevent its ISR runs before scheduler start

hw/bsp/stm32h7rs/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct {
4949
//--------------------------------------------------------------------+
5050

5151
#ifdef UART_DEV
52-
UART_HandleTypeDef UartHandle = {
52+
static UART_HandleTypeDef UartHandle = {
5353
.Instance = UART_DEV,
5454
.Init = {
5555
.BaudRate = CFG_BOARD_UART_BAUDRATE,

hw/bsp/stm32n6/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ typedef struct {
6262
//--------------------------------------------------------------------+
6363

6464
#ifdef UART_DEV
65-
UART_HandleTypeDef UartHandle = {
65+
static UART_HandleTypeDef UartHandle = {
6666
.Instance = UART_DEV,
6767
.Init = {
6868
.BaudRate = CFG_BOARD_UART_BAUDRATE,

src/common/tusb_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
*------------------------------------------------------------------*/
7878

7979
typedef enum {
80-
TUSB_ROLE_INVALID = 0,
81-
TUSB_ROLE_DEVICE = 0x1,
82-
TUSB_ROLE_HOST = 0x2,
80+
TUSB_ROLE_INVALID = 0u,
81+
TUSB_ROLE_DEVICE = 0x1u,
82+
TUSB_ROLE_HOST = 0x2u,
8383
} tusb_role_t;
8484

8585
/// defined base on EHCI specs value for Endpoint Speed
@@ -178,7 +178,7 @@ typedef enum {
178178
} tusb_request_feature_selector_t;
179179

180180
typedef enum {
181-
TUSB_REQ_TYPE_STANDARD = 0,
181+
TUSB_REQ_TYPE_STANDARD = 0u,
182182
TUSB_REQ_TYPE_CLASS,
183183
TUSB_REQ_TYPE_VENDOR,
184184
TUSB_REQ_TYPE_INVALID

src/device/dcd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ typedef struct TU_ATTR_ALIGNED(4) {
7979

8080
// FUNC_CALL
8181
struct {
82-
void (*func) (void*);
82+
void (*func) (void* param);
8383
void* param;
8484
}func_call;
8585
};

src/osal/osal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "common/tusb_common.h"
3535

36-
typedef void (*osal_task_func_t)( void * );
36+
typedef void (*osal_task_func_t)(void* param);
3737

3838
// Timeout
3939
#define OSAL_TIMEOUT_NOTIMEOUT (0) // Return immediately

0 commit comments

Comments
 (0)