BMA423 step acquisition? I followed the operation, but I can't get the reason for the interrupt from the interrupt, because it returns 0 every time, the direct reading step is also 0, other functions, such as writing the configuration file, getting the acceleration The values are all normal. Is it only normal to get the number of steps? Did I miss something? static void Step_Interrupt(void)
{
motion_sensor_command_t command = PROCESS_STEP_INTERRUPT;
xQueueSendFromISR(motionCommandQ, &command, &xHigherPriorityTaskWoken);
}
//The return value is normal, ignore the return value check here
rslt |= bma423_init(&bmd4_dev);
rslt |= bma423_write_config_file(&bmd4_dev);
rslt |= bma423_step_counter_set_watermark(1, &bmd4_dev);
rslt |= bma423_reset_step_counter(&bmd4_dev);
rslt |= bma423_feature_enable(BMA423_STEP_CNTR, BMA4_ENABLE, &bmd4_dev);
rslt |= bma423_step_detector_enable(BMA4_ENABLE, &bmd4_dev);
rslt |= bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, BMA4_ENABLE, &bmd4_dev);
attachInterrupt(BMA423_INT1_PIN, Step_Interrupt, RISING);
while(1){
rtosApiResult = xQueueReceive(motionCommandQ, &motionCommand, portMAX_DELAY);
if (rtosApiResult == pdTRUE) {
switch (motionCommand) {
case PROCESS_STEP_INTERRUPT:
bma423_read_int_status(&int_status, &bmd4_dev);
if (int_status & BMA423_STEP_CNTR_INT) {
bma423_step_counter_output(&stepCount, &bmd4_dev);
printf("stepCount:%u\n",stepCount);
}
}
}
... View more