Skip to content

Implicit conversion of int16_t data to float #12

@entrop1a

Description

@entrop1a

In bmi2_defs.h, there is:

struct bmi2_sens_axes_data
{
    /*! Data in x-axis */
    int16_t x;

    /*! Data in y-axis */
    int16_t y;

    /*! Data in z-axis */
    int16_t z;

    /*! Sensor time for virtual frames */
    uint32_t virt_sens_time;
};

In which axes are of the type int16_t.

However, in SparkFun_BMI270_Arduino_Library.h, there is:

struct BMI270_SensorData
{
    // Acceleration in g's
    float accelX;
    float accelY;
    float accelZ;

    // Rotation in deg/sec
    float gyroX;
    float gyroY;
    float gyroZ;

    // Auxiliary sensor data, raw bytes
    uint8_t auxData[BMI2_AUX_NUM_BYTES];

    // Time of this data in milliseconds, measured by sensor
    uint32_t sensorTimeMillis;
};

In which axes are of the type float. This conversion, in architecture above 16-bit, can cause memory bloat.

I'd like to know if there's any necessary reason for this conversion or if it was simply a mistake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions