Skip to content

Commit 9ba484e

Browse files
authored
Merge pull request #638 from fpistm/CubeUpdate_F1
Cube update F1 + USB middleware
2 parents 6700da1 + 18ffd9b commit 9ba484e

File tree

275 files changed

+108122
-99129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+108122
-99129
lines changed

Diff for: cores/arduino/stm32/HAL/stm32yyxx_hal_exti.c

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifdef STM32F1xx
2+
#include "stm32f1xx_hal_exti.c"
3+
#endif
14
#ifdef STM32F2xx
25
#include "stm32f2xx_hal_exti.c"
36
#endif

Diff for: cores/arduino/stm32/HAL/stm32yyxx_hal_spi_ex.c

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#ifdef STM32F0xx
22
#include "stm32f0xx_hal_spi_ex.c"
33
#endif
4-
#ifdef STM32F1xx
5-
#include "stm32f1xx_hal_spi_ex.c"
6-
#endif
74
#ifdef STM32F3xx
85
#include "stm32f3xx_hal_spi_ex.c"
96
#endif

Diff for: cores/arduino/stm32/twi.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, ui
935935
if (obj->i2c_onSlaveTransmit != NULL) {
936936
obj->i2c_onSlaveTransmit();
937937
}
938-
#if defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx)
938+
#if defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) ||\
939+
defined(STM32L0xx) || defined(STM32L1xx)
939940
HAL_I2C_Slave_Seq_Transmit_IT(hi2c, (uint8_t *) obj->i2cTxRxBuffer,
940941
obj->i2cTxRxBufferSize, I2C_LAST_FRAME);
941942
#else
@@ -947,7 +948,8 @@ void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, ui
947948
obj->slaveMode = SLAVE_MODE_RECEIVE;
948949
/* We don't know in advance how many bytes will be sent by master so
949950
* we'll fetch one by one until master ends the sequence */
950-
#if defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx)
951+
#if defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) ||\
952+
defined(STM32L0xx) || defined(STM32L1xx)
951953
HAL_I2C_Slave_Seq_Receive_IT(hi2c, (uint8_t *) & (obj->i2cTxRxBuffer[obj->slaveRxNbData]),
952954
1, I2C_NEXT_FRAME);
953955
#else
@@ -998,7 +1000,8 @@ void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c)
9981000
}
9991001
/* Restart interrupt mode for next Byte */
10001002
if (obj->slaveMode == SLAVE_MODE_RECEIVE) {
1001-
#if defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx)
1003+
#if defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) ||\
1004+
defined(STM32L0xx) || defined(STM32L1xx)
10021005
HAL_I2C_Slave_Seq_Receive_IT(hi2c, (uint8_t *) & (obj->i2cTxRxBuffer[obj->slaveRxNbData]),
10031006
1, I2C_NEXT_FRAME);
10041007
#else

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,9 @@ static uint8_t USBD_CDC_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
651651
USBD_CDC_ItfTypeDef *ctrl = (USBD_CDC_ItfTypeDef *)pdev->pUserData;
652652

653653
if (pdev->pClassData != NULL) {
654-
if ((hcdc->TxLastLength > 0U) && ((hcdc->TxLastLength % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
654+
if ((pdev->ep_in[epnum].total_length > 0U) && ((pdev->ep_in[epnum].total_length % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
655655
/* Update the packet total length */
656-
hcdc->TxLastLength = 0U;
656+
pdev->ep_in[epnum].total_length = 0U;
657657

658658
/* Send ZLP */
659659
USBD_LL_Transmit(pdev, epnum, NULL, 0U);
@@ -835,7 +835,7 @@ uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev)
835835
hcdc->TxState = 1U;
836836

837837
/* Update the packet total length */
838-
hcdc->TxLastLength = hcdc->TxLength;
838+
pdev->ep_in[CDC_IN_EP & 0xFU].total_length = hcdc->TxLength;
839839

840840
/* Transmit next packet */
841841
USBD_LL_Transmit(pdev, CDC_IN_EP, hcdc->TxBuffer,

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc.h

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ typedef struct {
115115
uint8_t *TxBuffer;
116116
uint32_t RxLength;
117117
uint32_t TxLength;
118-
uint32_t TxLastLength;
119118

120119
__IO uint32_t TxState;
121120
__IO uint32_t RxState;

Diff for: cores/arduino/stm32/usb/usbd_conf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/

Diff for: cores/arduino/stm32/usb/usbd_conf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/

Diff for: cores/arduino/stm32/usb/usbd_desc.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/
@@ -272,9 +272,9 @@ static void Get_SerialNum(void)
272272

273273
deviceserial0 += deviceserial2;
274274

275-
if (deviceserial0 != 0) {
276-
IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8);
277-
IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4);
275+
if (deviceserial0 != 0U) {
276+
IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8U);
277+
IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4U);
278278
}
279279
}
280280

@@ -287,18 +287,18 @@ static void Get_SerialNum(void)
287287
*/
288288
static void IntToUnicode(uint32_t value, uint8_t *pbuf, uint8_t len)
289289
{
290-
uint8_t idx = 0;
290+
uint8_t idx = 0U;
291291

292-
for (idx = 0 ; idx < len ; idx ++) {
293-
if (((value >> 28)) < 0xA) {
294-
pbuf[ 2 * idx] = (value >> 28) + '0';
292+
for (idx = 0U ; idx < len ; idx ++) {
293+
if (((value >> 28)) < 0xAU) {
294+
pbuf[ 2U * idx] = (value >> 28) + '0';
295295
} else {
296-
pbuf[2 * idx] = (value >> 28) + 'A' - 10;
296+
pbuf[2U * idx] = (value >> 28) + 'A' - 10U;
297297
}
298298

299299
value = value << 4;
300300

301-
pbuf[ 2 * idx + 1] = 0;
301+
pbuf[2U * idx + 1] = 0U;
302302
}
303303
}
304304
#endif /* USBCON */

Diff for: cores/arduino/stm32/usb/usbd_desc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/

0 commit comments

Comments
 (0)