tstana / cubes-fw

Firmware running on the CUBES SmartFusion2 Cortex-M3 core
2 stars 1 forks source link

Clean up HVPS code #47

Closed tstana closed 2 years ago

tstana commented 2 years ago

In hvps_init():

NOTE: Also take a look elsewhere in the code, if there is anything that could be cleaned up.

tstana commented 2 years ago

Closed as part of commit 33b203c.

The value that is output by the uninitialized HVPS module is 40V, according to the C11204-02 operations manual.

No default value to apply was deemed necessary, as the commented-out check in hvps_get_voltage() didn't really make sense. The current version of hvps_get_voltage() returns 0xFFFF in case the command did not pass through correctly. hvps_init() checked for this 0xFFFF returned by hvps_get_voltage() before applying some TBD value for the Vb out of the HVPS module. Since 0xFFFF indicates a misinterpreted command from the module, not the fact that Vb was not set, this check for the output of hvps_get_voltage() inside hvps_init() was also deemed unnecessary.