From 347dfd60a47beefb6dc88e760f2cfd9f05d4b19c Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Fri, 22 Oct 2021 16:05:43 +0200 Subject: [PATCH 1/2] Fix missing definition for min() and max() on esp32 --- src/util/inv_mpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util/inv_mpu.c b/src/util/inv_mpu.c index 0410390..5e3ee55 100644 --- a/src/util/inv_mpu.c +++ b/src/util/inv_mpu.c @@ -1,4 +1,4 @@ -/* +* $License: Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. See included License.txt for License information. @@ -94,6 +94,14 @@ static inline int reg_int_cb(struct int_param_s *int_param) //static int set_int_enable(unsigned char enable); +// cf. https://github.com/NicHub/mpu9250-esp32 +#ifndef min +#define min(X,Y) (((X) < (Y)) ? (X) : (Y)) +#endif +#ifndef max +#define max(X,Y) (((X) > (Y)) ? (X) : (Y)) +#endif + /* Hardware registers needed by driver. */ struct gyro_reg_s { unsigned char who_am_i; From f791c7cb68164b08143700a169d745426159a3e3 Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Sat, 30 Oct 2021 20:31:24 +0200 Subject: [PATCH 2/2] Typo :-/ --- src/util/inv_mpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/inv_mpu.c b/src/util/inv_mpu.c index 5e3ee55..b6f25ee 100644 --- a/src/util/inv_mpu.c +++ b/src/util/inv_mpu.c @@ -1,4 +1,4 @@ -* +/* $License: Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. See included License.txt for License information.