Skip to content

Commit

Permalink
drivers/xbee: disable CTS/RTS pin unless periph_uart_hw_fc is used
Browse files Browse the repository at this point in the history
If usinng an arduino xbee shield then CTS pin will be wired to the
ICSP connector RESET pin.

If also used on an arduino-% board then if xbee is busy sending or
receiving data it will assert CTS and this will trigger a reset on
the board.

To avoid this disable CTS functionality on start up unless hardware
flow control is explicitly requested.
  • Loading branch information
fjmolinas committed Apr 24, 2020
1 parent e9d2fdb commit 922b35d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/xbee/xbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@ int xbee_init(netdev_t *dev)
_at_cmd(xbee, "ATMM2\r");
/* put XBee module in "API mode without escaped characters" */
_at_cmd(xbee, "ATAP1\r");
/* disable xbee CTS and RTS, unless hardware flow control is used */
if(!IS_USED(MODULE_PERIPH_UART_HW_FC)) {
DEBUG("[xbee] init: WARNING if using an arduino BOARD + arduino xbee " \
"shield with ICSP connector, hardware flow control can't be " \
"used since CTS pin is connected to ICSP RESET pin\n");
_at_cmd(xbee, "ATD6 0\r");
_at_cmd(xbee, "ATD7 0\r");
}
/* apply AT commands */
_at_cmd(xbee, "ATAC\r");
/* exit command mode */
Expand Down

0 comments on commit 922b35d

Please sign in to comment.