Skip to content
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

Optimize compiler for performance #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
24 changes: 12 additions & 12 deletions main/TPS546.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ static uint16_t float_2_ulinear16(float value)
int TPS546_init(void)
{
uint8_t data[7];
uint8_t u8_value;
uint16_t u16_value;
uint8_t u8_value = 0;
uint16_t u16_value = 0;
uint8_t read_mfr_revision[4];
int temp;
uint8_t comp_config[5];
Expand Down Expand Up @@ -569,7 +569,7 @@ void TPS546_write_entire_config(void)

int TPS546_get_frequency(void)
{
uint16_t value;
uint16_t value = 0;
int freq;

smb_read_word(PMBUS_FREQUENCY_SWITCH, &value);
Expand All @@ -580,7 +580,7 @@ int TPS546_get_frequency(void)

void TPS546_set_frequency(int newfreq)
{
uint16_t value;
uint16_t value = 0;
//int freq;

ESP_LOGI(TAG, "Writing new frequency: %d", newfreq);
Expand All @@ -595,7 +595,7 @@ void TPS546_set_frequency(int newfreq)

int TPS546_get_temperature(void)
{
uint16_t value;
uint16_t value = 0;
int temp;

smb_read_word(PMBUS_READ_TEMPERATURE_1, &value);
Expand All @@ -605,7 +605,7 @@ int TPS546_get_temperature(void)

float TPS546_get_vin(void)
{
uint16_t u16_value;
uint16_t u16_value = 0;
float vin;

/* Get voltage input (ULINEAR16) */
Expand All @@ -623,7 +623,7 @@ float TPS546_get_vin(void)

float TPS546_get_iout(void)
{
uint16_t u16_value;
uint16_t u16_value = 0;
float iout;

/* Get current output (SLINEAR11) */
Expand All @@ -643,7 +643,7 @@ float TPS546_get_iout(void)

float TPS546_get_vout(void)
{
uint16_t u16_value;
uint16_t u16_value = 0;
float vout;

/* Get voltage output (ULINEAR16) */
Expand All @@ -660,8 +660,8 @@ float TPS546_get_vout(void)
}

void TPS546_print_status(void) {
uint16_t u16_value;
uint8_t u8_value;
uint16_t u16_value = 0;
uint8_t u8_value = 0;

if (smb_read_word(PMBUS_STATUS_WORD, &u16_value) != ESP_OK) {
ESP_LOGE(TAG, "Could not read STATUS_WORD");
Expand Down Expand Up @@ -692,7 +692,7 @@ void TPS546_print_status(void) {
**/
void TPS546_set_vout(float volts)
{
uint16_t value;
uint16_t value = 0;

if (volts == 0) {
/* turn off output */
Expand Down Expand Up @@ -722,7 +722,7 @@ void TPS546_set_vout(float volts)

void TPS546_show_voltage_settings(void)
{
uint16_t u16_value;
uint16_t u16_value = 0;
float f_value;

ESP_LOGI(TAG, "-----------VOLTAGE---------------------");
Expand Down
2 changes: 2 additions & 0 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_LOG_COLORS=y
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
Loading