From 17ba05606cc2327a13f62c09f92bcfef0cc18526 Mon Sep 17 00:00:00 2001 From: David Lehrian Date: Tue, 12 Oct 2021 11:52:12 -0700 Subject: [PATCH] Update ds18b20.h Added "extern C" to make the library compatible with C++. --- ds18b20.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ds18b20.h b/ds18b20.h index c2e8cf3..2939e12 100644 --- a/ds18b20.h +++ b/ds18b20.h @@ -39,6 +39,12 @@ static const uint8_t dscrc2x16_table[] = { 0x8C, 0x11, 0xAF, 0x32, 0xCA, 0x57, 0xE9, 0x74 }; +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + void ds18b20_init(int GPIO); #define ds18b20_send ds18b20_write @@ -70,4 +76,10 @@ float ds18b20_get_temp(void); void reset_search(); bool search(uint8_t *newAddr, bool search_mode); +/* *INDENT-OFF* */ +#ifdef __cplusplus + } +#endif +/* *INDENT-ON* */ + #endif