-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FL-3661] Troika layout fixes #3365
Conversation
Compiled f7 firmware for commit |
PVS-Studio report for commit |
// In layout 0x5 balance in bits 165:185 ( from sector start, length 20). | ||
|
||
if(layout == TroikaLayoutE && sub_layout == TroikaSublayout3) { | ||
const uint8_t* temp_ptr = &data->block[start_block_num + 1].data[7]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a common function in both branches?
|
||
TroikaLayout result = TroikaLayoutUnknown; | ||
switch(layout) { | ||
case 0x2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointless - enum values are equal to switch cases, we can use them as-is.
So, just check for known values and cast to enum, return Unknown otherwise
What's new
Verification
Checklist (For Reviewer)