From ea9463c3ba9335bc3d04dd04502ab9e67e8a718c Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 30 Oct 2022 20:33:41 +0100 Subject: finish merge --- shared/shared.mk | 1 - shared/util.c | 9 +++++++++ shared/util.h | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) delete mode 100644 shared/shared.mk (limited to 'shared') diff --git a/shared/shared.mk b/shared/shared.mk deleted file mode 100644 index f9586ff..0000000 --- a/shared/shared.mk +++ /dev/null @@ -1 +0,0 @@ -OBJS += $(patsubst %.c,%-stm.o, $(wildcard ../shared/*.c)) diff --git a/shared/util.c b/shared/util.c index 648631a..94f2273 100644 --- a/shared/util.c +++ b/shared/util.c @@ -6,6 +6,10 @@ unsigned int ws_log16(unsigned int x) { return l; } +#ifdef __cplusplus +extern "C" { +#endif + uint8_t ws_sensor_tmp_to_8(uint16_t temperature) { return temperature / 256; } @@ -29,3 +33,8 @@ float ws_sensor_hum_to_f(uint8_t humidity) { float ws_sensor_atm_to_f(uint8_t atmospheric_pressure) { return ((20.0 * atmospheric_pressure) / 256.0) + 990.0; // datasheet no? } + +#ifdef __cplusplus +} +#endif + diff --git a/shared/util.h b/shared/util.h index 1bee487..8cb54c1 100644 --- a/shared/util.h +++ b/shared/util.h @@ -8,6 +8,10 @@ /** @brief take the log base 16 of `x` */ unsigned int ws_log16(unsigned int x); +#ifdef __cplusplus +extern "C" { +#endif + /** @brief convert 16-bit temperature value to uint8_t */ uint8_t ws_sensor_tmp_to_8(uint16_t temperature); /** @brief convert 16-bit humidity value to uint8_t */ @@ -21,3 +25,8 @@ float ws_sensor_tmp_to_f(uint8_t temperature); float ws_sensor_hum_to_f(uint8_t humidity); /** @brief convert 8-bit atmospheric pressure value back to float */ float ws_sensor_atm_to_f(uint8_t atmospheric_pressure); + +#ifdef __cplusplus +} +#endif + -- cgit v1.2.3