From 04536a35644ede8bf0585557d4c582d9944adc06 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 22 Apr 2019 19:31:22 +0200 Subject: [PATCH] translation --- common/i2c.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/i2c.c b/common/i2c.c index 4ff9ecf14..5094b450a 100644 --- a/common/i2c.c +++ b/common/i2c.c @@ -26,7 +26,8 @@ volatile unsigned long c; -// 直接使用循环来延时,一个循环 6 条指令,48M, Delay=1 大概为 200kbps +// Direct use the loop to delay. 6 instructions loop, Masterclock 48Mhz, +// delay=1 is about 200kbps // timer. // I2CSpinDelayClk(4) = 12.31us // I2CSpinDelayClk(1) = 3.07us @@ -89,11 +90,9 @@ void I2C_init(void) { AT91C_BASE_PIOA->PIO_OER |= (GPIO_SCL | GPIO_SDA | GPIO_RST); AT91C_BASE_PIOA->PIO_PER |= (GPIO_SCL | GPIO_SDA | GPIO_RST); - bool isok = (SCL_read && SDA_read); if (!isok) I2C_recovery(); - } // set the reset state