projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove from wizart i2c backend selection. Add deprecate switch to disable old i2c...
[bertos.git]
/
bertos
/
cpu
/
avr
/
drv
/
i2c_avr.c
diff --git
a/bertos/cpu/avr/drv/i2c_avr.c
b/bertos/cpu/avr/drv/i2c_avr.c
index 9a1bb14c892c5f8eacf9cfdd4da62cb35707c10d..8e56d13599d24764c57fdbd8984a4801cf78fd66 100644
(file)
--- a/
bertos/cpu/avr/drv/i2c_avr.c
+++ b/
bertos/cpu/avr/drv/i2c_avr.c
@@
-34,12
+34,14
@@
*
* \author Stefano Fedrigo <aleph@develer.com>
* \author Bernie Innocenti <bernie@codewiz.org>
*
* \author Stefano Fedrigo <aleph@develer.com>
* \author Bernie Innocenti <bernie@codewiz.org>
+ * \author Daniele Basile <asterix@develer.com>
*/
*/
-#include <hw/hw_cpufreq.h> /* CPU_FREQ */
#include "cfg/cfg_i2c.h"
#include "cfg/cfg_i2c.h"
+#include <hw/hw_cpufreq.h> /* CPU_FREQ */
+
#define LOG_LEVEL I2C_LOG_LEVEL
#define LOG_FORMAT I2C_LOG_FORMAT
#define LOG_LEVEL I2C_LOG_LEVEL
#define LOG_FORMAT I2C_LOG_FORMAT
@@
-58,6
+60,7
@@
#include <compat/twi.h>
#include <compat/twi.h>
+#if !CONFIG_I2C_DISABLE_OLD_API
/* Wait for TWINT flag set: bus is ready */
#define WAIT_TWI_READY do {} while (!(TWCR & BV(TWINT)))
/* Wait for TWINT flag set: bus is ready */
#define WAIT_TWI_READY do {} while (!(TWCR & BV(TWINT)))
@@
-253,11
+256,11
@@
void i2c_builtin_init(void)
MOD_INIT(i2c);
}
MOD_INIT(i2c);
}
+#endif /* !CONFIG_I2C_DISABLE_OLD_API */
+
/*
* New Api
*/
/*
* New Api
*/
-
-
struct I2cHardware
{
};
struct I2cHardware
{
};
@@
-451,6
+454,4
@@
void i2c_hw_init(I2c *i2c, int dev, uint32_t clock)
TWSR = 0;
TWCR = BV(TWEN);
);
TWSR = 0;
TWCR = BV(TWEN);
);
-
- MOD_INIT(i2c);
}
}