8000 Update machine_encoder.c · micropython/micropython@47db009 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47db009

Browse files
committed
Update machine_encoder.c
1 parent 01a3d36 commit 47db009

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ports/esp32/esp32_common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ list(APPEND MICROPY_SOURCE_PORT
6969
machine_i2c.c
7070
machine_i2s.c
7171
machine_uart.c
72+
machine_encoder.c
7273
modmachine.c
7374
network_common.c
7475
network_lan.c

ports/esp32/machine_encoder.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ See also
4747
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/pcnt/rotary_encoder
4848
*/
4949

50+
#include "py/mpprint.h"
5051
#include "py/runtime.h"
5152
#include "mphalport.h"
5253
#include "modmachine.h"
5354

5455
#if MICROPY_PY_MACHINE_PCNT
5556

5657
#include "driver/pcnt.h"
58+
#include "driver/pulse_cnt.h"
5759
#include "soc/pcnt_struct.h"
5860
#include "esp_err.h"
5961

@@ -311,7 +313,7 @@ mp_obj_t machine_PCNT_status(mp_obj_t self_in) {
311313
STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_PCNT_status_obj, machine_PCNT_status);
312314

313315
// -----------------------------------------------------------------
314-
STATIC mp_obj_t machine_PCNT_irq(mp_uint_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
316+
STATIC mp_obj_t machine_PCNT_irq(size_t n_pos_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
315317
enum { ARG_handler, ARG_trigger, ARG_value };
316318
static const mp_arg_t allowed_args[] = {
317319
{ MP_QSTR_handler, MP_ARG_OBJ, {.u_obj = mp_const_none} },

0 commit comments

Comments
 (0)
0