Skip to content
Snippets Groups Projects
Commit bb0fad0e authored by Sonic Zhang's avatar Sonic Zhang Committed by Heiko Schocher
Browse files

blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024

parent 18948632
No related branches found
No related tags found
No related merge requests found
...@@ -274,7 +274,7 @@ unsigned int i2c_get_bus_speed(void) ...@@ -274,7 +274,7 @@ unsigned int i2c_get_bus_speed(void)
*/ */
void i2c_init(int speed, int slaveaddr) void i2c_init(int speed, int slaveaddr)
{ {
uint8_t prescale = ((get_sclk() / 1024 / 1024 + 5) / 10) & 0x7F; uint8_t prescale = ((get_sclk() / 1000 / 1000 + 5) / 10) & 0x7F;
/* Set TWI internal clock as 10MHz */ /* Set TWI internal clock as 10MHz */
twi->control = prescale; twi->control = prescale;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment