Skip to content

Commit 9de8935

Browse files
committed
squish: STATIC->static fix
needed for micropython#12346 after micropython updates
1 parent c5d864d commit 9de8935

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

ports/esp32/esp32_pcnt.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ MP_REGISTER_ROOT_POINTER(struct _esp32_pcnt_obj_t *esp32_pcnt_obj_head);
5858

5959
// Once off installation of the PCNT ISR service (using the default service).
6060
// Persists across soft reset.
61-
STATIC bool pcnt_isr_service_installed = false;
61+
static bool pcnt_isr_service_installed = false;
6262

63-
STATIC mp_obj_t esp32_pcnt_deinit(mp_obj_t self_in);
63+
static mp_obj_t esp32_pcnt_deinit(mp_obj_t self_in);
6464

6565
void esp32_pcnt_deinit_all(void) {
6666
esp32_pcnt_obj_t **pcnt = &MP_STATE_PORT(esp32_pcnt_obj_head);
@@ -70,7 +70,7 @@ void esp32_pcnt_deinit_all(void) {
7070
}
7171
}
7272

73-
STATIC void esp32_pcnt_init_helper(esp32_pcnt_obj_t *self, size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
73+
static void esp32_pcnt_init_helper(esp32_pcnt_obj_t *self, size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
7474
enum {
7575
ARG_channel,
7676
ARG_pin,
@@ -225,7 +225,7 @@ STATIC void esp32_pcnt_init_helper(esp32_pcnt_obj_t *self, size_t n_pos_args, co
225225
}
226226

227227
// Disable any events, and remove the ISR handler for this unit.
228-
STATIC void esp32_pcnt_disable_events_for_unit(esp32_pcnt_obj_t *self) {
228+
static void esp32_pcnt_disable_events_for_unit(esp32_pcnt_obj_t *self) {
229229
if (!self->irq) {
230230
return;
231231
}
@@ -241,7 +241,7 @@ STATIC void esp32_pcnt_disable_events_for_unit(esp32_pcnt_obj_t *self) {
241241
self->irq->trigger = 0;
242242
}
243243

244-
STATIC mp_obj_t esp32_pcnt_make_new(const mp_obj_type_t *type, size_t n_pos_args, size_t n_kw_args, const mp_obj_t *args) {
244+
static mp_obj_t esp32_pcnt_make_new(const mp_obj_type_t *type, size_t n_pos_args, size_t n_kw_args, const mp_obj_t *args) {
245245
if (n_pos_args < 1) {
246246
mp_raise_TypeError(MP_ERROR_TEXT("id"));
247247
}
@@ -289,19 +289,19 @@ STATIC mp_obj_t esp32_pcnt_make_new(const mp_obj_type_t *type, size_t n_pos_args
289289
return MP_OBJ_FROM_PTR(self);
290290
}
291291

292-
STATIC void esp32_pcnt_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
292+
static void esp32_pcnt_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
293293
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
294294
mp_printf(print, "PCNT(%u)", self->unit);
295295
}
296296

297-
STATIC mp_obj_t esp32_pcnt_init(size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
297+
static mp_obj_t esp32_pcnt_init(size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
298298
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
299299
esp32_pcnt_init_helper(self, n_pos_args - 1, pos_args + 1, kw_args);
300300
return mp_const_none;
301301
}
302-
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(esp32_pcnt_init_obj, 1, esp32_pcnt_init);
302+
static MP_DEFINE_CONST_FUN_OBJ_KW(esp32_pcnt_init_obj, 1, esp32_pcnt_init);
303303

304-
STATIC mp_obj_t esp32_pcnt_deinit(mp_obj_t self_in) {
304+
static mp_obj_t esp32_pcnt_deinit(mp_obj_t self_in) {
305305
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
306306

307307
// Remove IRQ and events.
@@ -333,9 +333,9 @@ STATIC mp_obj_t esp32_pcnt_deinit(mp_obj_t self_in) {
333333

334334
return mp_const_none;
335335
}
336-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_deinit_obj, esp32_pcnt_deinit);
336+
static MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_deinit_obj, esp32_pcnt_deinit);
337337

338-
STATIC mp_obj_t esp32_pcnt_value(size_t n_args, const mp_obj_t *pos_args) {
338+
static mp_obj_t esp32_pcnt_value(size_t n_args, const mp_obj_t *pos_args) {
339339
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
340340

341341
// Optionally use pcnt.value(True) to clear the counter but only support a
@@ -369,9 +369,9 @@ STATIC mp_obj_t esp32_pcnt_value(size_t n_args, const mp_obj_t *pos_args) {
369369

370370
return MP_OBJ_NEW_SMALL_INT(value);
371371
}
372-
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp32_pcnt_value_obj, 1, 2, esp32_pcnt_value);
372+
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp32_pcnt_value_obj, 1, 2, esp32_pcnt_value);
373373

374-
STATIC mp_uint_t esp32_pcnt_irq_trigger(mp_obj_t self_in, mp_uint_t new_trigger) {
374+
static mp_uint_t esp32_pcnt_irq_trigger(mp_obj_t self_in, mp_uint_t new_trigger) {
375375
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
376376
self->irq->trigger = new_trigger;
377377
for (pcnt_evt_type_t evt_type = PCNT_EVT_THRES_1; evt_type <= PCNT_EVT_ZERO; evt_type <<= 1) {
@@ -384,7 +384,7 @@ STATIC mp_uint_t esp32_pcnt_irq_trigger(mp_obj_t self_in, mp_uint_t new_trigger)
384384
return 0;
385385
}
386386

387-
STATIC mp_uint_t esp32_pcnt_irq_info(mp_obj_t self_in, mp_uint_t info_type) {
387+
static mp_uint_t esp32_pcnt_irq_info(mp_obj_t self_in, mp_uint_t info_type) {
388388
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
389389
if (info_type == MP_IRQ_INFO_FLAGS) {
390390
// Atomically get-and-clear the flags.
@@ -399,12 +399,12 @@ STATIC mp_uint_t esp32_pcnt_irq_info(mp_obj_t self_in, mp_uint_t info_type) {
399399
return 0;
400400
}
401401

402-
STATIC const mp_irq_methods_t esp32_pcnt_irq_methods = {
402+
static const mp_irq_methods_t esp32_pcnt_irq_methods = {
403403
.trigger = esp32_pcnt_irq_trigger,
404404
.info = esp32_pcnt_irq_info,
405405
};
406406

407-
STATIC IRAM_ATTR void esp32_pcnt_intr_handler(void *arg) {
407+
static IRAM_ATTR void esp32_pcnt_intr_handler(void *arg) {
408408
esp32_pcnt_obj_t *self = (esp32_pcnt_obj_t *)arg;
409409
pcnt_unit_t unit = self->unit;
410410
uint32_t status;
@@ -415,7 +415,7 @@ STATIC IRAM_ATTR void esp32_pcnt_intr_handler(void *arg) {
415415
mp_irq_handler(&self->irq->base);
416416
}
417417

418-
STATIC mp_obj_t esp32_pcnt_irq(size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
418+
static mp_obj_t esp32_pcnt_irq(size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
419419
enum { ARG_handler, ARG_trigger };
420420
static const mp_arg_t allowed_args[] = {
421421
{ MP_QSTR_handler, MP_ARG_OBJ, {.u_obj = mp_const_none} },
@@ -460,23 +460,23 @@ STATIC mp_obj_t esp32_pcnt_irq(size_t n_pos_args, const mp_obj_t *pos_args, mp_m
460460

461461
return MP_OBJ_FROM_PTR(self->irq);
462462
}
463-
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(esp32_pcnt_irq_obj, 1, esp32_pcnt_irq);
463+
static MP_DEFINE_CONST_FUN_OBJ_KW(esp32_pcnt_irq_obj, 1, esp32_pcnt_irq);
464464

465-
STATIC mp_obj_t esp32_pcnt_start(mp_obj_t self_in) {
465+
static mp_obj_t esp32_pcnt_start(mp_obj_t self_in) {
466466
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
467467
check_esp_err(pcnt_counter_resume(self->unit));
468468
return mp_const_none;
469469
}
470-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_start_obj, esp32_pcnt_start);
470+
static MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_start_obj, esp32_pcnt_start);
471471

472-
STATIC mp_obj_t esp32_pcnt_stop(mp_obj_t self_in) {
472+
static mp_obj_t esp32_pcnt_stop(mp_obj_t self_in) {
473473
esp32_pcnt_obj_t *self = MP_OBJ_TO_PTR(self_in);
474474
check_esp_err(pcnt_counter_pause(self->unit));
475475
return mp_const_none;
476476
}
477-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_stop_obj, esp32_pcnt_stop);
477+
static MP_DEFINE_CONST_FUN_OBJ_1(esp32_pcnt_stop_obj, esp32_pcnt_stop);
478478

479-
STATIC const mp_rom_map_elem_t esp32_pcnt_locals_dict_table[] = {
479+
static const mp_rom_map_elem_t esp32_pcnt_locals_dict_table[] = {
480480
// Methods
481481
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&esp32_pcnt_init_obj) },
482482
{ MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&esp32_pcnt_value_obj) },
@@ -499,7 +499,7 @@ STATIC const mp_rom_map_elem_t esp32_pcnt_locals_dict_table[] = {
499499
{ MP_ROM_QSTR(MP_QSTR_IRQ_MIN), MP_ROM_INT(PCNT_EVT_L_LIM) },
500500
{ MP_ROM_QSTR(MP_QSTR_IRQ_MAX), MP_ROM_INT(PCNT_EVT_H_LIM) },
501501
};
502-
STATIC MP_DEFINE_CONST_DICT(esp32_pcnt_locals_dict, esp32_pcnt_locals_dict_table);
502+
static MP_DEFINE_CONST_DICT(esp32_pcnt_locals_dict, esp32_pcnt_locals_dict_table);
503503

504504
MP_DEFINE_CONST_OBJ_TYPE(
505505
esp32_pcnt_type,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy