Skip to content

Commit f96d45e

Browse files
committed
please build i need this
1 parent e6a28e7 commit f96d45e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

pybricks/experimental/pb_module_experimental.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@ STATIC mp_obj_t experimental_odometry_benchmark(size_t n_args, const mp_obj_t *a
2424
// 2. Define the function object
2525
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(experimental_odometry_benchmark_obj, 5, 5, experimental_odometry_benchmark);
2626

27-
// 3. Create the globals table for the module
27+
// 3. Create the globals table
2828
STATIC const mp_rom_map_elem_t experimental_globals_table[] = {
2929
{ MP_ROM_QSTR(MP_QSTR_odometry_benchmark), MP_ROM_PTR(&experimental_odometry_benchmark_obj) },
3030
};
3131
STATIC MP_DEFINE_CONST_DICT(pb_module_experimental_globals, experimental_globals_table);
3232

33-
// NOTE: We have removed the 'const mp_obj_module_t pb_module_experimental' struct.
34-
// The Pybricks build system will generate this automatically in build/genhdr/moduledefs.h
35-
// based on the PYBRICKS_PY_EXPERIMENTAL flag and the filename.
33+
// 4. THE FIX: Explicitly register the module so the compiler sees the globals are used.
34+
// This matches the name used in your Makefile.
35+
const mp_obj_module_t pb_module_experimental = {
36+
.base = { &mp_type_module },
37+
.globals = (mp_obj_dict_t *)&pb_module_experimental_globals,
38+
};
39+
40+
MP_REGISTER_MODULE(MP_QSTR_experimental, pb_module_experimental);
3641

3742
#endif // PYBRICKS_PY_EXPERIMENTAL

0 commit comments

Comments
 (0)