pull/196/head
Przemek Wirkus 2014-03-03 12:16:00 +00:00
commit f47daa9173
3 changed files with 5 additions and 7 deletions

View File

@ -19,7 +19,7 @@
/************RTC***************/
const PinMap PinMap_RTC[] = {
{PTC1, RTC_CLKIN, 2},
{PTC1, RTC_CLKIN, 1},
};
/************ADC***************/

View File

@ -18,7 +18,7 @@
/************RTC***************/
const PinMap PinMap_RTC[] = {
{PTC1, RTC_CLKIN, 2},
{PTC1, RTC_CLKIN, 1},
};
/************ADC***************/

View File

@ -364,12 +364,10 @@ int serial_readable(serial_t *obj) {
}
int serial_writable(serial_t *obj) {
int isWritable = 1;
if (NC != uart_data[obj->index].sw_cts.pin)
isWritable = gpio_read(&uart_data[obj->index].sw_cts) == 0;
if (isWritable)
isWritable = obj->uart->LSR & 0x40;
return isWritable;
return (gpio_read(&uart_data[obj->index].sw_cts) == 0) && (obj->uart->LSR & 0x40); //If flow control: writable if CTS low + UART done
else
return obj->uart->LSR & 0x20; //No flow control: writable if space in holding register
}
void serial_clear(serial_t *obj) {