Skip to content

Commit

Permalink
move consts out of headers and into c files
Browse files Browse the repository at this point in the history
  • Loading branch information
lkasso committed Nov 19, 2021
1 parent 28fbf0e commit 1c9bfed
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "MetaWear C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.20.5
PROJECT_NUMBER = 0.20.6

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ dist/
└── lib
└── x64
├── libmetawear.so -> libmetawear.so.0
├── libmetawear.so.0 -> libmetawear.so.0.20.5
└── libmetawear.so.0.20.5
├── libmetawear.so.0 -> libmetawear.so.0.20.6
└── libmetawear.so.0.20.6

```

Expand Down
4 changes: 2 additions & 2 deletions project_version.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.20.5
VERSION=0.20.6
VERSION_MAJOR=0
VERSION_MINOR=20
VERSION_STEP=5
VERSION_STEP=6
3 changes: 0 additions & 3 deletions src/metawear/core/metawearboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#include "metawear/platform/btle_connection.h"
#include "metawear/platform/dllmarker.h"

/** Constant signifying a module is not available */
const int32_t MBL_MW_MODULE_TYPE_NA = -1;

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/metawear/impl/cpp/metawearboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
using namespace std;
using namespace std::chrono;

/** Constant signifying a module is not available */
const int32_t MBL_MW_MODULE_TYPE_NA = -1;
const uint8_t CARTESIAN_FLOAT_SIZE= 6;
const uint16_t MAX_TIME_PER_RESPONSE= 4000;

Expand Down
4 changes: 0 additions & 4 deletions src/metawear/sensor/accelerometer_bosch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
extern "C" {
#endif

const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI160 = 1; ///< Constant identifying the BMI160 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMA255 = 3; ///< Constant identifying the BMA255 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI270 = 4; ///< Constant identifying the BMI270 accelerometer module type

/**
* Available wrist gestures on the BMI270
*/
Expand Down
2 changes: 0 additions & 2 deletions src/metawear/sensor/accelerometer_mma8452q.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
extern "C" {
#endif

const uint8_t MBL_MW_MODULE_ACC_TYPE_MMA8452Q = 0; ///< Constant identifying the MMA8452Q accelerometer type

/*
typedef enum {
MBL_MW_ACC_MMA8452Q_AXIS_X,
Expand Down
3 changes: 0 additions & 3 deletions src/metawear/sensor/barometer_bosch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
extern "C" {
#endif

const uint8_t MBL_MW_MODULE_BARO_TYPE_BMP280 = 0; ///< Constant identifying the BMP280 barometer module type
const uint8_t MBL_MW_MODULE_BARO_TYPE_BME280 = 1; ///< Constant identifying the BME280 barometer module type

/**
* Supported oversampling modes on the Bosch barometers
*/
Expand Down
5 changes: 5 additions & 0 deletions src/metawear/sensor/cpp/accelerometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const float INVALID_SETTING= -1;
using std::stringstream;
using std::vector;

const uint8_t MBL_MW_MODULE_ACC_TYPE_MMA8452Q = 0; ///< Constant identifying the MMA8452Q accelerometer type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI160 = 1; ///< Constant identifying the BMI160 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMA255 = 3; ///< Constant identifying the BMA255 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI270 = 4; ///< Constant identifying the BMI270 accelerometer module type

static const vector<float> MMA8452Q_ODR_VALUES= {800.f, 400.f, 200.f, 100.f, 50.f, 12.5f, 6.25f, 1.56f},
MMA8452Q_FSR_VALUES= {2.f, 4.f, 8.f},
BMI270_ODR_VALUES= {0.78125f, 1.5625f, 3.125f, 6.25f, 12.5f, 25.f, 50.f, 100.f, 200.f, 400.f, 800.f, 1600.f},
Expand Down
4 changes: 4 additions & 0 deletions src/metawear/sensor/cpp/accelerometer_bosch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ using std::vector;
FirmwareConverter::BOSCH_ACCELERATION, channels, 2, 1, offset)
#define GET_CONFIG(x) ((x*) board->module_config.at(MBL_MW_MODULE_ACCELEROMETER))

const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI160 = 1; ///< Constant identifying the BMI160 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMA255 = 3; ///< Constant identifying the BMA255 accelerometer module type
const uint8_t MBL_MW_MODULE_ACC_TYPE_BMI270 = 4; ///< Constant identifying the BMI270 accelerometer module type

const uint8_t BMI270_DEFAULT_CONFIG[]= {
0xa8, 0x02, // acc range
0x00, // feature enable
Expand Down
2 changes: 2 additions & 0 deletions src/metawear/sensor/cpp/accelerometer_mma8452q.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ using std::unordered_map;
#define CREATE_ACC_SIGNAL(interpreter, channels, offset) new MblMwDataSignal(MMA8452Q_ACCEL_RESPONSE_HEADER, board, interpreter, \
FirmwareConverter::MMA8452Q_ACCELERATION, channels, 2, 1, offset)

const uint8_t MBL_MW_MODULE_ACC_TYPE_MMA8452Q = 0; ///< Constant identifying the MMA8452Q accelerometer type

const uint8_t MMA8452Q_DEFAULT_CONFIG[]= {
0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
Expand Down
3 changes: 3 additions & 0 deletions src/metawear/sensor/cpp/barometer_bosch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ using std::memcpy;
using std::piecewise_construct;
using std::vector;

const uint8_t MBL_MW_MODULE_BARO_TYPE_BMP280 = 0; ///< Constant identifying the BMP280 barometer module type
const uint8_t MBL_MW_MODULE_BARO_TYPE_BME280 = 1; ///< Constant identifying the BME280 barometer module type

const vector<float> BMP280_STANDBY_VALUES= {0.5f, 62.5f, 125.f, 250.f, 500.f, 1000.f, 2000.f, 4000.f},
BME280_STANDBY_VALUES= {0.5f, 62.5f, 125.f, 250.f, 500.f, 1000.f, 10.f, 20.f};

Expand Down
3 changes: 3 additions & 0 deletions src/metawear/sensor/cpp/gyro_bosch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ using std::vector;
#define CREATE_BMI270_ROT_SIGNAL(interpreter, channels, offset) new MblMwDataSignal(GYRO_BMI270_ROT_RESPONSE_HEADER, board, interpreter, \
FirmwareConverter::BOSCH_ROTATION, channels, 2, 1, offset)

const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI160 = 0; ///< Constant identifying the BMI160 accelerometer module type
const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI270 = 1; ///< Constant identifying the BMI270 accelerometer module type

const float FSR_SCALE[5]= {16.4f, 32.8f, 65.6f, 131.2f, 262.4f};
const uint8_t PACKED_ROT_REVISION= 1;
const ResponseHeader GYRO_BMI160_ROT_RESPONSE_HEADER(MBL_MW_MODULE_GYRO, ORDINAL(GyroBmi160Register::DATA)),
Expand Down
3 changes: 0 additions & 3 deletions src/metawear/sensor/gyro_bosch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
extern "C" {
#endif

const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI160 = 0; ///< Constant identifying the BMI160 accelerometer module type
const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI270 = 1; ///< Constant identifying the BMI270 accelerometer module type

//@{
/** Indices for component values of the rotation data signal, used with mbl_mw_datasignal_get_component */
const uint8_t MBL_MW_GYRO_ROTATION_X_AXIS_INDEX = 0,
Expand Down

0 comments on commit 1c9bfed

Please sign in to comment.