@@ -760,7 +760,7 @@ enum bmi160_int_status_sel {
760
760
*/
761
761
struct bmi160_int_status_bits
762
762
{
763
- #if LITTLE_ENDIAN == 1
763
+ #ifdef LITTLE_ENDIAN
764
764
uint32_t step : 1 ;
765
765
uint32_t sigmot : 1 ;
766
766
uint32_t anym : 1 ;
@@ -793,7 +793,8 @@ struct bmi160_int_status_bits
793
793
uint32_t orient_1_0 : 2 ;
794
794
uint32_t orient_2 : 1 ;
795
795
uint32_t flat : 1 ;
796
- #elif BIG_ENDIAN == 1
796
+ #endif
797
+ #ifdef BIG_ENDIAN
797
798
uint32_t high_first_x : 1 ;
798
799
uint32_t high_first_y : 1 ;
799
800
uint32_t high_first_z : 1 ;
@@ -1102,7 +1103,7 @@ enum bmi160_any_sig_motion_active_interrupt_state {
1102
1103
};
1103
1104
struct bmi160_acc_tap_int_cfg
1104
1105
{
1105
- #if LITTLE_ENDIAN == 1
1106
+ #ifdef LITTLE_ENDIAN
1106
1107
1107
1108
/*! tap threshold */
1108
1109
uint16_t tap_thr : 5 ;
@@ -1121,7 +1122,8 @@ struct bmi160_acc_tap_int_cfg
1121
1122
1122
1123
/*! tap enable, 1 - enable, 0 - disable */
1123
1124
uint16_t tap_en : 1 ;
1124
- #elif BIG_ENDIAN == 1
1125
+ #endif
1126
+ #ifdef BIG_ENDIAN
1125
1127
1126
1128
/*! tap enable, 1 - enable, 0 - disable */
1127
1129
uint16_t tap_en : 1 ;
@@ -1144,7 +1146,7 @@ struct bmi160_acc_tap_int_cfg
1144
1146
};
1145
1147
struct bmi160_acc_any_mot_int_cfg
1146
1148
{
1147
- #if LITTLE_ENDIAN == 1
1149
+ #ifdef LITTLE_ENDIAN
1148
1150
1149
1151
/*! 1 any-motion enable, 0 - any-motion disable */
1150
1152
uint8_t anymotion_en : 1 ;
@@ -1166,7 +1168,8 @@ struct bmi160_acc_any_mot_int_cfg
1166
1168
1167
1169
/*! slope threshold */
1168
1170
uint8_t anymotion_thr ;
1169
- #elif BIG_ENDIAN == 1
1171
+ #endif
1172
+ #ifdef BIG_ENDIAN
1170
1173
1171
1174
/*! slope threshold */
1172
1175
uint8_t anymotion_thr ;
@@ -1192,7 +1195,7 @@ struct bmi160_acc_any_mot_int_cfg
1192
1195
};
1193
1196
struct bmi160_acc_sig_mot_int_cfg
1194
1197
{
1195
- #if LITTLE_ENDIAN == 1
1198
+ #ifdef LITTLE_ENDIAN
1196
1199
1197
1200
/*! skip time of sig-motion interrupt */
1198
1201
uint8_t sig_mot_skip : 2 ;
@@ -1208,7 +1211,8 @@ struct bmi160_acc_sig_mot_int_cfg
1208
1211
1209
1212
/*! sig-motion threshold */
1210
1213
uint8_t sig_mot_thres ;
1211
- #elif BIG_ENDIAN == 1
1214
+ #endif
1215
+ #ifdef BIG_ENDIAN
1212
1216
1213
1217
/*! sig-motion threshold */
1214
1218
uint8_t sig_mot_thres ;
@@ -1228,7 +1232,7 @@ struct bmi160_acc_sig_mot_int_cfg
1228
1232
};
1229
1233
struct bmi160_acc_step_detect_int_cfg
1230
1234
{
1231
- #if LITTLE_ENDIAN == 1
1235
+ #ifdef LITTLE_ENDIAN
1232
1236
1233
1237
/*! 1- step detector enable, 0- step detector disable */
1234
1238
uint16_t step_detector_en : 1 ;
@@ -1244,7 +1248,8 @@ struct bmi160_acc_step_detect_int_cfg
1244
1248
1245
1249
/*! minimum step buffer size*/
1246
1250
uint16_t step_min_buf : 3 ;
1247
- #elif BIG_ENDIAN == 1
1251
+ #endif
1252
+ #ifdef BIG_ENDIAN
1248
1253
1249
1254
/*! minimum step buffer size*/
1250
1255
uint16_t step_min_buf : 3 ;
@@ -1264,7 +1269,7 @@ struct bmi160_acc_step_detect_int_cfg
1264
1269
};
1265
1270
struct bmi160_acc_no_motion_int_cfg
1266
1271
{
1267
- #if LITTLE_ENDIAN == 1
1272
+ #ifdef LITTLE_ENDIAN
1268
1273
1269
1274
/*! no motion interrupt x */
1270
1275
uint16_t no_motion_x : 1 ;
@@ -1286,7 +1291,8 @@ struct bmi160_acc_no_motion_int_cfg
1286
1291
1287
1292
/*! no motion threshold */
1288
1293
uint8_t no_motion_thres ;
1289
- #elif BIG_ENDIAN == 1
1294
+ #endif
1295
+ #ifdef BIG_ENDIAN
1290
1296
1291
1297
/*! no motion threshold */
1292
1298
uint8_t no_motion_thres ;
@@ -1312,7 +1318,7 @@ struct bmi160_acc_no_motion_int_cfg
1312
1318
};
1313
1319
struct bmi160_acc_orient_int_cfg
1314
1320
{
1315
- #if LITTLE_ENDIAN == 1
1321
+ #ifdef LITTLE_ENDIAN
1316
1322
1317
1323
/*! thresholds for switching between the different orientations */
1318
1324
uint16_t orient_mode : 2 ;
@@ -1334,7 +1340,8 @@ struct bmi160_acc_orient_int_cfg
1334
1340
1335
1341
/*! 1 - orient enable, 0 - orient disable */
1336
1342
uint8_t orient_en : 1 ;
1337
- #elif BIG_ENDIAN == 1
1343
+ #endif
1344
+ #ifdef BIG_ENDIAN
1338
1345
1339
1346
/*! 1 - orient enable, 0 - orient disable */
1340
1347
uint8_t orient_en : 1 ;
@@ -1360,7 +1367,7 @@ struct bmi160_acc_orient_int_cfg
1360
1367
};
1361
1368
struct bmi160_acc_flat_detect_int_cfg
1362
1369
{
1363
- #if LITTLE_ENDIAN == 1
1370
+ #ifdef LITTLE_ENDIAN
1364
1371
1365
1372
/*! flat threshold */
1366
1373
uint16_t flat_theta : 6 ;
@@ -1374,7 +1381,8 @@ struct bmi160_acc_flat_detect_int_cfg
1374
1381
1375
1382
/*! 1 - flat enable, 0 - flat disable */
1376
1383
uint16_t flat_en : 1 ;
1377
- #elif BIG_ENDIAN == 1
1384
+ #endif
1385
+ #ifdef BIG_ENDIAN
1378
1386
1379
1387
/*! 1 - flat enable, 0 - flat disable */
1380
1388
uint16_t flat_en : 1 ;
@@ -1392,7 +1400,7 @@ struct bmi160_acc_flat_detect_int_cfg
1392
1400
};
1393
1401
struct bmi160_acc_low_g_int_cfg
1394
1402
{
1395
- #if LITTLE_ENDIAN == 1
1403
+ #ifdef LITTLE_ENDIAN
1396
1404
1397
1405
/*! low-g interrupt trigger delay */
1398
1406
uint8_t low_dur ;
@@ -1411,7 +1419,8 @@ struct bmi160_acc_low_g_int_cfg
1411
1419
1412
1420
/*! 1 - enable low-g, 0 - disable low-g */
1413
1421
uint8_t low_en : 1 ;
1414
- #elif BIG_ENDIAN == 1
1422
+ #endif
1423
+ #ifdef BIG_ENDIAN
1415
1424
1416
1425
/*! 1 - enable low-g, 0 - disable low-g */
1417
1426
uint8_t low_en : 1 ;
@@ -1434,7 +1443,7 @@ struct bmi160_acc_low_g_int_cfg
1434
1443
};
1435
1444
struct bmi160_acc_high_g_int_cfg
1436
1445
{
1437
- #if LITTLE_ENDIAN == 1
1446
+ #ifdef LITTLE_ENDIAN
1438
1447
1439
1448
/*! High-g interrupt x, 1 - enable, 0 - disable */
1440
1449
uint8_t high_g_x : 1 ;
@@ -1456,7 +1465,8 @@ struct bmi160_acc_high_g_int_cfg
1456
1465
1457
1466
/*! High-g duration */
1458
1467
uint8_t high_dur ;
1459
- #elif BIG_ENDIAN == 1
1468
+ #endif
1469
+ #ifdef BIG_ENDIAN
1460
1470
1461
1471
/*! High-g duration */
1462
1472
uint8_t high_dur ;
@@ -1482,7 +1492,7 @@ struct bmi160_acc_high_g_int_cfg
1482
1492
};
1483
1493
struct bmi160_int_pin_settg
1484
1494
{
1485
- #if LITTLE_ENDIAN == 1
1495
+ #ifdef LITTLE_ENDIAN
1486
1496
1487
1497
/*! To enable either INT1 or INT2 pin as output.
1488
1498
* 0- output disabled ,1- output enabled */
@@ -1504,7 +1514,8 @@ struct bmi160_int_pin_settg
1504
1514
1505
1515
/*! latch duration*/
1506
1516
uint16_t latch_dur : 4 ;
1507
- #elif BIG_ENDIAN == 1
1517
+ #endif
1518
+ #ifdef BIG_ENDIAN
1508
1519
1509
1520
/*! latch duration*/
1510
1521
uint16_t latch_dur : 4 ;
0 commit comments