Skip to content

Commit 67866e9

Browse files
authored
Merge branch 'stm32duino:main' into hal-irqhandler-flagdisabling
2 parents 2a84e95 + d8062ae commit 67866e9

File tree

8 files changed

+2038
-2033
lines changed

8 files changed

+2038
-2033
lines changed

.github/actions/pio-build/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
This action build thanks PIO.
44

5-
## Inputs
6-
7-
### `cmsis-version`
8-
9-
The CMSIS version to use. Default `"5.9.0"`.
10-
115
## Example usage
126

137
```yaml
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# action.yml
22
name: 'PlatformIO Build'
33
description: 'Compile using PlatformIO'
4-
inputs:
5-
cmsis-version:
6-
description: 'CMSIS package version to use'
7-
default: '5.9.0'
84
runs:
95
using: 'docker'
106
image: 'Dockerfile'
11-
args:
12-
- ${{ inputs.cmsis-version }}

.github/actions/pio-build/entrypoint.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/sh
22

3-
readonly CMSIS_VERSION="$1"
4-
readonly CMSIS_ARCHIVE="CMSIS-${CMSIS_VERSION}.tar.bz2"
5-
63
# Use python venv
74
python3 -m venv "$HOME/venv"
85
# shellcheck disable=SC1091
@@ -11,24 +8,18 @@ python3 -m venv "$HOME/venv"
118
python3 -m pip install --quiet --upgrade platformio
129

1310
# Install the development version of ststm32 platform
14-
platformio platform install "https://github.com/platformio/platform-ststm32.git" || {
11+
pio pkg install --platform "https://github.com/platformio/platform-ststm32.git" --force --global || {
1512
exit 1
1613
}
1714
# Prepare framework for CI
15+
# Modify platform.json to use local framework-arduinoststm32 package
1816
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; del data['packages']['framework-arduinoststm32']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
1917
exit 1
2018
}
21-
19+
# Create symbolic link to the framework-arduinoststm32 package pointing to the repository workspace
2220
ln --symbolic "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || {
2321
exit 1
2422
}
25-
# Download and unpack CMSIS package
26-
wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/$CMSIS_ARCHIVE" || {
27-
exit 1
28-
}
29-
tar --extract --bzip2 --file="$CMSIS_ARCHIVE" || {
30-
exit 1
31-
}
3223
cd "$GITHUB_WORKSPACE/CI/build/" || {
3324
exit 1
3425
}

boards.txt

Lines changed: 1996 additions & 2004 deletions
Large diffs are not rendered by default.

cores/arduino/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
void serialEventLP2() __attribute__((weak));
115115
#endif
116116
#if defined(HAVE_HWSERIALLP3)
117-
HardwareSerial SerialLP2(LPUART3);
117+
HardwareSerial SerialLP3(LPUART3);
118118
void serialEventLP3() __attribute__((weak));
119119
#endif
120120
#endif // HAVE_HWSERIALx

libraries/USBDevice/inc/usbd_cdc_if.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ void CDC_deInit(void);
5353
bool CDC_connected(void);
5454
void CDC_enableDTR(bool enable);
5555

56+
// getters for CDC line codings. Do not expose struct directly
57+
uint32_t CDC_getBaudrate(void);
58+
uint8_t CDC_getStopBits(void);
59+
uint8_t CDC_getParity(void);
60+
uint8_t CDC_getDataBits(void);
61+
5662
#ifdef __cplusplus
5763
}
5864
#endif

libraries/USBDevice/src/USBSerial.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,26 @@ void USBSerial::flush(void)
158158

159159
uint32_t USBSerial::baud()
160160
{
161-
return 115200;
161+
// return (virtual) CDC line setting coding
162+
return CDC_getBaudrate();
162163
}
163164

164165
uint8_t USBSerial::stopbits()
165166
{
166-
return ONE_STOP_BIT;
167+
// return (virtual) CDC line setting coding
168+
return CDC_getStopBits();
167169
}
168170

169171
uint8_t USBSerial::paritytype()
170172
{
171-
return NO_PARITY;
173+
// return (virtual) CDC line setting coding
174+
return CDC_getParity();
172175
}
173176

174177
uint8_t USBSerial::numbits()
175178
{
176-
return 8;
179+
// return (virtual) CDC line setting coding
180+
return CDC_getDataBits();
177181
}
178182

179183
void USBSerial::dtr(bool enable)

libraries/USBDevice/src/cdc/usbd_cdc_if.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,30 @@ void CDC_enableDTR(bool enable)
379379
CDC_DTR_enabled = enable;
380380
}
381381

382+
// getter for CDC baudrate
383+
uint32_t CDC_getBaudrate()
384+
{
385+
return linecoding.bitrate;
386+
}
387+
388+
// getter for CDC stop bits. Note: CDC definition identical to USBSerial.h
389+
uint8_t CDC_getStopBits(void)
390+
{
391+
return linecoding.format;
392+
}
393+
394+
// getter for CDC parity. Note: CDC definition identical to USBSerial.h
395+
uint8_t CDC_getParity(void)
396+
{
397+
return linecoding.paritytype;
398+
}
399+
400+
// getter for CDC data bits. Note: CDC definition identical to USBSerial.h
401+
uint8_t CDC_getDataBits(void)
402+
{
403+
return linecoding.datatype;
404+
}
405+
382406
#endif /* USBD_USE_CDC */
383407
#endif /* USBCON */
384408
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)