8000 CircuitPython files: replace STATIC with static by dhalbert · Pull Request #9263 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

CircuitPython files: replace STATIC with static #9263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions devices/ble_hci/common-hal/_bleio/Adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT];

STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
static void add_generic_services(bleio_adapter_obj_t *adapter) {
// Creat 8000 e Generic Access UUID, Service, and Characteristics.

// Generic Access Service setup.
Expand Down Expand Up @@ -158,13 +158,13 @@ STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
}


STATIC void check_enabled(bleio_adapter_obj_t *adapter) {
static void check_enabled(bleio_adapter_obj_t *adapter) {
if (!common_hal_bleio_adapter_get_enabled(adapter)) {
mp_raise_bleio_BluetoothError(MP_ERROR_TEXT("Adapter not enabled"));
}
}

// STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
// static bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in;

// // For debugging.
Expand Down Expand Up @@ -258,7 +258,7 @@ static void _adapter_set_name(bleio_adapter_obj_t *self, mp_obj_str_t *name_obj)

// Get various values and limits set by the adapter.
// Set event mask.
STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) {
static void bleio_adapter_hci_init(bleio_adapter_obj_t *self) {
mp_int_t name_len = 0;

#if CIRCUITPY_OS_GETENV
Expand Down Expand Up @@ -418,7 +418,7 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *na
}


// STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
// static bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
// bleio_scanresults_obj_t *scan_results = (bleio_scanresults_obj_t*)scan_results_in;

// i 8000 f (ble_evt->header.evt_id == BLE_GAP_EVT_TIMEOUT &&
Expand Down Expand Up @@ -516,7 +516,7 @@ void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) {
// volatile bool done;
// } connect_info_t;

// STATIC bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) {
// static bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) {
// connect_info_t *info = (connect_info_t*)info_in;

// switch (ble_evt->header.evt_id) {
Expand Down Expand Up @@ -613,13 +613,13 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre
return mp_const_none;
}

STATIC void check_data_fit(size_t data_len, bool connectable) {
static void check_data_fit(size_t data_len, bool connectable) {
if (data_len > MAX_ADVERTISEMENT_SIZE) {
mp_raise_ValueError(MP_ERROR_TEXT("Data too large for advertisement packet"));
}
}

// STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
// static bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in;

// switch (ble_evt->header.evt_id) {
Expand Down
2 changes: 1 addition & 1 deletion devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "common-hal/_bleio/CharacteristicBuffer.h"

// Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped.
STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) {
static void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) {
ringbuf_put_n(&self->ringbuf, data, len);
}

Expand Down
16 changes: 8 additions & 8 deletions devices/ble_hci/common-hal/_bleio/Connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
}

// service_uuid may be NULL, to discover all services.
// STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) {
// static bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) {
// m_discovery_successful = false;
// m_discovery_in_process = true;

Expand All @@ -385,7 +385,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// return m_discovery_successful;
// }

// STATIC bool discover_next_characteristics(bleio_connection_internal_t* connection, bleio_service_obj_t *service, uint16_t start_handle) {
// static bool discover_next_characteristics(bleio_connection_internal_t* connection, bleio_service_obj_t *service, uint16_t start_handle) {
// m_char_discovery_service = service;

// ble_gattc_handle_range_t handle_range;
Expand All @@ -407,7 +407,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// return m_discovery_successful;
// }

// STATIC bool discover_next_descriptors(bleio_connection_internal_t* connection, bleio_characteristic_obj_t *characteristic, uint16_t start_handle, uint16_t end_handle) {
// static bool discover_next_descriptors(bleio_connection_internal_t* connection, bleio_characteristic_obj_t *characteristic, uint16_t start_handle, uint16_t end_handle) {
// m_desc_discovery_characteristic = characteristic;

// ble_gattc_handle_range_t handle_range;
Expand All @@ -429,7 +429,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// return m_discovery_successful;
// }

// STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// static void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// for (size_t i = 0; i < response->count; ++i) {
// ble_gattc_service_t *gattc_service = &response->services[i];

Expand Down Expand Up @@ -465,7 +465,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// m_discovery_in_process = false;
// }

// STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// static void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// for (size_t i = 0; i < response->count; ++i) {
// ble_gattc_char_t *gattc_char = &response->chars[i];

Expand Down Expand Up @@ -509,7 +509,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// m_discovery_in_process = false;
// }

// STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// static void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio_connection_internal_t* connection) {
// for (size_t i = 0; i < response->count; ++i) {
// ble_gattc_desc_t *gattc_desc = &response->descs[i];

Expand Down Expand Up @@ -564,7 +564,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// m_discovery_in_process = false;
// }

// STATIC bool discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t payload) {
// static bool discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t payload) {
// bleio_connection_internal_t* connection = MP_OBJ_TO_PTR(payload);
// switch (ble_evt->header.evt_id) {
// case BLE_GAP_EVT_DISCONNECTED:
Expand Down Expand Up @@ -592,7 +592,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
// return true;
// }

// STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t service_uuids_whitelist) {
// static void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t service_uuids_whitelist) {
// ble_drv_add_event_handler(discovery_on_ble_evt, self);

// // Start over with an empty list.
Expand Down
4 changes: 2 additions & 2 deletions devices/ble_hci/common-hal/_bleio/PacketBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "shared-bindings/_bleio/PacketBuffer.h"
#include "supervisor/shared/tick.h"

STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) {
static void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) {
if (len + sizeof(uint16_t) > ringbuf_size(&self->ringbuf)) {
// This shouldn't happen.
return;
Expand All @@ -35,7 +35,7 @@ STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uin
ringbuf_put_n(&self->ringbuf, data, len);
}

STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) {
static uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) {
// Queue up the next outgoing buffer. We use two, one that has been passed to the SD for
// transmission (when packet_queued is true) and the other is `pending` and can still be
// modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead
Expand Down
Loading
0