/* This API validates the Accel g value provided as input by the user for Accel offset compensation.  */
static uint16_t validate_user_input(const int32_t *gvalue)
/* This API validates the Accel g value provided as input by the user for Accel offset compensation.  */
static uint16_t validate_user_input(const int32_t *gvalue)
{
    uint8_t index = 0;
    int32_t min_gval = (int32_t)(-1.0 * BMA4XY_MULTIPLIER);
    int32_t max_gval = (int32_t)(1.0 * BMA4XY_MULTIPLIER);
    while (index < 3) {
        if (gvalue[index] >= min_gval && gvalue[index] <= max_gval)
            index++;
        else
            return BMA4_E_OUT_OF_RANGE;
    }
    return BMA4_OK;
}