diff --git a/main/TPS546.c b/main/TPS546.c index b8fc541a..a112b025 100644 --- a/main/TPS546.c +++ b/main/TPS546.c @@ -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]; @@ -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); @@ -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); @@ -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); @@ -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) */ @@ -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) */ @@ -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) */ @@ -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"); @@ -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 */ @@ -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---------------------"); diff --git a/sdkconfig.defaults b/sdkconfig.defaults index bff16075..6b6be2ad 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -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 \ No newline at end of file