Преглед на файлове

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

Mikkel Jeppesen преди 5 години
родител
ревизия
edc8283572
променени са 2 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 0 1
      docs/i2c_driver.md
  2. 2 2
      drivers/avr/i2c_master.c

+ 0 - 1
docs/i2c_driver.md

@@ -34,7 +34,6 @@ The following defines can be used to configure the I2C master driver.
 |Variable          |Description                                        |Default|
 |Variable          |Description                                        |Default|
 |------------------|---------------------------------------------------|-------|
 |------------------|---------------------------------------------------|-------|
 |`F_SCL`           |Clock frequency in Hz                              |400KHz |
 |`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.
 AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required.
 
 

+ 2 - 2
drivers/avr/i2c_master.c

@@ -27,8 +27,8 @@
 #ifndef F_SCL
 #ifndef F_SCL
 #    define F_SCL 400000UL  // SCL frequency
 #    define F_SCL 400000UL  // SCL frequency
 #endif
 #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) {
 void i2c_init(void) {
     TWSR = 0; /* no prescaler */
     TWSR = 0; /* no prescaler */