Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up duplication of MIN/MAX fallback implementations #20236

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
More
  • Loading branch information
zvecr committed Mar 23, 2023
commit aee12e27e3b050110d6b7be391756888ecf5f378
5 changes: 1 addition & 4 deletions platforms/arm_atsam/eeprom_samd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions platforms/avr/drivers/i2c_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down