aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2020-04-13 17:09:50 +1000
committerGitHub <noreply@github.com>2020-04-13 17:09:50 +1000
commit46e449376163779413b74f81e320a7d7bbd7e13b (patch)
tree8bd54b95a66d0f2db3a01ce137b3e6bba5ba6f8d /tmk_core
parent157d121c71104abb564643f7b6152d149c01fc20 (diff)
downloadqmk_firmware-46e449376163779413b74f81e320a7d7bbd7e13b.tar.gz
qmk_firmware-46e449376163779413b74f81e320a7d7bbd7e13b.zip
Fix AVR SPI parameter configuration, remove timeouts due to sync protocol. (#8775)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp
index f04ab757e..b07407f38 100644
--- a/tmk_core/protocol/lufa/adafruit_ble.cpp
+++ b/tmk_core/protocol/lufa/adafruit_ble.cpp
@@ -152,7 +152,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) {
152 bool ready = false; 152 bool ready = false;
153 153
154 do { 154 do {
155 ready = spi_write(msg->type, 100) != SdepSlaveNotReady; 155 ready = spi_write(msg->type) != SdepSlaveNotReady;
156 if (ready) { 156 if (ready) {
157 break; 157 break;
158 } 158 }
@@ -165,7 +165,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) {
165 165
166 if (ready) { 166 if (ready) {
167 // Slave is ready; send the rest of the packet 167 // Slave is ready; send the rest of the packet
168 spi_transmit(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)) + msg->len, 100); 168 spi_transmit(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)) + msg->len);
169 success = true; 169 success = true;
170 } 170 }
171 171
@@ -205,7 +205,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) {
205 205
206 do { 206 do {
207 // Read the command type, waiting for the data to be ready 207 // Read the command type, waiting for the data to be ready
208 msg->type = spi_read(100); 208 msg->type = spi_read();
209 if (msg->type == SdepSlaveNotReady || msg->type == SdepSlaveOverflow) { 209 if (msg->type == SdepSlaveNotReady || msg->type == SdepSlaveOverflow) {
210 // Release it and let it initialize 210 // Release it and let it initialize
211 spi_stop(); 211 spi_stop();
@@ -215,11 +215,11 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) {
215 } 215 }
216 216
217 // Read the rest of the header 217 // Read the rest of the header
218 spi_receive(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)), 100); 218 spi_receive(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)));
219 219
220 // and get the payload if there is any 220 // and get the payload if there is any
221 if (msg->len <= SdepMaxPayload) { 221 if (msg->len <= SdepMaxPayload) {
222 spi_receive(msg->payload, msg->len, 100); 222 spi_receive(msg->payload, msg->len);
223 } 223 }
224 success = true; 224 success = true;
225 break; 225 break;