File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11//! Interact with Infineon (formerly Cypress) PD controllers (their firmware binaries) in the CCGx series
22
3+ use alloc:: format;
34use alloc:: string:: String ;
45use alloc:: string:: ToString ;
56#[ cfg( feature = "uefi" ) ]
@@ -117,6 +118,14 @@ pub struct BaseVersion {
117118 /// Build Number part of the version. PP of X.Y.Z.BB
118119 pub build_number : u16 ,
119120}
121+ impl BaseVersion {
122+ pub fn to_dec_string ( & self ) -> String {
123+ format ! (
124+ "{}.{}.{}.{:0>3}" ,
125+ self . major, self . minor, self . patch, self . build_number
126+ )
127+ }
128+ }
120129impl fmt:: Display for BaseVersion {
121130 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
122131 write ! (
@@ -215,8 +224,9 @@ impl ControllerFirmwares {
215224 pub fn active_fw_ver ( & self ) -> String {
216225 let active = self . active_fw ( ) ;
217226 // On 11th Gen we modified base version instead of app version
227+ // And it's formatted as decimal instead of hex
218228 if let Some ( Platform :: IntelGen11 ) = smbios:: get_platform ( ) {
219- active. base . to_string ( )
229+ active. base . to_dec_string ( )
220230 } else {
221231 active. app . to_string ( )
222232 }
You can’t perform that action at this time.
0 commit comments