summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
92386f2)
Flush serial input buffers when switching speeds.
Ensure pin configuration is correct.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_serial_drain();
if (speed > AO_SERIAL_SPEED_57600)
return;
ao_serial_drain();
if (speed > AO_SERIAL_SPEED_57600)
return;
U1BAUD = ao_serial_speeds[speed].baud;
U1GCR = ao_serial_speeds[speed].gcr;
}
U1BAUD = ao_serial_speeds[speed].baud;
U1GCR = ao_serial_speeds[speed].gcr;
}
/* Set up the USART pin assignment */
PERCFG = (PERCFG & ~PERCFG_U1CFG_ALT_MASK) | PERCFG_U1CFG_ALT_2;
/* Set up the USART pin assignment */
PERCFG = (PERCFG & ~PERCFG_U1CFG_ALT_MASK) | PERCFG_U1CFG_ALT_2;
- /* ee has already set the P2SEL bits */
+ P2SEL = (P2SEL & ~(P2SEL_PRI3P1_MASK | P2SEL_PRI2P1_MASK)) |
+ (P2SEL_PRI3P1_USART1 | P2SEL_PRI2P1_USART1);
/* Make the USART pins be controlled by the USART */
P1SEL |= (1 << 6) | (1 << 7);
/* Make the USART pins be controlled by the USART */
P1SEL |= (1 << 6) | (1 << 7);
/* Reasonable serial parameters */
U1UCR = (UxUCR_FLUSH |
UxUCR_FLOW_DISABLE |
/* Reasonable serial parameters */
U1UCR = (UxUCR_FLUSH |
UxUCR_FLOW_DISABLE |
UxUCR_BIT9_8_BITS |
UxUCR_PARITY_DISABLE |
UxUCR_SPB_1_STOP_BIT |
UxUCR_BIT9_8_BITS |
UxUCR_PARITY_DISABLE |
UxUCR_SPB_1_STOP_BIT |