Skip to content

Commit

Permalink
make "config" for Hardware serial a uint32_t type
Browse files Browse the repository at this point in the history
  • Loading branch information
GrumpyOldPizza committed Sep 18, 2018
1 parent 3419958 commit ed5e31f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cores/stm32l4/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ CDC::CDC(struct _stm32l4_usbd_cdc_t *usbd_cdc, bool serialEvent)

void CDC::begin(unsigned long baudrate)
{
begin(baudrate, (uint8_t)SERIAL_8N1);
begin(baudrate, SERIAL_8N1);
}

void CDC::begin(unsigned long baudrate, uint16_t config)
void CDC::begin(unsigned long baudrate, uint32_t config)
{
/* If USBD_CDC has already been enabled/initialized by STDIO, just add the notify.
*/
Expand Down
2 changes: 1 addition & 1 deletion cores/stm32l4/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class HardwareSerial : public Stream
{
public:
virtual void begin(unsigned long);
virtual void begin(unsigned long baudrate, uint16_t config);
virtual void begin(unsigned long baudrate, uint32_t config);
virtual void end();
virtual int available(void) = 0;
virtual int peek(void) = 0;
Expand Down
2 changes: 1 addition & 1 deletion cores/stm32l4/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CDC : public HardwareSerial
public:
CDC(struct _stm32l4_usbd_cdc_t *usbd_cdc, bool serialEvent);
void begin(unsigned long baudRate);
void begin(unsigned long baudrate, uint16_t config);
void begin(unsigned long baudrate, uint32_t config);
void end(void);

int available(void);
Expand Down
4 changes: 2 additions & 2 deletions cores/stm32l4/Uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void Uart::begin(unsigned long baudrate)
begin(baudrate, SERIAL_8N1, &_rx_data[0], sizeof(_rx_data));
}

void Uart::begin(unsigned long baudrate, uint16_t config)
void Uart::begin(unsigned long baudrate, uint32_t config)
{
begin(baudrate, config, &_rx_data[0], sizeof(_rx_data));
}
Expand All @@ -71,7 +71,7 @@ void Uart::begin(unsigned long baudrate, uint8_t *buffer, size_t size)
begin(baudrate, SERIAL_8N1, buffer, size);
}

void Uart::begin(unsigned long baudrate, uint16_t config, uint8_t *buffer, size_t size)
void Uart::begin(unsigned long baudrate, uint32_t config, uint8_t *buffer, size_t size)
{
if (_uart->state != UART_STATE_INIT) {
flush();
Expand Down
4 changes: 2 additions & 2 deletions cores/stm32l4/Uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class Uart : public HardwareSerial
public:
Uart(struct _stm32l4_uart_t *uart, unsigned int instance, const struct _stm32l4_uart_pins_t *pins, unsigned int priority, unsigned int mode, bool serialEvent);
void begin(unsigned long baudRate);
void begin(unsigned long baudrate, uint16_t config);
void begin(unsigned long baudrate, uint32_t config);
void begin(unsigned long baudRate, uint8_t *buffer, size_t size);
void begin(unsigned long baudrate, uint16_t config, uint8_t *buffer, size_t size);
void begin(unsigned long baudrate, uint32_t config, uint8_t *buffer, size_t size);
void end();
int available();
int availableForWrite(void);
Expand Down

0 comments on commit ed5e31f

Please sign in to comment.