diff --git a/src/ble/att_server.c b/src/ble/att_server.c index 3cd91b3bc..b436387a5 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -548,9 +548,10 @@ static void att_server_handle_can_send_now(void){ hci_con_handle_t request_con_handle = HCI_CON_HANDLE_INVALID; hci_con_handle_t last_send_con_handle = HCI_CON_HANDLE_INVALID; int can_send_now = 1; - int phase; + int phase_index; - for (phase = ATT_SERVER_RUN_PHASE_1_REQUESTS; phase <= ATT_SERVER_RUN_PHASE_3_NOTIFICATIONS; phase++){ + for (phase_index = ATT_SERVER_RUN_PHASE_1_REQUESTS; phase_index <= ATT_SERVER_RUN_PHASE_3_NOTIFICATIONS; phase_index++){ + att_server_run_phase_t phase = (att_server_run_phase_t) phase_index; hci_con_handle_t skip_connections_until = att_server_last_can_send_now; while (1){ btstack_linked_list_iterator_t it; diff --git a/src/ble/sm.c b/src/ble/sm.c index 9f9d7e73e..4a4c59d41 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -3184,7 +3184,6 @@ static int sm_validate_stk_generation_method(void){ return (sm_accepted_stk_generation_methods & SM_STK_GENERATION_METHOD_OOB) != 0; case NUMERIC_COMPARISON: return (sm_accepted_stk_generation_methods & SM_STK_GENERATION_METHOD_NUMERIC_COMPARISON) != 0; - return 1; default: return 0; } diff --git a/src/btstack_crypto.c b/src/btstack_crypto.c index 58427da07..e1713ad32 100644 --- a/src/btstack_crypto.c +++ b/src/btstack_crypto.c @@ -671,11 +671,13 @@ static void btstack_crypto_run(void){ btstack_crypto_wait_for_hci_result = 1; hci_send_cmd(&hci_le_generate_dhkey, &btstack_crypto_ec_p192->public_key[0], &btstack_crypto_ec_p192->public_key[32]); #endif -#endif - break; - default: - break; - } + break; + +#endif /* ENABLE_ECC_P256 */ + + default: + break; + } } static void btstack_crypto_handle_random_data(const uint8_t * data, uint16_t len){ diff --git a/src/btstack_slip.c b/src/btstack_slip.c index 06dc6295e..89e4994ca 100644 --- a/src/btstack_slip.c +++ b/src/btstack_slip.c @@ -113,9 +113,9 @@ uint8_t btstack_slip_encoder_get_byte(void){ encoder_state = SLIP_ENCODER_SEND_DD; return 0xdb; default: - return next_byte; + break; } - break; + return next_byte; case SLIP_ENCODER_SEND_DC: encoder_state = SLIP_ENCODER_DEFAULT; return 0x0dc;