From c66919e36fd717d21aff52d7bc84df248bc61002 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 30 May 2015 15:10:56 +0300 Subject: [PATCH] add higher I2C freqs for 160MHz core clock --- .../esp8266/cores/esp8266/core_esp8266_si2c.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c index 1593bb8597..d825c4445b 100644 --- a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c +++ b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c @@ -47,14 +47,16 @@ void twi_setClock(unsigned int freq){ if(freq <= 100000) twi_dcount = 19;//about 100KHz else if(freq <= 200000) twi_dcount = 8;//about 200KHz else if(freq <= 300000) twi_dcount = 3;//about 300KHz - else if(freq <= 400000) twi_dcount = 1;//about 370KHz - else twi_dcount = 1;//about 450KHz + else if(freq <= 400000) twi_dcount = 1;//about 400KHz + else twi_dcount = 1;//about 400KHz #else if(freq <= 100000) twi_dcount = 32;//about 100KHz else if(freq <= 200000) twi_dcount = 14;//about 200KHz else if(freq <= 300000) twi_dcount = 8;//about 300KHz - else if(freq <= 400000) twi_dcount = 5;//about 370KHz - else twi_dcount = 2;//about 450KHz + else if(freq <= 400000) twi_dcount = 5;//about 400KHz + else if(freq <= 500000) twi_dcount = 3;//about 500KHz + else if(freq <= 600000) twi_dcount = 2;//about 600KHz + else twi_dcount = 1;//about 700KHz #endif }