Skip to content

Commit 1c12d19

Browse files
fix compiler warings; consistently use const for USB data
1 parent 9c2d833 commit 1c12d19

32 files changed

+130
-172
lines changed

cores/stm32l4/FS.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ int File::available() {
5656
}
5757

5858
int File::read() {
59-
int c;
60-
6159
if (!_file)
6260
return -1;
6361

cores/stm32l4/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CFLAGS = -mcpu=cortex-m4 -mthumb -c -g3 -Os $(WARNINGS) -std=gnu11 -ffunction-
99
CXXFLAGS = -mcpu=cortex-m4 -mthumb -c -g3 -Os $(WARNINGS) -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD $(EXTRAS) $(DEFINES) $(INCLUDES)
1010
ASFLAGS = -c -g -x assembler-with-cpp $(EXTRAS) $(DEFINES) $(INCLUDES)
1111
LDFLAGS = -L../../variants/dragonfly -Os -Wl,--gc-sections -save-temps $(EXTRAS) -T../../variants/dragonfly/linker_scripts/flash.ld -specs=nano.specs --specs=nosys.specs -mcpu=cortex-m4 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align
12-
WARNINGS = -w
12+
WARNINGS = -Wall -Wextra -Wno-unused-parameter
1313
EXTRAS = -DSTM32L476xx -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mabi=aapcs -mslow-flash-data
1414
DEFINES = -DF_CPU=80000000L -DARDUINO=10606 -D_ARDUINO_STM32L4_DRAGONFLY -DARDUINO_ARCH_STM32L4
1515
INCLUDES = -I../../system/libstm32l4_dragonfly/CMSIS/Include -I../../system/libstm32l4_dragonfly/CMSIS/Device/ST/STM32L4xx/Include -I../../system/libstm32l4_dragonfly/USB/HAL/Inc -I../../system/libstm32l4_dragonfly/USB/Core/Inc -I../../system/libstm32l4_dragonfly/USB/Class/CDC/Inc -I../../system/libstm32l4_dragonfly/USB/Class/MSC/Inc -I../../system/libstm32l4_dragonfly/USB -I../../system/libstm32l4_dragonfly/ -I../../variants/dragonfly -I../../libraries/SPI/ -I../../libraries/Wire/ -I../../libraries/Servo/src/ -I.

cores/stm32l4/WInterrupts.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
5151
*/
5252
void detachInterrupt(uint32_t pin)
5353
{
54-
unsigned long instance;
55-
5654
if (!(g_APinDescription[pin].attr & PIN_ATTR_EXTI))
5755
return;
5856

cores/stm32l4/wiring.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ void UsageFault_Handler(void)
5353

5454
void init( void )
5555
{
56-
uint32_t pin;
57-
5856
stm32l4_system_configure(F_CPU, F_CPU, F_CPU/2, F_CPU/2);
5957

6058
armv7m_svcall_initialize();

cores/stm32l4/wiring_analog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ static const unsigned int stm32l4_pwm_xlate_instance[PWM_INSTANCE_COUNT] = {
3737
static int _readResolution = 10;
3838
static int _writeResolution = 8;
3939

40-
static int _writeFrequency[PWM_INSTANCE_COUNT];
41-
static int _writeRange[PWM_INSTANCE_COUNT];
40+
static uint32_t _writeFrequency[PWM_INSTANCE_COUNT];
41+
static uint32_t _writeRange[PWM_INSTANCE_COUNT];
4242

4343
static uint8_t _writeCalibrate = 3;
4444

cores/stm32l4/wiring_pulse.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
* before the start of the pulse. */
2525
uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout)
2626
{
27-
if ( g_APinDescription[pin].GPIO == NULL )
28-
{
29-
return ;
30-
}
27+
if (g_APinDescription[pin].GPIO == NULL)
28+
{
29+
return 0;
30+
}
3131

3232
// cache the port and bit of the pin in order to speed up the
3333
// pulse width measuring loop and achieve finer resolution. calling

libraries/SPI/SPI.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ uint16_t SPIClass::_exchange16Select(struct _stm32l4_spi_t *spi, uint16_t data)
311311
spi_class->_exchangeRoutine = stm32l4_spi_exchange;
312312
spi_class->_exchange8Routine = stm32l4_spi_exchange8;
313313
spi_class->_exchange16Routine = stm32l4_spi_exchange16;
314+
315+
stm32l4_spi_select(spi, settings._control);
314316

315317
return (*spi_class->_exchange16Routine)(spi, data);
316318
}

libraries/Servo/src/Servo.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ static void servo_event_callback(void *context, uint32_t events)
4242

4343
Servo::Servo()
4444
{
45-
uint8_t servoIndex;
46-
4745
if (stm32l4_servo.state == SERVO_STATE_NONE) {
4846
stm32l4_servo_create(&stm32l4_servo, TIMER_INSTANCE_TIM15, STM32L4_SERVO_IRQ_PRIORITY);
4947
}

system/libstm32l4_dragonfly/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LD = $(TOOLS)/bin/arm-none-eabi-ld
88
CFLAGS = -mcpu=cortex-m4 -mthumb -c -g -Os $(WARNINGS) -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD $(EXTRAS) $(DEFINES) $(INCLUDES)
99
CXXFLAGS = -mcpu=cortex-m4 -mthumb -c -g -Os $(WARNINGS) -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD $(EXTRAS) $(DEFINES) $(INCLUDES)
1010
ASFLAGS = -c -g -x assembler-with-cpp $(EXTRAS) $(DEFINES) $(INCLUDES)
11-
WARNINGS = -w
11+
WARNINGS = -Wall -Wextra -Wno-unused-parameter
1212
EXTRAS = -DSTM32L476xx -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mabi=aapcs -mslow-flash-data
1313
DEFINES = -F_CPU=80000000L -DARDUINO=10606 -D_ARDUINO_STM32L4_DRAGONFLY -DARDUINO_ARCH_STM32L4
1414
INCLUDES = -I../../system/libstm32l4_dragonfly/CMSIS/Include -I../../system/libstm32l4_dragonfly/CMSIS/Device/ST/STM32L4xx/Include -I../../system/libstm32l4_dragonfly/USB/HAL/Inc -I../../system/libstm32l4_dragonfly/USB/Core/Inc -I../../system/libstm32l4_dragonfly/USB/Class/CDC/Inc -I../../system/libstm32l4_dragonfly/USB/Class/MSC/Inc -I../../system/libstm32l4_dragonfly/USB -I../../system/libstm32l4_dragonfly/ -I../../variants/dragonfly -I.

system/libstm32l4_dragonfly/USB/Class/CDC/Inc/usbd_cdc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ typedef struct
118118
uint8_t CmdOpCode;
119119
uint8_t CmdLength;
120120
uint8_t *RxBuffer;
121-
uint8_t *TxBuffer;
121+
const uint8_t *TxBuffer;
122122
uint32_t RxLength;
123123
uint32_t TxLength;
124124

@@ -141,7 +141,7 @@ USBD_CDC_HandleTypeDef;
141141
* @{
142142
*/
143143

144-
extern USBD_ClassTypeDef USBD_CDC;
144+
extern const USBD_ClassTypeDef USBD_CDC;
145145
#define USBD_CDC_CLASS &USBD_CDC
146146
/**
147147
* @}
@@ -151,10 +151,10 @@ extern USBD_ClassTypeDef USBD_CDC;
151151
* @{
152152
*/
153153
uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev,
154-
USBD_CDC_ItfTypeDef *fops);
154+
const USBD_CDC_ItfTypeDef *fops);
155155

156156
uint8_t USBD_CDC_SetTxBuffer (USBD_HandleTypeDef *pdev,
157-
uint8_t *pbuff,
157+
const uint8_t *pbuff,
158158
uint16_t length);
159159

160160
uint8_t USBD_CDC_SetRxBuffer (USBD_HandleTypeDef *pdev,

system/libstm32l4_dragonfly/USB/Class/CDC/Src/usbd_cdc.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ uint8_t USBD_CDC_DataOut (USBD_HandleTypeDef *pdev,
121121

122122
uint8_t USBD_CDC_EP0_RxReady (USBD_HandleTypeDef *pdev);
123123

124-
static uint8_t *USBD_CDC_GetFSCfgDesc (uint16_t *length);
124+
static const uint8_t *USBD_CDC_GetFSCfgDesc (uint16_t *length);
125125

126-
static uint8_t *USBD_CDC_GetHSCfgDesc (uint16_t *length);
126+
static const uint8_t *USBD_CDC_GetHSCfgDesc (uint16_t *length);
127127

128-
static uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length);
128+
static const uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length);
129129

130-
static uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length);
130+
static const uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length);
131131

132-
uint8_t *USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length);
132+
const uint8_t *USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length);
133133

134134
/* USB Standard Device Descriptor */
135-
__ALIGN_BEGIN static uint8_t USBD_CDC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END =
135+
__ALIGN_BEGIN static const uint8_t USBD_CDC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END =
136136
{
137137
USB_LEN_DEV_QUALIFIER_DESC,
138138
USB_DESC_TYPE_DEVICE_QUALIFIER,
@@ -156,7 +156,7 @@ __ALIGN_BEGIN static uint8_t USBD_CDC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_
156156

157157

158158
/* CDC interface class callbacks structure */
159-
USBD_ClassTypeDef USBD_CDC =
159+
const USBD_ClassTypeDef USBD_CDC =
160160
{
161161
USBD_CDC_Init,
162162
USBD_CDC_DeInit,
@@ -175,7 +175,7 @@ USBD_ClassTypeDef USBD_CDC =
175175
};
176176

177177
/* USB CDC device Configuration Descriptor */
178-
__ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
178+
__ALIGN_BEGIN const uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
179179
{
180180
/*Configuration Descriptor*/
181181
0x09, /* bLength: Configuration Descriptor size */
@@ -271,7 +271,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
271271

272272

273273
/* USB CDC device Configuration Descriptor */
274-
__ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
274+
__ALIGN_BEGIN const uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
275275
{
276276
/*Configuration Descriptor*/
277277
0x09, /* bLength: Configuration Descriptor size */
@@ -365,7 +365,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
365365
0x00 /* bInterval: ignore for Bulk transfer */
366366
} ;
367367

368-
__ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
368+
__ALIGN_BEGIN const uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
369369
{
370370
0x09, /* bLength: Configuation Descriptor size */
371371
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION,
@@ -739,7 +739,7 @@ uint8_t USBD_CDC_EP0_RxReady (USBD_HandleTypeDef *pdev)
739739
* @param length : pointer data length
740740
* @retval pointer to descriptor buffer
741741
*/
742-
static uint8_t *USBD_CDC_GetFSCfgDesc (uint16_t *length)
742+
static const uint8_t *USBD_CDC_GetFSCfgDesc (uint16_t *length)
743743
{
744744
*length = sizeof (USBD_CDC_CfgFSDesc);
745745
return USBD_CDC_CfgFSDesc;
@@ -752,7 +752,7 @@ static uint8_t *USBD_CDC_GetFSCfgDesc (uint16_t *length)
752752
* @param length : pointer data length
753753
* @retval pointer to descriptor buffer
754754
*/
755-
static uint8_t *USBD_CDC_GetHSCfgDesc (uint16_t *length)
755+
static const uint8_t *USBD_CDC_GetHSCfgDesc (uint16_t *length)
756756
{
757757
*length = sizeof (USBD_CDC_CfgHSDesc);
758758
return USBD_CDC_CfgHSDesc;
@@ -765,7 +765,7 @@ static uint8_t *USBD_CDC_GetHSCfgDesc (uint16_t *length)
765765
* @param length : pointer data length
766766
* @retval pointer to descriptor buffer
767767
*/
768-
static uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length)
768+
static const uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length)
769769
{
770770
*length = sizeof (USBD_CDC_OtherSpeedCfgDesc);
771771
return USBD_CDC_OtherSpeedCfgDesc;
@@ -777,7 +777,7 @@ static uint8_t *USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length)
777777
* @param length : pointer data length
778778
* @retval pointer to descriptor buffer
779779
*/
780-
uint8_t *USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length)
780+
const uint8_t *USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length)
781781
{
782782
*length = sizeof (USBD_CDC_DeviceQualifierDesc);
783783
return USBD_CDC_DeviceQualifierDesc;
@@ -790,7 +790,7 @@ uint8_t *USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length)
790790
* @retval status
791791
*/
792792
uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev,
793-
USBD_CDC_ItfTypeDef *fops)
793+
const USBD_CDC_ItfTypeDef *fops)
794794
{
795795
uint8_t ret = USBD_FAIL;
796796

@@ -810,7 +810,7 @@ uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev,
810810
* @retval status
811811
*/
812812
uint8_t USBD_CDC_SetTxBuffer (USBD_HandleTypeDef *pdev,
813-
uint8_t *pbuff,
813+
const uint8_t *pbuff,
814814
uint16_t length)
815815
{
816816
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*) pdev->pClassData[0];
@@ -859,7 +859,7 @@ uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev)
859859
/* Transmit next packet */
860860
USBD_LL_Transmit(pdev,
861861
CDC_IN_EP,
862-
hcdc->TxBuffer,
862+
(uint8_t*)hcdc->TxBuffer,
863863
hcdc->TxLength);
864864

865865
return USBD_OK;

system/libstm32l4_dragonfly/USB/Class/MSC/Inc/usbd_msc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ typedef struct
113113
USBD_MSC_BOT_HandleTypeDef;
114114

115115
/* Structure for MSC process */
116-
extern USBD_ClassTypeDef USBD_MSC;
116+
extern const USBD_ClassTypeDef USBD_MSC;
117117
#define USBD_MSC_CLASS &USBD_MSC
118118

119119
uint8_t USBD_MSC_RegisterStorage (USBD_HandleTypeDef *pdev,
120-
USBD_StorageTypeDef *fops);
120+
const USBD_StorageTypeDef *fops);
121121
/**
122122
* @}
123123
*/

system/libstm32l4_dragonfly/USB/Class/MSC/Src/usbd_msc.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ uint8_t USBD_MSC_DataIn (USBD_HandleTypeDef *pdev,
9898
uint8_t USBD_MSC_DataOut (USBD_HandleTypeDef *pdev,
9999
uint8_t epnum);
100100

101-
uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length);
101+
const uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length);
102102

103-
uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length);
103+
const uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length);
104104

105-
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length);
105+
const uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length);
106106

107-
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length);
107+
const uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length);
108108

109109

110110
/**
@@ -117,7 +117,7 @@ uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length);
117117
*/
118118

119119

120-
USBD_ClassTypeDef USBD_MSC =
120+
const USBD_ClassTypeDef USBD_MSC =
121121
{
122122
USBD_MSC_Init,
123123
USBD_MSC_DeInit,
@@ -137,7 +137,7 @@ USBD_ClassTypeDef USBD_MSC =
137137

138138
/* USB Mass storage device Configuration Descriptor */
139139
/* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
140-
__ALIGN_BEGIN uint8_t USBD_MSC_CfgHSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
140+
__ALIGN_BEGIN const uint8_t USBD_MSC_CfgHSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
141141
{
142142

143143
0x09, /* bLength: Configuation Descriptor size */
@@ -181,7 +181,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CfgHSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
181181

182182
/* USB Mass storage device Configuration Descriptor */
183183
/* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
184-
uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
184+
const uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
185185
{
186186

187187
0x09, /* bLength: Configuation Descriptor size */
@@ -223,7 +223,7 @@ uint8_t USBD_MSC_CfgFSDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
223223
0x00 /*Polling interval in milliseconds*/
224224
};
225225

226-
__ALIGN_BEGIN uint8_t USBD_MSC_OtherSpeedCfgDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
226+
__ALIGN_BEGIN const uint8_t USBD_MSC_OtherSpeedCfgDesc[USB_MSC_CONFIG_DESC_SIZ] __ALIGN_END =
227227
{
228228

229229
0x09, /* bLength: Configuation Descriptor size */
@@ -266,7 +266,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_OtherSpeedCfgDesc[USB_MSC_CONFIG_DESC_SIZ] __AL
266266
};
267267

268268
/* USB Standard Device Descriptor */
269-
__ALIGN_BEGIN uint8_t USBD_MSC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END =
269+
__ALIGN_BEGIN const uint8_t USBD_MSC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END =
270270
{
271271
USB_LEN_DEV_QUALIFIER_DESC,
272272
USB_DESC_TYPE_DEVICE_QUALIFIER,
@@ -536,7 +536,7 @@ uint8_t USBD_MSC_DataOut (USBD_HandleTypeDef *pdev,
536536
* @param length : pointer data length
537537
* @retval pointer to descriptor buffer
538538
*/
539-
uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length)
539+
const uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length)
540540
{
541541
*length = sizeof (USBD_MSC_CfgHSDesc);
542542
return USBD_MSC_CfgHSDesc;
@@ -548,7 +548,7 @@ uint8_t *USBD_MSC_GetHSCfgDesc (uint16_t *length)
548548
* @param length : pointer data length
549549
* @retval pointer to descriptor buffer
550550
*/
551-
uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length)
551+
const uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length)
552552
{
553553
*length = sizeof (USBD_MSC_CfgFSDesc);
554554
return USBD_MSC_CfgFSDesc;
@@ -560,7 +560,7 @@ uint8_t *USBD_MSC_GetFSCfgDesc (uint16_t *length)
560560
* @param length : pointer data length
561561
* @retval pointer to descriptor buffer
562562
*/
563-
uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length)
563+
const uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length)
564564
{
565565
*length = sizeof (USBD_MSC_OtherSpeedCfgDesc);
566566
return USBD_MSC_OtherSpeedCfgDesc;
@@ -571,7 +571,7 @@ uint8_t *USBD_MSC_GetOtherSpeedCfgDesc (uint16_t *length)
571571
* @param length : pointer data length
572572
* @retval pointer to descriptor buffer
573573
*/
574-
uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length)
574+
const uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length)
575575
{
576576
*length = sizeof (USBD_MSC_DeviceQualifierDesc);
577577
return USBD_MSC_DeviceQualifierDesc;
@@ -583,7 +583,7 @@ uint8_t *USBD_MSC_GetDeviceQualifierDescriptor (uint16_t *length)
583583
* @retval status
584584
*/
585585
uint8_t USBD_MSC_RegisterStorage (USBD_HandleTypeDef *pdev,
586-
USBD_StorageTypeDef *fops)
586+
const USBD_StorageTypeDef *fops)
587587
{
588588
if(fops != NULL)
589589
{

system/libstm32l4_dragonfly/USB/Core/Inc/usbd_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@
8888
/** @defgroup USBD_CORE_Exported_FunctionsPrototype
8989
* @{
9090
*/
91-
USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *pdesc, uint8_t id);
91+
USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, const USBD_DescriptorsTypeDef *pdesc, uint8_t id);
9292
USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev);
9393
USBD_StatusTypeDef USBD_Start (USBD_HandleTypeDef *pdev);
9494
USBD_StatusTypeDef USBD_Stop (USBD_HandleTypeDef *pdev);
95-
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass);
95+
USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, const USBD_ClassTypeDef *pclass);
9696

9797
USBD_StatusTypeDef USBD_RunTestMode (USBD_HandleTypeDef *pdev);
9898
USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx);

system/libstm32l4_dragonfly/USB/Core/Inc/usbd_ctlreq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void USBD_CtlError (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
9090

9191
void USBD_ParseSetupRequest (USBD_SetupReqTypedef *req, uint8_t *pdata);
9292

93-
void USBD_GetString (uint8_t *desc, uint8_t *unicode, uint16_t *len);
93+
void USBD_GetString (const uint8_t *desc, uint8_t *unicode, uint16_t *len);
9494
/**
9595
* @}
9696
*/

0 commit comments

Comments
 (0)