]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Removed prescaler define from avr i2c, as it was impossible to use (#6617)
authorMikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
Sat, 31 Aug 2019 00:47:11 +0000 (02:47 +0200)
committerDrashna Jaelre <drashna@live.com>
Sat, 31 Aug 2019 00:47:11 +0000 (17:47 -0700)
docs/i2c_driver.md
drivers/avr/i2c_master.c

index 317307e1bf1aa0e938dd4a44496b7c9dcbbc3ffc..856ca0a9b22b9ad235c4c438907c6e47ce2e7c9a 100644 (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.
 
index 52924437e020b940f8576a55ca7bf0af32e15617..c084d5754f39151eb6b168fbd27d15854823c04c 100644 (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 */