diff options
author | Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com> | 2019-08-31 02:47:11 +0200 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-08-30 17:47:11 -0700 |
commit | edc8283572d4f7648146b05d49dc446e169d4534 (patch) | |
tree | e6b7385e1f662c7409df2524ba96c8e1e10416f6 | |
parent | b7ddf64b547f48f7fd47937a5b33561f0090cd7c (diff) | |
download | qmk_firmware-edc8283572d4f7648146b05d49dc446e169d4534.tar.gz qmk_firmware-edc8283572d4f7648146b05d49dc446e169d4534.zip |
Removed prescaler define from avr i2c, as it was impossible to use (#6617)
-rw-r--r-- | docs/i2c_driver.md | 1 | ||||
-rw-r--r-- | drivers/avr/i2c_master.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index 317307e1b..856ca0a9b 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md | |||
@@ -34,7 +34,6 @@ The following defines can be used to configure the I2C master driver. | |||
34 | |Variable |Description |Default| | 34 | |Variable |Description |Default| |
35 | |------------------|---------------------------------------------------|-------| | 35 | |------------------|---------------------------------------------------|-------| |
36 | |`F_SCL` |Clock frequency in Hz |400KHz | | 36 | |`F_SCL` |Clock frequency in Hz |400KHz | |
37 | |`Prescaler` |Divides master clock to aid in I2C clock selection |1 | | ||
38 | 37 | ||
39 | AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. | 38 | AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. |
40 | 39 | ||
diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index 52924437e..c084d5754 100644 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c | |||
@@ -27,8 +27,8 @@ | |||
27 | #ifndef F_SCL | 27 | #ifndef F_SCL |
28 | # define F_SCL 400000UL // SCL frequency | 28 | # define F_SCL 400000UL // SCL frequency |
29 | #endif | 29 | #endif |
30 | #define Prescaler 1 | 30 | |
31 | #define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16) / 2) | 31 | #define TWBR_val (((F_CPU / F_SCL) - 16) / 2) |
32 | 32 | ||
33 | void i2c_init(void) { | 33 | void i2c_init(void) { |
34 | TWSR = 0; /* no prescaler */ | 34 | TWSR = 0; /* no prescaler */ |