mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
overflow at 160MHz
This commit is contained in:
parent
3d0dafcbc0
commit
38b2bb7037
@ -72,7 +72,7 @@ void twi_stop(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void twi_delay(unsigned char v){
|
static void twi_delay(unsigned char v){
|
||||||
unsigned char i;
|
unsigned int i;
|
||||||
unsigned int reg;
|
unsigned int reg;
|
||||||
for(i=0;i<v;i++) reg = GPI;
|
for(i=0;i<v;i++) reg = GPI;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ static bool twi_write_start(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool twi_write_stop(void){
|
static bool twi_write_stop(void){
|
||||||
unsigned char i = 0;
|
unsigned int i = 0;
|
||||||
SCL_LOW();
|
SCL_LOW();
|
||||||
SDA_LOW();
|
SDA_LOW();
|
||||||
twi_delay(twi_dcount);
|
twi_delay(twi_dcount);
|
||||||
@ -102,7 +102,7 @@ static bool twi_write_stop(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool twi_write_bit(bool bit) {
|
static bool twi_write_bit(bool bit) {
|
||||||
unsigned char i = 0;
|
unsigned int i = 0;
|
||||||
SCL_LOW();
|
SCL_LOW();
|
||||||
if (bit) SDA_HIGH();
|
if (bit) SDA_HIGH();
|
||||||
else SDA_LOW();
|
else SDA_LOW();
|
||||||
@ -114,7 +114,7 @@ static bool twi_write_bit(bool bit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool twi_read_bit(void) {
|
static bool twi_read_bit(void) {
|
||||||
unsigned char i = 0;
|
unsigned int i = 0;
|
||||||
SCL_LOW();
|
SCL_LOW();
|
||||||
SDA_HIGH();
|
SDA_HIGH();
|
||||||
twi_delay(twi_dcount+1);
|
twi_delay(twi_dcount+1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user