add missing default switch cases

This commit is contained in:
Matthias Ringwald 2020-10-27 18:16:17 +01:00
parent f7b7cba197
commit a8d51f092f
4 changed files with 26 additions and 2 deletions

View File

@ -434,6 +434,9 @@ static void handle_isochronous_data(uint8_t * buffer, uint16_t size){
packet_handler(HCI_SCO_DATA_PACKET, sco_buffer, sco_read_pos); packet_handler(HCI_SCO_DATA_PACKET, sco_buffer, sco_read_pos);
sco_state_machine_init(); sco_state_machine_init();
break; break;
default:
btstack_assert(false);
break;
} }
} }
} }
@ -1183,6 +1186,8 @@ static int usb_close(void){
doing_pollfds = 0; doing_pollfds = 0;
} }
/* fall through */
case LIB_USB_INTERFACE_CLAIMED: case LIB_USB_INTERFACE_CLAIMED:
// Cancel all transfers, ignore warnings for this // Cancel all transfers, ignore warnings for this
libusb_set_debug(NULL, LIBUSB_LOG_LEVEL_ERROR); libusb_set_debug(NULL, LIBUSB_LOG_LEVEL_ERROR);
@ -1281,11 +1286,20 @@ static int usb_close(void){
#endif #endif
log_info("Libusb shutdown complete"); log_info("Libusb shutdown complete");
/* fall through */
case LIB_USB_DEVICE_OPENDED: case LIB_USB_DEVICE_OPENDED:
libusb_close(handle); libusb_close(handle);
/* fall through */
case LIB_USB_OPENED: case LIB_USB_OPENED:
libusb_exit(NULL); libusb_exit(NULL);
break;
default:
btstack_assert(false);
break;
} }
libusb_state = LIB_USB_CLOSED; libusb_state = LIB_USB_CLOSED;
@ -1314,7 +1328,7 @@ static int usb_send_cmd_packet(uint8_t *packet, int size){
// submit transfer // submit transfer
r = libusb_submit_transfer(command_out_transfer); r = libusb_submit_transfer(command_out_transfer);
if (r < 0) { if (r < 0) {
usb_command_active = 0; usb_command_active = 0;
log_error("Error submitting cmd transfer %d", r); log_error("Error submitting cmd transfer %d", r);
@ -1330,7 +1344,7 @@ static int usb_send_acl_packet(uint8_t *packet, int size){
if (libusb_state != LIB_USB_TRANSFERS_ALLOCATED) return -1; if (libusb_state != LIB_USB_TRANSFERS_ALLOCATED) return -1;
// log_info("usb_send_acl_packet enter, size %u", size); // log_info("usb_send_acl_packet enter, size %u", size);
// prepare transfer // prepare transfer
int completed = 0; int completed = 0;
libusb_fill_bulk_transfer(acl_out_transfer, handle, acl_out_addr, packet, size, libusb_fill_bulk_transfer(acl_out_transfer, handle, acl_out_addr, packet, size,

View File

@ -42,6 +42,7 @@
*/ */
#include "btstack_base64_decoder.h" #include "btstack_base64_decoder.h"
#include "btstack_debug.h"
#include <string.h> #include <string.h>
/** /**
@ -119,6 +120,9 @@ int btstack_base64_decoder_process_byte(btstack_base64_decoder_t * context, uin
case 99: case 99:
result = BTSTACK_BASE64_DECODER_INVALID; result = BTSTACK_BASE64_DECODER_INVALID;
break; break;
default:
btstack_assert(false);
break;
} }
return result; return result;
} }

View File

@ -215,6 +215,9 @@ void btstack_slip_decoder_process(uint8_t input){
break; break;
} }
break; break;
default:
btstack_assert(false);
break;
} }
} }

View File

@ -704,6 +704,9 @@ static void hci_transport_h5_process_frame(uint16_t frame_size){
// reset inactvitiy timer // reset inactvitiy timer
hci_transport_inactivity_timer_set(); hci_transport_inactivity_timer_set();
break; break;
default:
// invalid packet type, ignore
break;
} }
break; break;