Tidy up duplication of MIN/MAX fallback implementations (#20236)
This commit is contained in:
		
							parent
							
								
									42aa83787f
								
							
						
					
					
						commit
						b01dc36fbf
					
				
					 8 changed files with 7 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue