Skip to content

Commit 1e2c5a3

Browse files
committed
pybricks: more STATIC removal
Replace `STATIC`` with `static`. The define is being removed in MicroPython and will cause a compile error in the future.
1 parent 602cd9b commit 1e2c5a3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pybricks/common/pb_type_imu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static mp_obj_t pb_type_imu_heading(size_t n_args, const mp_obj_t *pos_args, mp_
311311
static MP_DEFINE_CONST_FUN_OBJ_KW(pb_type_imu_heading_obj, 1, pb_type_imu_heading);
312312

313313
// pybricks._common.IMU.orientation
314-
STATIC mp_obj_t common_IMU_orientation(mp_obj_t self_in) {
314+
static mp_obj_t common_IMU_orientation(mp_obj_t self_in) {
315315

316316
// Make matrix. REVISIT: Dedicated call from orientation matrix.
317317
pb_type_Matrix_obj_t *matrix = MP_OBJ_TO_PTR(pb_type_Matrix_make_bitmap(3, 3, 1.0f, 0));

pybricks/tools/pb_type_app_data.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ static pbio_error_t handle_incoming_app_data(uint16_t offset, uint32_t size, con
4242
return PBIO_SUCCESS;
4343
}
4444

45-
STATIC mp_obj_t pb_type_app_data_get_bytes(mp_obj_t self_in) {
45+
static mp_obj_t pb_type_app_data_get_bytes(mp_obj_t self_in) {
4646
pb_type_app_data_obj_t *self = MP_OBJ_TO_PTR(self_in);
4747
// Don't return internal bytes object but make a copy so the user bytes
4848
// object is constant as would be expected. Revisit: enable and return
4949
// a memoryview, especially if using large buffers.
5050
return mp_obj_new_bytes(self->rx_bytes_obj.data, self->rx_bytes_obj.len);
5151
}
52-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pb_type_app_data_get_bytes_obj, pb_type_app_data_get_bytes);
52+
static MP_DEFINE_CONST_FUN_OBJ_1(pb_type_app_data_get_bytes_obj, pb_type_app_data_get_bytes);
5353

54-
STATIC mp_obj_t pb_type_app_data_get_values(mp_obj_t self_in) {
54+
static mp_obj_t pb_type_app_data_get_values(mp_obj_t self_in) {
5555

5656
// Implementation in MicroPython is static, so import from ustruct.unpack.
5757
mp_obj_t ustruct_unpack = pb_function_import_helper(MP_QSTR_ustruct, MP_QSTR_unpack);
@@ -62,9 +62,9 @@ STATIC mp_obj_t pb_type_app_data_get_values(mp_obj_t self_in) {
6262
pb_type_app_data_obj_t *self = MP_OBJ_TO_PTR(self_in);
6363
return mp_call_function_2(ustruct_unpack, self->rx_format, MP_OBJ_FROM_PTR(&self->rx_bytes_obj));
6464
}
65-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pb_type_app_data_get_values_obj, pb_type_app_data_get_values);
65+
static MP_DEFINE_CONST_FUN_OBJ_1(pb_type_app_data_get_values_obj, pb_type_app_data_get_values);
6666

67-
STATIC mp_obj_t pb_type_app_data_write_bytes(mp_obj_t self_in, mp_obj_t data_in) {
67+
static mp_obj_t pb_type_app_data_write_bytes(mp_obj_t self_in, mp_obj_t data_in) {
6868
pb_type_app_data_obj_t *self = MP_OBJ_TO_PTR(self_in);
6969

7070
// Copy data to local buffer. Needs to remain valid while sending.
@@ -82,11 +82,11 @@ STATIC mp_obj_t pb_type_app_data_write_bytes(mp_obj_t self_in, mp_obj_t data_in)
8282
pbdrv_bluetooth_send_queued(&self->tx_task, &self->tx_context);
8383
return pb_module_tools_pbio_task_wait_or_await(&self->tx_task);
8484
}
85-
STATIC MP_DEFINE_CONST_FUN_OBJ_2(pb_type_app_data_write_bytes_obj, pb_type_app_data_write_bytes);
85+
static MP_DEFINE_CONST_FUN_OBJ_2(pb_type_app_data_write_bytes_obj, pb_type_app_data_write_bytes);
8686

8787
static const mp_obj_str_t pb_const_empty_str_obj = {{&mp_type_str}, 0, 0, (const byte *)""};
8888

89-
STATIC mp_obj_t pb_type_app_data_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
89+
static mp_obj_t pb_type_app_data_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
9090

9191
PB_PARSE_ARGS_CLASS(n_args, n_kw, args,
9292
PB_ARG_DEFAULT_OBJ(rx_format, pb_const_empty_str_obj));
@@ -131,14 +131,14 @@ mp_obj_t pb_type_app_data_close(mp_obj_t stream) {
131131
}
132132
MP_DEFINE_CONST_FUN_OBJ_1(pb_type_app_data_close_obj, pb_type_app_data_close);
133133

134-
STATIC const mp_rom_map_elem_t pb_type_app_data_locals_dict_table[] = {
134+
static const mp_rom_map_elem_t pb_type_app_data_locals_dict_table[] = {
135135
{ MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&pb_type_app_data_close_obj) },
136136
{ MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&pb_type_app_data_close_obj) },
137137
{ MP_ROM_QSTR(MP_QSTR_get_bytes), MP_ROM_PTR(&pb_type_app_data_get_bytes_obj) },
138138
{ MP_ROM_QSTR(MP_QSTR_get_values), MP_ROM_PTR(&pb_type_app_data_get_values_obj) },
139139
{ MP_ROM_QSTR(MP_QSTR_write_bytes), MP_ROM_PTR(&pb_type_app_data_write_bytes_obj) },
140140
};
141-
STATIC MP_DEFINE_CONST_DICT(pb_type_app_data_locals_dict, pb_type_app_data_locals_dict_table);
141+
static MP_DEFINE_CONST_DICT(pb_type_app_data_locals_dict, pb_type_app_data_locals_dict_table);
142142

143143
MP_DEFINE_CONST_OBJ_TYPE(pb_type_app_data,
144144
MP_QSTR_AppData,

0 commit comments

Comments
 (0)