Skip to content

Commit

Permalink
Fixed a typo in the Makefiles. Fixed a bug in the CPP guards.
Browse files Browse the repository at this point in the history
  • Loading branch information
kegov committed Apr 4, 2023
1 parent a6e5c77 commit 64710af
Show file tree
Hide file tree
Showing 32 changed files with 197 additions and 98 deletions.
2 changes: 2 additions & 0 deletions bhi3.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef __BHI3_H__
#define __BHI3_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */
Expand Down Expand Up @@ -321,6 +322,7 @@ int8_t bhi3_set_wrist_gesture_detect_config(const uint8_t *wgd_cnfg, struct bhy2
*/
int8_t bhi3_get_wrist_gesture_detect_config(uint8_t *wgd_cnfg, struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
2 changes: 2 additions & 0 deletions bhi3_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef __BHI3_DEFS_H__
#define __BHI3_DEFS_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */
Expand Down Expand Up @@ -180,6 +181,7 @@ static const char * const bhi3_phy_sensor_pwm_output[] = {
[NORMAL] = "NORMAL", [LOW_POWER] = "LOW POWER"
}; /*lint -e528 */

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 6 additions & 4 deletions bhi3_multi_tap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
#ifndef _BHY2_MULTI_TAP_H_
#define _BHY2_MULTI_TAP_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>
#include <stdlib.h>

#include "bhi3.h"
#include "bhi3_multi_tap_defs.h"

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

/*!
* @brief Parsing the fifo data to MULTI_TAP output structure format
*
Expand Down Expand Up @@ -102,6 +103,7 @@ int8_t bhi3_multi_tap_detector_set_config(const void *buffer, struct bhy2_dev *d
*/
int8_t bhi3_multi_tap_detector_get_config(const void *buffer, struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 10 additions & 0 deletions bhi3_multi_tap_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#ifndef _BHI3_MULTI_TAP_DEFS_H_
#define _BHI3_MULTI_TAP_DEFS_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <string.h>

Expand Down Expand Up @@ -176,4 +181,9 @@ static const char * const bhi3_multi_tap_string_out[] = {
[TRIPLE_DOUBLE_TAP] = "TRIPLE_DOUBLE_TAP", [TRIPLE_DOUBLE_SINGLE_TAP] = "TRIPLE_DOUBLE_SINGLE_TAP"
}; /*lint -e528 */

/* End of CPP guard */
#ifdef __cplusplus
}
#endif

#endif /* _BHI3_MULTI_TAP_DEFS_H_ */
2 changes: 2 additions & 0 deletions bhy2.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef __BHY2_H__
#define __BHY2_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */
Expand Down Expand Up @@ -655,6 +656,7 @@ int8_t bhy2_read_status(uint16_t *status_code,
uint32_t *actual_len,
struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 6 additions & 4 deletions bhy2_bsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
#ifndef _BHY2_BSEC_H_
#define _BHY2_BSEC_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>
#include <stdlib.h>
#include <stdlib.h>

#include "bhy2.h"

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#define BHY2_SENSOR_ID_AIR_QUALITY UINT8_C(115)

struct bhy2_bsec_air_quality
Expand All @@ -65,6 +66,7 @@ struct bhy2_bsec_air_quality

void bhy2_bsec_parse_air_quality(const uint8_t *payload, struct bhy2_bsec_air_quality *data);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
2 changes: 2 additions & 0 deletions bhy2_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef __BHY2_DEFS_H__
#define __BHY2_DEFS_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */
Expand Down Expand Up @@ -800,6 +801,7 @@ enum bhy2_data_inj_mode {

#define BHY2_BYTE_TO_NIBBLE(X) (((uint8_t)(X)[0] & 0x0F) | (((uint8_t)(X)[1] << 4) & 0xF0))

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
3 changes: 1 addition & 2 deletions bhy2_hif.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,9 @@ int8_t bhy2_hif_inject_data(const uint8_t *payload, uint32_t payload_len, struct
*/
int8_t bhy2_hif_wait_status_ready(struct bhy2_hif_dev *hif);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif

/* End of CPP guard */

#endif /* __BHY2_HIF_H__ */
10 changes: 6 additions & 4 deletions bhy2_klio.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
#ifndef __BHY2_KLIO_H__
#define __BHY2_KLIO_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>
#include <stdlib.h>

#include "bhy2.h"
#include "bhy2_klio_defs.h"

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

/*!
* @brief Reads and resets current driver status.
*
Expand Down Expand Up @@ -218,6 +219,7 @@ int8_t bhy2_klio_get_parameter(const bhy2_klio_parameter_t id,
uint16_t *size,
struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 10 additions & 0 deletions bhy2_klio_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#ifndef __BHY2_KLIO_DEFS_H__
#define __BHY2_KLIO_DEFS_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

#define BHY2_SENSOR_ID_KLIO UINT8_C(112)
Expand Down Expand Up @@ -336,4 +341,9 @@ typedef enum
KLIO_DRIVER_ERROR_OPERATION_PENDING = 8
} bhy2_klio_driver_error_state_t;

/* End of CPP guard */
#ifdef __cplusplus
}
#endif

#endif /* __BHY2_KLIO_DEFS_H__ */
2 changes: 2 additions & 0 deletions bhy2_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#ifndef __BHY2_PARSE_H__
#define __BHY2_PARSE_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */
Expand Down Expand Up @@ -93,6 +94,7 @@ void bhy2_parse_orientation(const uint8_t *data, struct bhy2_data_orientation *o
*/
void bhy2_parse_xyz(const uint8_t *data, struct bhy2_data_xyz *vector);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 6 additions & 4 deletions bhy2_pdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
#ifndef __BHY2_PDR_H__
#define __BHY2_PDR_H__

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>
#include <stdlib.h>

#include "bhy2.h"
#include "bhy2_pdr_defs.h"

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

void bhy2_pdr_parse_frame(const uint8_t *data, struct bhy2_pdr_frame *pdr_frame);

int8_t bhy2_pdr_reset_full(struct bhy2_dev *dev);
Expand All @@ -69,6 +70,7 @@ int8_t bhy2_pdr_get_pdr_variant(uint8_t *variant, struct bhy2_dev *dev);

int8_t bhy2_pdr_get_device_position(uint8_t *dev_pos, struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
6 changes: 4 additions & 2 deletions bhy2_pdr_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
#ifndef __BHY2_PDR_DEFS_H__
#define __BHY2_PDR_DEFS_H__

#include <stdint.h>

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>

#define BHY2_SENSOR_ID_PDR UINT8_C(113)
#define BHY2_SENSOR_ID_PDR_LOG UINT8_C(119)

Expand Down Expand Up @@ -99,6 +100,7 @@ typedef struct
float gyro[3];
} BHY2_PACKED bhy2_pdr_log_frame_t;

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 6 additions & 4 deletions bhy2_swim.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
#ifndef _BHY2_SWIM_H_
#define _BHY2_SWIM_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

#include <stdint.h>
#include <stdlib.h>

#include "bhy2.h"
#include "bhy2_swim_defs.h"

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus */

/*!
* @brief Parsing the fifo data to SWIM output structure format
*
Expand Down Expand Up @@ -92,6 +93,7 @@ int8_t bhy2_swim_get_version(bhy2_swim_version_t *buffer, struct bhy2_dev *dev);
*/
int8_t bhy2_swim_set_config(const void *buffer, struct bhy2_dev *dev);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif /*__cplusplus */
Expand Down
10 changes: 10 additions & 0 deletions bhy2_swim_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#ifndef _BHY2_SWIM_DEFS_H_
#define _BHY2_SWIM_DEFS_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

/*! Sensor ID for Swim */
Expand Down Expand Up @@ -113,4 +118,9 @@ typedef struct bhy2_swim_version
typedef void (*bhy2_swim_algo_callback)(uint32_t seconds, uint32_t nanoseconds,
const struct bhy2_swim_data_parse *callback_info);

/* End of CPP guard */
#ifdef __cplusplus
}
#endif

#endif /* _BHY2_SWIM_DEFS_H_ */
25 changes: 14 additions & 11 deletions examples/bhy2cli_ble/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ COINES_BACKEND ?= COINES_BRIDGE

API_LOCATION ?= ../..

FW_LOCATION ?= ../..

COMMON_LOCATION ?= ..

C_SRCS += \
Expand All @@ -20,20 +22,21 @@ bhy2cli_callbacks.c \
common_callbacks.c \
verbose.c \
$(COMMON_LOCATION)/common/common.c \
$(API_LOCATION)/source/bhy2.c \
$(API_LOCATION)/source/bhy2_hif.c \
$(API_LOCATION)/source/bhy2_parse.c \
$(API_LOCATION)/source/bhy2_klio.c \
$(API_LOCATION)/source/bhy2_pdr.c \
$(API_LOCATION)/source/bhy2_swim.c \
$(API_LOCATION)/source/bhy2_bsec.c \
$(API_LOCATION)/source/bhi3.c \
$(API_LOCATION)/source/bhi3_multi_tap.c
$(API_LOCATION)/bhy2.c \
$(API_LOCATION)/bhy2_hif.c \
$(API_LOCATION)/bhy2_parse.c \
$(API_LOCATION)/bhy2_klio.c \
$(API_LOCATION)/bhy2_pdr.c \
$(API_LOCATION)/bhy2_swim.c \
$(API_LOCATION)/bhy2_bsec.c \
$(API_LOCATION)/bhi3.c \
$(API_LOCATION)/bhi3_multi_tap.c \
$(API_LOCATION)/bhy2_head_tracker.c

INCLUDEPATHS += . \
$(COMMON_LOCATION)/common \
$(API_LOCATION)/source \
$(API_LOCATION)/firmware
$(API_LOCATION) \
$(FW_LOCATION)/firmware

# By default, the sensor is connected over SPI. Define this to change to I2C
ifeq ($(BHY2_INTF), I2C)
Expand Down
10 changes: 5 additions & 5 deletions examples/bhy2cli_ble/bhy2cli_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
#ifndef _BHY2CLI_CALLBACKS_H_
#define _BHY2CLI_CALLBACKS_H_

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

#include "cli.h"
Expand All @@ -52,11 +57,6 @@
#include "bhi3_multi_tap.h"
#include "parse.h"

/* Start of CPP guard */
#ifdef __cplusplus
extern "C" {
#endif

struct bhy2_cli_ref
{
struct bhy2_dev bhy2;
Expand Down
Loading

0 comments on commit 64710af

Please sign in to comment.