Skip to content

Avoid I2C timing computation when input clock is unchanged #646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 12, 2019

Conversation

ABOSTM
Copy link
Contributor

@ABOSTM ABOSTM commented Sep 11, 2019

Summary

With U8g2 library, I2C clock is set for each transmission.
With some I2C harwdware version,
timings are then computed for each time.
This cause very slow display on LCD.

This PR saves computed I2C timing and reuses those timing if I2C input clock is the same.

This Fixes issue found by @jmchiappa in PR #590

@fpistm fpistm added the enhancement New feature or request label Sep 11, 2019
@fpistm fpistm added this to the 1.7.0 milestone Sep 11, 2019
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes else LGTM.

  • one astyle issue:
-  if ((I2C_ClockTiming[i2c_speed].input_clock == clkSrcFreq) &&(I2C_ClockTiming[i2c_speed].timing != 0U)) {

+  if ((I2C_ClockTiming[i2c_speed].input_clock == clkSrcFreq) && (I2C_ClockTiming[i2c_speed].timing != 0U)) {

@ABOSTM ABOSTM force-pushed the AVOID_I2C_TIMING_COMPUTATION branch from 60f7d05 to 30bc2fc Compare September 12, 2019 09:29
With U8g2 library, I2C clock is set for each transmission.
With some I2C harwdware version,
timings are then computed for each time.
This cause very slow display on LCD.
@ABOSTM ABOSTM force-pushed the AVOID_I2C_TIMING_COMPUTATION branch from 30bc2fc to 8087d8d Compare September 12, 2019 09:33
Co-Authored-By: Frederic Pillon <[email protected]>
ABOSTM and others added 3 commits September 12, 2019 14:37
Co-Authored-By: Frederic Pillon <[email protected]>
Co-Authored-By: Frederic Pillon <[email protected]>
Co-Authored-By: Frederic Pillon <[email protected]>
@fpistm fpistm merged commit caa48d2 into stm32duino:master Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants