66
77#include "pybricks/experimental/odometry.h"
88
9- // 1. The actual benchmark logic
10- // Keep this STATIC as it is used by the function object below
119static mp_obj_t experimental_odometry_benchmark (size_t n_args , const mp_obj_t * args ) {
1210 int num_iters = mp_obj_get_int (args [0 ]);
1311 float wheel_circ = mp_obj_get_float (args [1 ]);
@@ -17,21 +15,13 @@ static mp_obj_t experimental_odometry_benchmark(size_t n_args, const mp_obj_t *a
1715
1816 return calculate_odometry (num_iters , wheel_circ , axle_track , right_func , left_func );
1917}
20- // Define the function object
2118static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (experimental_odometry_benchmark_obj , 5 , 5 , experimental_odometry_benchmark ) ;
2219
23- // 2. The Globals Table
24- // REMOVED 'STATIC' to prevent 'defined but not used' error
2520const mp_rom_map_elem_t pb_module_experimental_globals_table [] = {
2621 { MP_ROM_QSTR (MP_QSTR_odometry_benchmark ), MP_ROM_PTR (& experimental_odometry_benchmark_obj ) },
2722};
28-
29- // 3. Define the dict WITHOUT 'STATIC'
30- // This makes it visible to the auto-registration system without triggering the warning
3123MP_DEFINE_CONST_DICT (pb_module_experimental_globals , pb_module_experimental_globals_table );
3224
33- // 4. Define the module structure WITHOUT 'STATIC'
34- // This matches the 'extern' declaration the build system generates
3525const mp_obj_module_t pb_module_experimental = {
3626 .base = { & mp_type_module },
3727 .globals = (mp_obj_dict_t * )& pb_module_experimental_globals ,
0 commit comments