summaryrefslogtreecommitdiffstats
path: root/platforms
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-03-23 05:30:30 +0000
committerGitHub <noreply@github.com>2023-03-23 05:30:30 +0000
commitb01dc36fbf09c3ebf8efe1bac54205ace1b1c6cc (patch)
treedacbffac9d1918eb8962f631517cfec544adb965 /platforms
parent42aa83787fd0d3a5acd0ac7fbe7d148648be742d (diff)
Tidy up duplication of MIN/MAX fallback implementations (#20236)
Diffstat (limited to 'platforms')
-rw-r--r--platforms/arm_atsam/eeprom_samd.c5
-rw-r--r--platforms/avr/drivers/i2c_master.c3
2 files changed, 2 insertions, 6 deletions
diff --git a/platforms/arm_atsam/eeprom_samd.c b/platforms/arm_atsam/eeprom_samd.c
index 1c1e031e5d..9c42041f2d 100644
--- a/platforms/arm_atsam/eeprom_samd.c
+++ b/platforms/arm_atsam/eeprom_samd.c
@@ -15,15 +15,12 @@
*/
#include "eeprom.h"
#include "debug.h"
+#include "util.h"
#include "samd51j18a.h"
#include "core_cm4.h"
#include "component/nvmctrl.h"
#include "eeprom_samd.h"
-#ifndef MAX
-# define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
-#endif
-
#ifndef BUSY_RETRIES
# define BUSY_RETRIES 10000
#endif
diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c
index 524494c99d..58939f3e00 100644
--- a/platforms/avr/drivers/i2c_master.c
+++ b/platforms/avr/drivers/i2c_master.c
@@ -23,6 +23,7 @@
#include "i2c_master.h"
#include "timer.h"
#include "wait.h"
+#include "util.h"
#ifndef F_SCL
# define F_SCL 400000UL // SCL frequency
@@ -37,8 +38,6 @@
#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
-#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
-
void i2c_init(void) {
TWSR = 0; /* no prescaler */
TWBR = (uint8_t)TWBR_val;