Skip to content

Commit 8a992b0

Browse files
committed
2 parents 845b95e + e013b67 commit 8a992b0

7 files changed

Lines changed: 25 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
163163

164164
| Status | [Midatronics](https://midatronics.com/) | Release | Comment |
165165
| :---: | --- | :---: | :--- |
166-
| :green_heart: | [SharkyMKR](https://midatronics.com/Development_Boards/MKR_Sharky_I) | *1.7.0* | |
166+
| :green_heart: | [SharkyMKR](https://midatronics.com/shop/development-boards/mkr-sharky-i/) | *1.7.0* | |
167167

168168
## Next release
169169

cores/arduino/HardwareSerial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ HardwareSerial::HardwareSerial(PinName _rx, PinName _tx)
116116
init(_rx, _tx);
117117
}
118118

119-
HardwareSerial::HardwareSerial(void *peripheral, bool halfDuplex)
119+
HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex)
120120
{
121121
// If PIN_SERIALy_RX is not defined assume half-duplex
122122
_serial.pin_rx = NC;
@@ -247,7 +247,7 @@ HardwareSerial::HardwareSerial(void *peripheral, bool halfDuplex)
247247
_serial.pin_rx = pinmap_pin(peripheral, PinMap_UART_RX);
248248
_serial.pin_tx = pinmap_pin(peripheral, PinMap_UART_TX);
249249
}
250-
if (halfDuplex) {
250+
if (halfDuplex == HALF_DUPLEX_ENABLED) {
251251
_serial.pin_rx = NC;
252252
}
253253
init(_serial.pin_rx, _serial.pin_tx);

cores/arduino/HardwareSerial.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ typedef uint16_t rx_buffer_index_t;
5757
typedef uint8_t rx_buffer_index_t;
5858
#endif
5959

60+
// A bool should be enough for this
61+
// But it brings an build error due to ambiguous
62+
// call of overloaded HardwareSerial(int, int)
63+
// So defining a dedicated type
64+
typedef enum {
65+
HALF_DUPLEX_DISABLED,
66+
HALF_DUPLEX_ENABLED
67+
} HalfDuplexMode_t;
68+
6069
// Define config for Serial.begin(baud, config);
6170
// below configs are not supported by STM32
6271
//#define SERIAL_5N1 0x00
@@ -103,7 +112,7 @@ class HardwareSerial : public Stream {
103112
public:
104113
HardwareSerial(uint32_t _rx, uint32_t _tx);
105114
HardwareSerial(PinName _rx, PinName _tx);
106-
HardwareSerial(void *peripheral, bool halfDuplex = false);
115+
HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex = HALF_DUPLEX_DISABLED);
107116
HardwareSerial(uint32_t _rxtx);
108117
HardwareSerial(PinName _rxtx);
109118
void begin(unsigned long baud)

cores/arduino/stm32/timer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ extern "C" {
5151
#define TIM1_IRQn TIM1_UP_TIM16_IRQn
5252
#define TIM1_IRQHandler TIM1_UP_TIM16_IRQHandler
5353
#elif defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx)
54+
#if !defined (TIM10_BASE)
55+
#define TIM1_IRQn TIM1_UP_IRQn
56+
#define TIM1_IRQHandler TIM1_UP_IRQHandler
57+
#else
5458
#define TIM1_IRQn TIM1_UP_TIM10_IRQn
5559
#define TIM1_IRQHandler TIM1_UP_TIM10_IRQHandler
60+
#endif
5661
#elif defined(STM32H7xx) || defined(STM32MP1xx)
5762
#define TIM1_IRQn TIM1_UP_IRQn
5863
#define TIM1_IRQHandler TIM1_UP_IRQHandler

cores/arduino/stm32/usb/cdc/usbd_cdc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
190190
0x01, /* bNumEndpoints: One endpoints used */
191191
0x02, /* bInterfaceClass: Communication Interface Class */
192192
0x02, /* bInterfaceSubClass: Abstract Control Model */
193-
0x01, /* bInterfaceProtocol: Common AT commands */
193+
0x00, /* bInterfaceProtocol: No specific protocol */
194194
0x00, /* iInterface: */
195195

196196
/*Header Functional Descriptor*/
@@ -285,7 +285,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
285285
0x01, /* bNumEndpoints: One endpoints used */
286286
0x02, /* bInterfaceClass: Communication Interface Class */
287287
0x02, /* bInterfaceSubClass: Abstract Control Model */
288-
0x01, /* bInterfaceProtocol: Common AT commands */
288+
0x00, /* bInterfaceProtocol: No specific protocol */
289289
0x00, /* iInterface: */
290290

291291
/*Header Functional Descriptor*/
@@ -375,7 +375,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
375375
0x01, /* bNumEndpoints: One endpoints used */
376376
0x02, /* bInterfaceClass: Communication Interface Class */
377377
0x02, /* bInterfaceSubClass: Abstract Control Model */
378-
0x01, /* bInterfaceProtocol: Common AT commands */
378+
0x00, /* bInterfaceProtocol: No specific protocol */
379379
0x00, /* iInterface: */
380380

381381
/*Header Functional Descriptor*/

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ PIN_WIRE_SCL LITERAL1
270270
HardwareSerial KEYWORD2
271271
setRx KEYWORD2
272272
setTx KEYWORD2
273+
HALF_DUPLEX_DISABLED LITERAL1
274+
HALF_DUPLEX_ENABLED LITERAL1
273275
setHalfDuplex KEYWORD2
274276
isHalfDuplex KEYWORD2
275277
enableHalfDuplexRx KEYWORD2

libraries/Servo/src/Servo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
#if !defined(ARDUINO_ARCH_STM32F4)
9191

9292
typedef struct {
93-
uint8_t nbr : 6 ; // a pin number from 0 to 63
94-
uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false
93+
uint8_t nbr; // a pin number from 0 to 255
94+
uint8_t isActive; // true if this channel is enabled, pin not pulsed if false
9595
} ServoPin_t ;
9696

9797
typedef struct {

0 commit comments

Comments
 (0)