Skip to content

Commit 87a0126

Browse files
committed
pybricks/ev3devices: Enable InfraredSensor support
This compiles, and distance measurement appears to be working correctly.
1 parent 4484552 commit 87a0126

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pybricks/ev3devices.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
extern const mp_obj_type_t pb_type_ev3devices_TouchSensor;
1414
extern const mp_obj_type_t pb_type_ev3devices_ColorSensor;
15+
extern const mp_obj_type_t pb_type_ev3devices_InfraredSensor;
1516

1617
#endif // PYBRICKS_PY_EV3DEVICES
1718

1819
#if PYBRICKS_PY_EV3DEVDEVICES
1920

20-
extern const mp_obj_type_t pb_type_ev3devices_InfraredSensor;
2121
extern const mp_obj_type_t pb_type_ev3devices_GyroSensor;
2222
extern const mp_obj_type_t pb_type_ev3devices_UltrasonicSensor;
2323

pybricks/ev3devices/pb_module_ev3devices.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ static const mp_rom_map_elem_t ev3devices_globals_table[] = {
1515
#endif
1616
{ MP_ROM_QSTR(MP_QSTR_TouchSensor), MP_ROM_PTR(&pb_type_ev3devices_TouchSensor) },
1717
{ MP_ROM_QSTR(MP_QSTR_ColorSensor), MP_ROM_PTR(&pb_type_ev3devices_ColorSensor) },
18-
#if PYBRICKS_PY_EV3DEVDEVICES
1918
{ MP_ROM_QSTR(MP_QSTR_InfraredSensor), MP_ROM_PTR(&pb_type_ev3devices_InfraredSensor) },
19+
#if PYBRICKS_PY_EV3DEVDEVICES
2020
{ MP_ROM_QSTR(MP_QSTR_UltrasonicSensor), MP_ROM_PTR(&pb_type_ev3devices_UltrasonicSensor)},
2121
{ MP_ROM_QSTR(MP_QSTR_GyroSensor), MP_ROM_PTR(&pb_type_ev3devices_GyroSensor) },
2222
#endif

pybricks/ev3devices/pb_type_ev3devices_infraredsensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "py/mpconfig.h"
55

6-
#if PYBRICKS_PY_EV3DEVDEVICES
6+
#if PYBRICKS_PY_EV3DEVICES
77

88
#include <pybricks/common.h>
99
#include <pybricks/ev3devices.h>

0 commit comments

Comments
 (0)