File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Interact with Infineon (formerly Cypress) PD controllers (their firmware binaries) in the CCGx series
2
2
3
+ use alloc:: format;
3
4
use alloc:: string:: String ;
4
5
use alloc:: string:: ToString ;
5
6
#[ cfg( feature = "uefi" ) ]
@@ -117,6 +118,14 @@ pub struct BaseVersion {
117
118
/// Build Number part of the version. PP of X.Y.Z.BB
118
119
pub build_number : u16 ,
119
120
}
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
+ }
120
129
impl fmt:: Display for BaseVersion {
121
130
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
122
131
write ! (
@@ -215,8 +224,9 @@ impl ControllerFirmwares {
215
224
pub fn active_fw_ver ( & self ) -> String {
216
225
let active = self . active_fw ( ) ;
217
226
// On 11th Gen we modified base version instead of app version
227
+ // And it's formatted as decimal instead of hex
218
228
if let Some ( Platform :: IntelGen11 ) = smbios:: get_platform ( ) {
219
- active. base . to_string ( )
229
+ active. base . to_dec_string ( )
220
230
} else {
221
231
active. app . to_string ( )
222
232
}
You can’t perform that action at this time.
0 commit comments