1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-21 11:54:15 +01:00

i2c: Change API to allow passing const config data

Mark the I2C_InitStruct parameter as const so that we can pass
const data as the initializer.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1240 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2010-08-08 04:14:58 +00:00 committed by stac
parent f66e2cbd86
commit b6c1f43145
2 changed files with 2 additions and 2 deletions

View File

@ -420,7 +420,7 @@ typedef struct
*/ */
void I2C_DeInit(I2C_TypeDef* I2Cx); void I2C_DeInit(I2C_TypeDef* I2Cx);
void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct); void I2C_Init(I2C_TypeDef* I2Cx, const I2C_InitTypeDef* I2C_InitStruct);
void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct); void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct);
void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState);
void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState);

View File

@ -187,7 +187,7 @@ void I2C_DeInit(I2C_TypeDef* I2Cx)
* contains the configuration information for the specified I2C peripheral. * contains the configuration information for the specified I2C peripheral.
* @retval None * @retval None
*/ */
void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct) void I2C_Init(I2C_TypeDef* I2Cx, const I2C_InitTypeDef* I2C_InitStruct)
{ {
uint16_t tmpreg = 0, freqrange = 0; uint16_t tmpreg = 0, freqrange = 0;
uint16_t result = 0x04; uint16_t result = 0x04;