Several small fixes for MPPT-2410-LC
- Battery temperature set to 25 degC if no external sensor connected - EEPROM selection added to PCB config file - UEXT power supply enable added to UEXT init functions Firmware still gets stuck when OLED display is enabled... Error still to be found!
This commit is contained in:
+3
-1
@@ -212,7 +212,9 @@ void detect_battery_temperature(charger_t *charger, float bat_temp)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
charger->bat_temperature = bat_temp;
|
||||
if (bat_temp > -50) {
|
||||
charger->bat_temperature = bat_temp;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -70,12 +70,12 @@ uint32_t _calc_crc(uint8_t *buf, size_t len)
|
||||
|
||||
#endif // UNIT_TEST
|
||||
|
||||
#if defined(PIN_EEPROM_SDA) && defined(PIN_EEPROM_SCL)
|
||||
#if defined(EEPROM_24AA01) || defined(EEPROM_24AA32)
|
||||
|
||||
#ifdef MPPT_2420_LC_0V10
|
||||
#ifdef EEPROM_24AA01
|
||||
#define EEPROM_PAGE_SIZE 8 // see datasheet of 24AA01
|
||||
#define EEPROM_ADDRESS_SIZE 1 // bytes
|
||||
#else
|
||||
#elif defined(EEPROM_24AA32)
|
||||
#define EEPROM_PAGE_SIZE 32 // see datasheet of 24AA32
|
||||
#define EEPROM_ADDRESS_SIZE 2 // bytes
|
||||
#endif
|
||||
@@ -243,7 +243,7 @@ void eeprom_restore_data()
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("EEPROM: Buffer too small or data layout version changed\n");
|
||||
printf("EEPROM: Empty or data layout version changed\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
#define PIN_EEPROM_SCL PB_10
|
||||
#define PIN_EEPROM_SDA PB_11
|
||||
|
||||
#define EEPROM_24AA32
|
||||
|
||||
enum pin_state_t { PIN_HIGH, PIN_LOW, PIN_FLOAT };
|
||||
|
||||
// assignment LED numbers on PCB to their meaning
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
#define PIN_EEPROM_SCL PB_10
|
||||
#define PIN_EEPROM_SDA PB_11
|
||||
|
||||
#define EEPROM_24AA32
|
||||
|
||||
enum pin_state_t { PIN_HIGH, PIN_LOW, PIN_FLOAT };
|
||||
|
||||
// assignment LED numbers on PCB to their meaning
|
||||
|
||||
+10
-3
@@ -63,7 +63,14 @@ const unsigned char bmp_disconnected [] = {
|
||||
I2C i2c(PIN_UEXT_SDA, PIN_UEXT_SCL);
|
||||
Adafruit_SSD1306_I2c oled(i2c, PIN_UEXT_SSEL, 0x78, 64, 128);
|
||||
|
||||
void uext_init() {;} // no need for initialization
|
||||
void uext_init()
|
||||
{
|
||||
#ifdef PIN_UEXT_DIS
|
||||
DigitalOut uext_dis(PIN_UEXT_DIS);
|
||||
uext_dis = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void uext_process_asap() {;}
|
||||
|
||||
void uext_process_1s()
|
||||
@@ -135,9 +142,9 @@ void uext_process_1s()
|
||||
|
||||
oled.setTextCursor(0, 56);
|
||||
#ifdef CHARGER_TYPE_PWM
|
||||
oled.printf("T %.0fC PWM %.0f%% SOC %d%%", dcdc.temp_mosfets, pwm_switch_get_duty_cycle() * 100.0, charger.soc);
|
||||
oled.printf("T %.0fC PWM %.0f%% SOC %d%%", charger.bat_temperature, pwm_switch_get_duty_cycle() * 100.0, charger.soc);
|
||||
#else
|
||||
oled.printf("T %.0fC PWM %.0f%% SOC %d%%", dcdc.temp_mosfets, half_bridge_get_duty_cycle() * 100.0, charger.soc);
|
||||
oled.printf("T %.0fC PWM %.0f%% SOC %d%%", charger.bat_temperature, half_bridge_get_duty_cycle() * 100.0, charger.soc);
|
||||
#endif
|
||||
|
||||
oled.display();
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
|
||||
void uext_init(void)
|
||||
{
|
||||
#ifdef PIN_UEXT_DIS
|
||||
DigitalOut uext_dis(PIN_UEXT_DIS);
|
||||
uext_dis = 0;
|
||||
#endif
|
||||
|
||||
// add you init functions here
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,14 @@ int wifi_reset(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
void uext_init(void) {;} // everything is handled in state machine in wifi_process()
|
||||
void uext_init()
|
||||
{
|
||||
#ifdef PIN_UEXT_DIS
|
||||
DigitalOut uext_dis(PIN_UEXT_DIS);
|
||||
uext_dis = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void uext_process_asap(void) {;}
|
||||
|
||||
void uext_process_1s()
|
||||
|
||||
Reference in New Issue
Block a user