Removed prescaler define from avr i2c, as it was impossible to use (#6617)

This commit is contained in:
Mikkel Jeppesen authored and Drashna Jaelre committed 2019-08-30 17:47:11 -07:00
1 parent b7ddf64b54
commit edc8283572
2 files changed
+2 -3

No files matched your search

-1
View File
@@ -34,7 +34,6 @@ The following defines can be used to configure the I2C master driver.
|Variable |Description |Default|
|------------------|---------------------------------------------------|-------|
|`F_SCL` |Clock frequency in Hz |400KHz |
|`Prescaler` |Divides master clock to aid in I2C clock selection |1 |
AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required.
+2 -2
View File
@@ -27,8 +27,8 @@
#ifndef F_SCL
# define F_SCL 400000UL // SCL frequency
#endif
#define Prescaler 1
#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16) / 2)
#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
void i2c_init(void) {
TWSR = 0; /* no prescaler */