Skip to content

Implemented steps reset function for bma421 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bma42x.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ STATIC mp_obj_t bma42x_BMA42X_init(mp_obj_t self_in)
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bma42x_BMA42X_init_obj, bma42x_BMA42X_init);


STATIC mp_obj_t bma42x_BMA42X_reset_step_counter(mp_obj_t self_in)
{
bma42x_BMA42X_obj_t *self = MP_OBJ_TO_PTR(self_in);

check_result(bma421_reset_step_counter(&self->dev));

return mp_const_none;
}

STATIC MP_DEFINE_CONST_FUN_OBJ_1(bma42x_BMA42X_reset_step_counter_obj, bma42x_BMA42X_reset_step_counter);

STATIC mp_obj_t bma42x_BMA42X_map_interrupt(size_t n_args, const mp_obj_t *args)
{
bma42x_BMA42X_obj_t *self = MP_OBJ_TO_PTR(args[0]);
Expand Down Expand Up @@ -434,6 +446,7 @@ STATIC const mp_rom_map_elem_t bma42x_BMA42X_locals_dict_table[] = {
BMA4_EXPORT_OBJ(read_accel_xyz),
BMA4_EXPORT_OBJ(read_int_status),
BMA4_EXPORT_OBJ(set_accel_config),
BMA4_EXPORT_OBJ(reset_step_counter),
BMA4_EXPORT_OBJ(set_accel_enable),
BMA4_EXPORT_OBJ(set_any_mot_config),
BMA4_EXPORT_OBJ(set_no_mot_config),
Expand Down