Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(i2c): prevent unused variable and functions#2253

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 1 commit intostm32duino:mainfromfpistm:i2C_timing
Jan 16, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletionslibraries/Wire/src/utility/twi.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,9 +57,13 @@ extern "C" {
#if !defined (STM32F1xx) && !defined (STM32F2xx) && !defined (STM32F4xx) &&\
!defined (STM32L1xx)
#define I2C_TIMING
#if !defined(I2C_TIMING_SM) || !defined(I2C_TIMING_FM) || !defined(I2C_TIMING_FMP)
#define I2C_TIMING_COMPUTE
#endif /* !(I2C_TIMING_SM) || !(I2C_TIMING_FM) || !(I2C_TIMING_FMP)*/

#endif

#ifdefI2C_TIMING
#ifdefI2C_TIMING_COMPUTE
#ifndef I2C_VALID_TIMING_NBR
#define I2C_VALID_TIMING_NBR 8U
#endif
Expand DownExpand Up@@ -152,7 +156,7 @@ static const I2C_Charac_t I2C_Charac[] = {
.dnf = I2C_DIGITAL_FILTER_COEF,
}
};
#endif /*I2C_TIMING */
#endif /*I2C_TIMING_COMPUTE */

/* Family specific description for I2C */
typedef enum {
Expand DownExpand Up@@ -180,7 +184,7 @@ typedef enum {
/* Private Variables */
static I2C_HandleTypeDef *i2c_handles[I2C_NUM];

#ifdefI2C_TIMING
#ifdefI2C_TIMING_COMPUTE
/**
* @brief This function return the I2C clock source frequency.
* @param i2c: I2C instance
Expand DownExpand Up@@ -565,7 +569,7 @@ static uint32_t i2c_computeTiming(uint32_t clkSrcFreq, uint32_t i2c_speed)
}
return ret;
}
#endif /*I2C_TIMING */
#endif /*I2C_TIMING_COMPUTE */

/**
* @brief Compute I2C timing according current I2C clock source and
Expand All@@ -587,6 +591,9 @@ static uint32_t i2c_getTiming(i2c_t *obj, uint32_t frequency)
i2c_speed = 1000000;
}
#ifdef I2C_TIMING
#ifndef I2C_TIMING_COMPUTE
UNUSED(obj);
#endif
if (i2c_speed != 0U) {
switch (i2c_speed) {
default:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp