Skip to content

Commit b39e565

Browse files
committed
Fix warning: "BIG_ENDIAN" is not defined
1 parent 80fffde commit b39e565

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

imu/BMI160_driver/bmi160_defs.h

+33-22
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ enum bmi160_int_status_sel {
760760
*/
761761
struct bmi160_int_status_bits
762762
{
763-
#if LITTLE_ENDIAN == 1
763+
#ifdef LITTLE_ENDIAN
764764
uint32_t step : 1;
765765
uint32_t sigmot : 1;
766766
uint32_t anym : 1;
@@ -793,7 +793,8 @@ struct bmi160_int_status_bits
793793
uint32_t orient_1_0 : 2;
794794
uint32_t orient_2 : 1;
795795
uint32_t flat : 1;
796-
#elif BIG_ENDIAN == 1
796+
#endif
797+
#ifdef BIG_ENDIAN
797798
uint32_t high_first_x : 1;
798799
uint32_t high_first_y : 1;
799800
uint32_t high_first_z : 1;
@@ -1102,7 +1103,7 @@ enum bmi160_any_sig_motion_active_interrupt_state {
11021103
};
11031104
struct bmi160_acc_tap_int_cfg
11041105
{
1105-
#if LITTLE_ENDIAN == 1
1106+
#ifdef LITTLE_ENDIAN
11061107

11071108
/*! tap threshold */
11081109
uint16_t tap_thr : 5;
@@ -1121,7 +1122,8 @@ struct bmi160_acc_tap_int_cfg
11211122

11221123
/*! tap enable, 1 - enable, 0 - disable */
11231124
uint16_t tap_en : 1;
1124-
#elif BIG_ENDIAN == 1
1125+
#endif
1126+
#ifdef BIG_ENDIAN
11251127

11261128
/*! tap enable, 1 - enable, 0 - disable */
11271129
uint16_t tap_en : 1;
@@ -1144,7 +1146,7 @@ struct bmi160_acc_tap_int_cfg
11441146
};
11451147
struct bmi160_acc_any_mot_int_cfg
11461148
{
1147-
#if LITTLE_ENDIAN == 1
1149+
#ifdef LITTLE_ENDIAN
11481150

11491151
/*! 1 any-motion enable, 0 - any-motion disable */
11501152
uint8_t anymotion_en : 1;
@@ -1166,7 +1168,8 @@ struct bmi160_acc_any_mot_int_cfg
11661168

11671169
/*! slope threshold */
11681170
uint8_t anymotion_thr;
1169-
#elif BIG_ENDIAN == 1
1171+
#endif
1172+
#ifdef BIG_ENDIAN
11701173

11711174
/*! slope threshold */
11721175
uint8_t anymotion_thr;
@@ -1192,7 +1195,7 @@ struct bmi160_acc_any_mot_int_cfg
11921195
};
11931196
struct bmi160_acc_sig_mot_int_cfg
11941197
{
1195-
#if LITTLE_ENDIAN == 1
1198+
#ifdef LITTLE_ENDIAN
11961199

11971200
/*! skip time of sig-motion interrupt */
11981201
uint8_t sig_mot_skip : 2;
@@ -1208,7 +1211,8 @@ struct bmi160_acc_sig_mot_int_cfg
12081211

12091212
/*! sig-motion threshold */
12101213
uint8_t sig_mot_thres;
1211-
#elif BIG_ENDIAN == 1
1214+
#endif
1215+
#ifdef BIG_ENDIAN
12121216

12131217
/*! sig-motion threshold */
12141218
uint8_t sig_mot_thres;
@@ -1228,7 +1232,7 @@ struct bmi160_acc_sig_mot_int_cfg
12281232
};
12291233
struct bmi160_acc_step_detect_int_cfg
12301234
{
1231-
#if LITTLE_ENDIAN == 1
1235+
#ifdef LITTLE_ENDIAN
12321236

12331237
/*! 1- step detector enable, 0- step detector disable */
12341238
uint16_t step_detector_en : 1;
@@ -1244,7 +1248,8 @@ struct bmi160_acc_step_detect_int_cfg
12441248

12451249
/*! minimum step buffer size*/
12461250
uint16_t step_min_buf : 3;
1247-
#elif BIG_ENDIAN == 1
1251+
#endif
1252+
#ifdef BIG_ENDIAN
12481253

12491254
/*! minimum step buffer size*/
12501255
uint16_t step_min_buf : 3;
@@ -1264,7 +1269,7 @@ struct bmi160_acc_step_detect_int_cfg
12641269
};
12651270
struct bmi160_acc_no_motion_int_cfg
12661271
{
1267-
#if LITTLE_ENDIAN == 1
1272+
#ifdef LITTLE_ENDIAN
12681273

12691274
/*! no motion interrupt x */
12701275
uint16_t no_motion_x : 1;
@@ -1286,7 +1291,8 @@ struct bmi160_acc_no_motion_int_cfg
12861291

12871292
/*! no motion threshold */
12881293
uint8_t no_motion_thres;
1289-
#elif BIG_ENDIAN == 1
1294+
#endif
1295+
#ifdef BIG_ENDIAN
12901296

12911297
/*! no motion threshold */
12921298
uint8_t no_motion_thres;
@@ -1312,7 +1318,7 @@ struct bmi160_acc_no_motion_int_cfg
13121318
};
13131319
struct bmi160_acc_orient_int_cfg
13141320
{
1315-
#if LITTLE_ENDIAN == 1
1321+
#ifdef LITTLE_ENDIAN
13161322

13171323
/*! thresholds for switching between the different orientations */
13181324
uint16_t orient_mode : 2;
@@ -1334,7 +1340,8 @@ struct bmi160_acc_orient_int_cfg
13341340

13351341
/*! 1 - orient enable, 0 - orient disable */
13361342
uint8_t orient_en : 1;
1337-
#elif BIG_ENDIAN == 1
1343+
#endif
1344+
#ifdef BIG_ENDIAN
13381345

13391346
/*! 1 - orient enable, 0 - orient disable */
13401347
uint8_t orient_en : 1;
@@ -1360,7 +1367,7 @@ struct bmi160_acc_orient_int_cfg
13601367
};
13611368
struct bmi160_acc_flat_detect_int_cfg
13621369
{
1363-
#if LITTLE_ENDIAN == 1
1370+
#ifdef LITTLE_ENDIAN
13641371

13651372
/*! flat threshold */
13661373
uint16_t flat_theta : 6;
@@ -1374,7 +1381,8 @@ struct bmi160_acc_flat_detect_int_cfg
13741381

13751382
/*! 1 - flat enable, 0 - flat disable */
13761383
uint16_t flat_en : 1;
1377-
#elif BIG_ENDIAN == 1
1384+
#endif
1385+
#ifdef BIG_ENDIAN
13781386

13791387
/*! 1 - flat enable, 0 - flat disable */
13801388
uint16_t flat_en : 1;
@@ -1392,7 +1400,7 @@ struct bmi160_acc_flat_detect_int_cfg
13921400
};
13931401
struct bmi160_acc_low_g_int_cfg
13941402
{
1395-
#if LITTLE_ENDIAN == 1
1403+
#ifdef LITTLE_ENDIAN
13961404

13971405
/*! low-g interrupt trigger delay */
13981406
uint8_t low_dur;
@@ -1411,7 +1419,8 @@ struct bmi160_acc_low_g_int_cfg
14111419

14121420
/*! 1 - enable low-g, 0 - disable low-g */
14131421
uint8_t low_en : 1;
1414-
#elif BIG_ENDIAN == 1
1422+
#endif
1423+
#ifdef BIG_ENDIAN
14151424

14161425
/*! 1 - enable low-g, 0 - disable low-g */
14171426
uint8_t low_en : 1;
@@ -1434,7 +1443,7 @@ struct bmi160_acc_low_g_int_cfg
14341443
};
14351444
struct bmi160_acc_high_g_int_cfg
14361445
{
1437-
#if LITTLE_ENDIAN == 1
1446+
#ifdef LITTLE_ENDIAN
14381447

14391448
/*! High-g interrupt x, 1 - enable, 0 - disable */
14401449
uint8_t high_g_x : 1;
@@ -1456,7 +1465,8 @@ struct bmi160_acc_high_g_int_cfg
14561465

14571466
/*! High-g duration */
14581467
uint8_t high_dur;
1459-
#elif BIG_ENDIAN == 1
1468+
#endif
1469+
#ifdef BIG_ENDIAN
14601470

14611471
/*! High-g duration */
14621472
uint8_t high_dur;
@@ -1482,7 +1492,7 @@ struct bmi160_acc_high_g_int_cfg
14821492
};
14831493
struct bmi160_int_pin_settg
14841494
{
1485-
#if LITTLE_ENDIAN == 1
1495+
#ifdef LITTLE_ENDIAN
14861496

14871497
/*! To enable either INT1 or INT2 pin as output.
14881498
* 0- output disabled ,1- output enabled */
@@ -1504,7 +1514,8 @@ struct bmi160_int_pin_settg
15041514

15051515
/*! latch duration*/
15061516
uint16_t latch_dur : 4;
1507-
#elif BIG_ENDIAN == 1
1517+
#endif
1518+
#ifdef BIG_ENDIAN
15081519

15091520
/*! latch duration*/
15101521
uint16_t latch_dur : 4;

0 commit comments

Comments
 (0)