File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ Q(pybricks.nxtdevices)
3939Q (pybricks .parameters )
4040#endif
4141
42- #if PYBRICKS_PY_PUPDEVICES
42+ #if PYBRICKS_PY_PUPDEVICES || PYBRICKS_PY_EV3_PUP_ALIAS
4343Q (pybricks .pupdevices )
4444#endif
4545
Original file line number Diff line number Diff line change 99#define PYBRICKS_HUB_CLASS_NAME (MP_QSTR_EV3Brick)
1010#define PYBRICKS_HUB_EV3BRICK (1)
1111
12+ // On EV3, allow PUP imports for easy beta testing
13+ #define PYBRICKS_PY_EV3_PUP_ALIAS (1)
14+ #define PYBRICKS_HUB_CLASS_NAME_ALIAS (MP_QSTR_PrimeHub)
15+
1216// Pybricks modules
1317#define PYBRICKS_PY_COMMON (1)
1418#define PYBRICKS_PY_COMMON_BLE (0)
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ static const mp_rom_map_elem_t ev3devices_globals_table[] = {
1818 { MP_ROM_QSTR (MP_QSTR_InfraredSensor ), MP_ROM_PTR (& pb_type_ev3devices_InfraredSensor ) },
1919 { MP_ROM_QSTR (MP_QSTR_TouchSensor ), MP_ROM_PTR (& pb_type_ev3devices_TouchSensor ) },
2020 { MP_ROM_QSTR (MP_QSTR_UltrasonicSensor ), MP_ROM_PTR (& pb_type_ev3devices_UltrasonicSensor )},
21+ #if PYBRICKS_PY_EV3_PUP_ALIAS
22+ { MP_ROM_QSTR (MP_QSTR_ForceSensor ), MP_ROM_PTR (& pb_type_ev3devices_TouchSensor ) },
23+ #endif
2124};
2225static MP_DEFINE_CONST_DICT (pb_module_ev3devices_globals , ev3devices_globals_table ) ;
2326
@@ -28,6 +31,9 @@ const mp_obj_module_t pb_module_ev3devices = {
2831
2932#if !MICROPY_MODULE_BUILTIN_SUBPACKAGES
3033MP_REGISTER_MODULE (MP_QSTR_pybricks_dot_ev3devices , pb_module_ev3devices );
34+ #if PYBRICKS_PY_EV3_PUP_ALIAS
35+ MP_REGISTER_MODULE (MP_QSTR_pybricks_dot_pupdevices , pb_module_ev3devices );
36+ #endif
3137#endif
3238
3339#endif // PYBRICKS_PY_EV3DEVICES
Original file line number Diff line number Diff line change @@ -124,6 +124,10 @@ static const mp_rom_map_elem_t pb_enum_Port_table[] = {
124124 #if PBDRV_CONFIG_HAS_PORT_4
125125 { MP_ROM_QSTR (MP_QSTR_S4 ), MP_ROM_PTR (& pb_Port_4_obj )},
126126 #endif
127+ #if PYBRICKS_PY_EV3_PUP_ALIAS
128+ { MP_ROM_QSTR (MP_QSTR_E ), MP_ROM_PTR (& pb_Port_1_obj )},
129+ { MP_ROM_QSTR (MP_QSTR_F ), MP_ROM_PTR (& pb_Port_2_obj )},
130+ #endif
127131};
128132static MP_DEFINE_CONST_DICT (pb_enum_type_Port_locals_dict , pb_enum_Port_table ) ;
129133
You can’t perform that action at this time.
0 commit comments