1
0
Fork 0

Tidy up duplication of MIN/MAX fallback implementations (#20236)

This commit is contained in:
Joel Challis 2023-03-23 05:30:30 +00:00 committed by GitHub
parent 42aa83787f
commit b01dc36fbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 32 deletions

View file

@ -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;