Make variable definitions 'static const' when possible to save RAM usage. From Kosma Moczek
This commit is contained in:
parent
7780d1cd03
commit
fa29170aa7
@ -278,7 +278,7 @@ struct stm32_i2c_priv_s
|
|||||||
|
|
||||||
struct stm32_i2c_inst_s
|
struct stm32_i2c_inst_s
|
||||||
{
|
{
|
||||||
struct i2c_ops_s *ops; /* Standard I2C operations */
|
const struct i2c_ops_s *ops; /* Standard I2C operations */
|
||||||
struct stm32_i2c_priv_s *priv; /* Common driver private data structure */
|
struct stm32_i2c_priv_s *priv; /* Common driver private data structure */
|
||||||
|
|
||||||
uint32_t frequency; /* Frequency used in this instantiation */
|
uint32_t frequency; /* Frequency used in this instantiation */
|
||||||
@ -384,7 +384,7 @@ static const struct stm32_i2c_config_s stm32_i2c1_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c1_priv =
|
static struct stm32_i2c_priv_s stm32_i2c1_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c1_config,
|
.config = &stm32_i2c1_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -413,7 +413,7 @@ static const struct stm32_i2c_config_s stm32_i2c2_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c2_priv =
|
static struct stm32_i2c_priv_s stm32_i2c2_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c2_config,
|
.config = &stm32_i2c2_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -442,7 +442,7 @@ static const struct stm32_i2c_config_s stm32_i2c3_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c3_priv =
|
static struct stm32_i2c_priv_s stm32_i2c3_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c3_config,
|
.config = &stm32_i2c3_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -458,7 +458,7 @@ struct stm32_i2c_priv_s stm32_i2c3_priv =
|
|||||||
|
|
||||||
/* Device Structures, Instantiation */
|
/* Device Structures, Instantiation */
|
||||||
|
|
||||||
struct i2c_ops_s stm32_i2c_ops =
|
static const struct i2c_ops_s stm32_i2c_ops =
|
||||||
{
|
{
|
||||||
.setfrequency = stm32_i2c_setfrequency,
|
.setfrequency = stm32_i2c_setfrequency,
|
||||||
.setaddress = stm32_i2c_setaddress,
|
.setaddress = stm32_i2c_setaddress,
|
||||||
|
@ -306,7 +306,7 @@ struct stm32_i2c_priv_s
|
|||||||
|
|
||||||
struct stm32_i2c_inst_s
|
struct stm32_i2c_inst_s
|
||||||
{
|
{
|
||||||
struct i2c_ops_s *ops; /* Standard I2C operations */
|
const struct i2c_ops_s *ops; /* Standard I2C operations */
|
||||||
struct stm32_i2c_priv_s *priv; /* Common driver private data structure */
|
struct stm32_i2c_priv_s *priv; /* Common driver private data structure */
|
||||||
|
|
||||||
uint32_t frequency; /* Frequency used in this instantiation */
|
uint32_t frequency; /* Frequency used in this instantiation */
|
||||||
@ -412,7 +412,7 @@ static const struct stm32_i2c_config_s stm32_i2c1_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c1_priv =
|
static struct stm32_i2c_priv_s stm32_i2c1_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c1_config,
|
.config = &stm32_i2c1_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -441,7 +441,7 @@ static const struct stm32_i2c_config_s stm32_i2c2_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c2_priv =
|
static struct stm32_i2c_priv_s stm32_i2c2_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c2_config,
|
.config = &stm32_i2c2_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -470,7 +470,7 @@ static const struct stm32_i2c_config_s stm32_i2c3_config =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_i2c_priv_s stm32_i2c3_priv =
|
static struct stm32_i2c_priv_s stm32_i2c3_priv =
|
||||||
{
|
{
|
||||||
.config = &stm32_i2c3_config,
|
.config = &stm32_i2c3_config,
|
||||||
.refs = 0,
|
.refs = 0,
|
||||||
@ -486,7 +486,7 @@ struct stm32_i2c_priv_s stm32_i2c3_priv =
|
|||||||
|
|
||||||
/* Device Structures, Instantiation */
|
/* Device Structures, Instantiation */
|
||||||
|
|
||||||
struct i2c_ops_s stm32_i2c_ops =
|
static const struct i2c_ops_s stm32_i2c_ops =
|
||||||
{
|
{
|
||||||
.setfrequency = stm32_i2c_setfrequency,
|
.setfrequency = stm32_i2c_setfrequency,
|
||||||
.setaddress = stm32_i2c_setaddress,
|
.setaddress = stm32_i2c_setaddress,
|
||||||
|
@ -64,15 +64,15 @@
|
|||||||
* Public Variables
|
* Public Variables
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
uint16_t g_daysbeforemonth[13] =
|
|
||||||
{
|
|
||||||
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
|
|
||||||
};
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
static const uint16_t g_daysbeforemonth[13] =
|
||||||
|
{
|
||||||
|
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
|
||||||
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user