Skip to content

Commit 6c02e80

Browse files
MJAS1kartben
authored andcommitted
drivers: haptics: Fix drv2605 C++ compatibility
Add `extern "C"` guard around the function declarations in drv2605.h. Without this guard, compiling code with a C++ compiler fails due to name mangling issues. Signed-off-by: Manu Sutela <manu.sutela@gmail.com>
1 parent d34d554 commit 6c02e80

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/zephyr/drivers/haptics/drv2605.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include <zephyr/drivers/haptics.h>
1010
#include <zephyr/types.h>
1111

12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
1216
#define DRV2605_WAVEFORM_SEQUENCER_MAX 8
1317

1418
enum drv2605_library {
@@ -83,4 +87,8 @@ union drv2605_config_data {
8387
int drv2605_haptic_config(const struct device *dev, enum drv2605_haptics_source source,
8488
const union drv2605_config_data *config_data);
8589

90+
#ifdef __cplusplus
91+
}
92+
#endif /* __cplusplus */
93+
8694
#endif

0 commit comments

Comments
 (0)