Code linting

This commit is contained in:
Alexandre Paillier
2022-12-02 11:33:32 +01:00
parent 856785f83d
commit 57e2bd7e4f
20 changed files with 623 additions and 614 deletions
+31 -30
View File
@@ -4,52 +4,53 @@
static nbgl_layoutTagValue_t tlv;
static void reviewReject(void) {
io_seproxyhal_touch_data_cancel(NULL);
ui_idle();
io_seproxyhal_touch_data_cancel(NULL);
ui_idle();
}
static void confirmTransation(void) {
io_seproxyhal_touch_data_ok(NULL);
io_seproxyhal_touch_data_ok(NULL);
}
static void reviewChoice(bool confirm) {
if (confirm) {
confirmTransation();
} else {
reviewReject();
}
if (confirm) {
confirmTransation();
} else {
reviewReject();
}
}
static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
if (page == 0) {
tlv.item = "Parameter";
tlv.value = strings.tmp.tmp;
content->type = TAG_VALUE_LIST;
content->tagValueList.nbPairs = 1;
content->tagValueList.pairs = (nbgl_layoutTagValue_t *)&tlv;
}
else if (page == 1) {
content->type = INFO_LONG_PRESS,
content->infoLongPress.icon = &ICONGLYPH;
content->infoLongPress.text = "Confirm parameter";
content->infoLongPress.longPressText = "Hold to confirm";
}
else {
return false;
}
// valid page so return true
return true;
if (page == 0) {
tlv.item = "Parameter";
tlv.value = strings.tmp.tmp;
content->type = TAG_VALUE_LIST;
content->tagValueList.nbPairs = 1;
content->tagValueList.pairs = (nbgl_layoutTagValue_t *) &tlv;
} else if (page == 1) {
content->type = INFO_LONG_PRESS, content->infoLongPress.icon = &ICONGLYPH;
content->infoLongPress.text = "Confirm parameter";
content->infoLongPress.longPressText = "Hold to confirm";
} else {
return false;
}
// valid page so return true
return true;
}
static void reviewContinue(void) {
nbgl_useCaseRegularReview(0, 2, "Reject parameter", NULL, displayTransactionPage, reviewChoice);
nbgl_useCaseRegularReview(0, 2, "Reject parameter", NULL, displayTransactionPage, reviewChoice);
}
static void buildScreen(void) {
nbgl_useCaseReviewStart(&ICONGLYPH, "Verify parameter", NULL, "Reject", reviewContinue, reviewReject);
nbgl_useCaseReviewStart(&ICONGLYPH,
"Verify parameter",
NULL,
"Reject",
reviewContinue,
reviewReject);
}
void ui_confirm_parameter(void) {
buildScreen();
buildScreen();
}