Skip to content

Commit 1709189

Browse files
committed
fix mistaken code formatting
I wanted to use the idiom ```c #if GUARD if (condition) { alternate code } else #else { common default code } ``` idiom, in which the common default code is conditioned both on a compile-time check and a run-time check. However, I got it wrong and uncrustify chipped in, adding extra brackets around a following piece of code and re-indenting it.
1 parent 19ad1d5 commit 1709189

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ports/espressif/common-hal/_bleio/Adapter.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,16 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable
107107
if (result == ENVIRON_OK) {
108108
ble_svc_gap_device_name_set(ble_name);
109109
} else
110-
#else
110+
#endif
111111
{
112112
ble_svc_gap_device_name_set("CIRCUITPY");
113113
}
114-
#endif
115114

116-
{// Clear all of the internal connection objects.
117-
for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) {
118-
bleio_connection_internal_t *connection = &bleio_connections[i];
119-
// Reset connection.
120-
connection->conn_handle = BLEIO_HANDLE_INVALID;
121-
}
115+
// Clear all of the internal connection objects.
116+
for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) {
117+
bleio_connection_internal_t *connection = &bleio_connections[i];
118+
// Reset connection.
119+
connection->conn_handle = BLEIO_HANDLE_INVALID;
122120
}
123121

124122
cp_task = xTaskGetCurrentTaskHandle();

0 commit comments

Comments
 (0)