Skip to content

Commit e0c2e45

Browse files
ABOSTMfpistm
authored andcommitted
core: fix HardwareSerial compilation failed when USART disabled
Fixes #1695 Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent 4e22018 commit e0c2e45

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cores/arduino/HardwareSerial.h

+2
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,13 @@ class HardwareSerial : public Stream {
175175
static void _rx_complete_irq(serial_t *obj);
176176
static int _tx_complete_irq(serial_t *obj);
177177

178+
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
178179
// Could be used to mix Arduino API and STM32Cube HAL API (ex: DMA). Use at your own risk.
179180
UART_HandleTypeDef *getHandle(void)
180181
{
181182
return &(_serial.handle);
182183
}
184+
#endif // HAL_UART_MODULE_ENABLED && !HAL_UART_MODULE_ONLY
183185

184186
private:
185187
bool _rx_enabled;

0 commit comments

Comments
 (0)