|
36 | 36 | // Set to 1 for extensive HCI packet logging.
|
37 | 37 | #define HCI_DEBUG 0
|
38 | 38 |
|
39 |
| -//FIX **********8 |
40 |
| -busio_uart_obj_t debug_out; |
41 |
| -bool debug_out_in_use; |
42 |
| - |
43 |
| - |
44 | 39 | // HCI H4 protocol packet types: first byte in the packet.
|
45 | 40 | #define H4_CMD 0x01
|
46 | 41 | #define H4_ACL 0x02
|
@@ -165,11 +160,6 @@ STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) {
|
165 | 160 | // Process number of completed packets. Reduce number of pending packets by reported
|
166 | 161 | // number of completed.
|
167 | 162 | STATIC void process_num_comp_pkts(uint16_t handle, uint16_t num_pkts) {
|
168 |
| - const uint8_t ff = 0xff; |
169 |
| - int err; |
170 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &pending_pkt, 1, &err); |
171 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &ff, 1, &err); |
172 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &ff, 1, &err); |
173 | 163 | if (num_pkts && pending_pkt > num_pkts) {
|
174 | 164 | pending_pkt -= num_pkts;
|
175 | 165 | } else {
|
@@ -292,30 +282,14 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[])
|
292 | 282 | }
|
293 | 283 | }
|
294 | 284 |
|
295 |
| -//FIX |
296 |
| -busio_uart_obj_t debug_out; |
297 |
| -bool debug_out_in_use; |
298 |
| - |
299 | 285 | void bleio_hci_reset(void) {
|
300 | 286 | rx_idx = 0;
|
301 | 287 | pending_pkt = 0;
|
302 | 288 | hci_poll_in_progress = false;
|
303 |
| - debug_out_in_use = false; |
304 | 289 | bleio_att_reset();
|
305 | 290 | }
|
306 | 291 |
|
307 | 292 | hci_result_t hci_poll_for_incoming_pkt(void) {
|
308 |
| - if (!debug_out_in_use) { |
309 |
| - debug_out.base.type = &busio_uart_type; |
310 |
| - common_hal_busio_uart_construct(&debug_out, |
311 |
| - &pin_PB12 /*D7*/, NULL, // no RX |
312 |
| - NULL, NULL, |
313 |
| - NULL, false, |
314 |
| - 115200, 8, BUSIO_UART_PARITY_NONE, 1, 0, |
315 |
| - 512, NULL, false); |
316 |
| - debug_out_in_use = true; |
317 |
| - } |
318 |
| - |
319 | 293 | common_hal_mcu_disable_interrupts();
|
320 | 294 | if (hci_poll_in_progress) {
|
321 | 295 | common_hal_mcu_enable_interrupts();
|
@@ -394,15 +368,6 @@ hci_result_t hci_poll_for_incoming_pkt(void) {
|
394 | 368 | common_hal_digitalio_digitalinout_set_value(common_hal_bleio_adapter_obj.rts_digitalinout, true);
|
395 | 369 | size_t pkt_len = rx_idx;
|
396 | 370 |
|
397 |
| - //FIX output packet for debugging |
398 |
| - int err; |
399 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); |
400 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); |
401 |
| - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); |
402 |
| - |
403 |
| - common_hal_busio_uart_write(&debug_out, rx_buffer, rx_idx, &err); |
404 |
| - |
405 |
| - |
406 | 371 | // Reset for next packet.
|
407 | 372 | rx_idx = 0;
|
408 | 373 | packet_is_complete = false;
|
|
0 commit comments