Merge pull request #3834 from michz/master

fixed bug in stm32f0 uart implementation
This commit is contained in:
Martine Lenders 2016-03-04 05:42:10 +01:00
commit 7ee8c5c66d

View File

@ -122,16 +122,16 @@ int init_base(uart_t uart, uint32_t baudrate)
port->AFR[0] |= af << (rx_pin * 4);
}
else {
port->AFR[1] &= ~(0xf << ((rx_pin - 16) * 4));
port->AFR[1] |= af << ((rx_pin - 16) * 4);
port->AFR[1] &= ~(0xf << ((rx_pin - 8) * 4));
port->AFR[1] |= af << ((rx_pin - 8) * 4);
}
if (tx_pin < 8) {
port->AFR[0] &= ~(0xf << (tx_pin * 4));
port->AFR[0] |= af << (tx_pin * 4);
}
else {
port->AFR[1] &= ~(0xf << ((tx_pin - 16) * 4));
port->AFR[1] |= af << ((tx_pin - 16) * 4);
port->AFR[1] &= ~(0xf << ((tx_pin - 8) * 4));
port->AFR[1] |= af << ((tx_pin - 8) * 4);
}
/* configure UART to mode 8N1 with given baudrate */