bluez5-init: rename the CTS gpio name and make the code more robust

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2016-06-23 14:43:40 +02:00
parent a6d0a1d139
commit 32ae76e1cf
1 changed files with 6 additions and 4 deletions

View File

@ -38,10 +38,12 @@ bt_init_qca6564() {
# Module version older than revision 4 has swapped TX and RX lines # Module version older than revision 4 has swapped TX and RX lines
if [ "${MOD_VERSION}" -lt "4" ]; then if [ "${MOD_VERSION}" -lt "4" ]; then
# Workaround to ignore the CTS flow control line # Workaround to ignore the CTS flow control line
BT_GPIO_CTS="18" BT_CTS_QCA_GPIO_NR="18"
echo "${BT_GPIO_CTS}" > /sys/class/gpio/export BT_CTS_L="/sys/class/gpio/gpio${BT_CTS_QCA_GPIO_NR}"
echo "out" > /sys/class/gpio/gpio${BT_GPIO_CTS}/direction [ -d "${BT_CTS_L}" ] || printf "%s" ${BT_CTS_QCA_GPIO_NR} > /sys/class/gpio/export
echo "0" > /sys/class/gpio/gpio${BT_GPIO_CTS}/value printf out > ${BT_CTS_L}/direction && sleep .1
printf 0 > ${BT_CTS_L}/value && sleep .1
[ -d "${BT_CTS_L}" ] && printf "%s" ${BT_CTS_QCA_GPIO_NR} > /sys/class/gpio/unexport
# Reduce the rate to avoid the need for HW flow control # Reduce the rate to avoid the need for HW flow control
BT_RATE="115200" BT_RATE="115200"
BT_FLOW="noflow" BT_FLOW="noflow"