The 'check.bat' file is introduced to support continuous integration test locally in windows environment. The batch file may be run from Windows command prompt.
Hardware features like PWM switch, DC/DC converter and LED config
are now configured in the board definition. Actual source files still
need to be changed to use defines with CONFIG_ prefix instead of
defines from pcb.h.
- Made Adafruit GFX library independent of mbed Stream class
- Major cleanup/rewrite of SSD1306 specific class
- Dynamically allocated std::vector display buffer replaced with statically
allocated std::array (leads to more calculated RAM usage only because
previous heap usage is not considered in memory summary)
- Commands for brightness control and to prevent shifted display now
integrated in SSD1306 class
Rationale: Many editors (inclding mine) are set to automatically remove
trailing whitespaces. Updating files with trailing spaces creates distracting
additional lines in diffs.
- Alerts now set to +-20% of actual measured voltage
- Hysteresis for load overvoltage reconnect setpoint made configurable
- Added check for PWM switch MOSFET driver undervoltage
- State machine and control merged to one function
- Load states marked as deprecated, global error flags used instead
- Reduced duplicated code and made load control function easier to read
The bat config calculation did calculate the absolute max voltage
too high, it was doing an unnecessary multiplication.
This triggered an issue in the voltage limit set code, which did not
handle the overflow of the 16bit limit value properly.
Both are fixed now. We limit the limit value to what the ADC is able
to deliver, so that we detect overvoltage for sure, even if the setting
is out of ADC range.
We should use src_voltage_stop as limit,
since the input voltage start limit is basically an OC voltage
where as the stop voltage is a voltage to be measured under load.
- replaced the lengthy adc value formulas with respective functions
to ease reading
- removed unecessary casts for alert callbacks
- added static to the internal global variables in order to hide them from the
other compilation units
- OLED brightness can be set to extend life
- OLED display correctly initialized at MCU restart even without power off
Sometimes the OLED display displays all content shifted if the MCU is
reset without cutting the power to the display (i.e. without display reset).
- SOC is display in battery symbol showing 0 to 5 bars
- Internal temperature is displayed if no external sensor is detected (t)
- PWM value displays as "OFF" if the PWM/halfbridge is not active
Previously, the alert was sometimes erroneously triggered in PWM charger
absorption phase (constant voltage, PWM switching). Now the overvoltage
alert is inhibited during turn-on in each PWM cycle by an interrupt.
This issue happened because the HAL ADC configuration data structure
is allocated on the stack (which by default is not initialized,
i.e. contains potentially non-zero data). As most of this structure was
explicitly initialized only sometimes the OversampleMode setting was
not 0, in this case the ADC had no left data alignment, i.e. delivered
too low values. If it happens, the system sees very weird temperature
and voltage/power values.