Skip to content

Commit

Permalink
fix test bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bitgamma committed Jan 22, 2025
1 parent 9286ac0 commit 5fcd431
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/core_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void ui_info_nowait(const char* msg) {
}

static void core_keypad_test(apdu_t* apdu) {
g_ui_cmd.type = UI_CMD_INPUT_STRING;
g_ui_cmd.type = UI_CMD_KEYPAD_TEST;
if (ui_signal_wait(0) != CORE_EVT_UI_OK) {
core_usb_err_sw(apdu, 0x6f, 0x01);
return;
Expand Down Expand Up @@ -99,18 +99,19 @@ static void core_backlight_test(apdu_t* apdu) {

if (ui_prompt("Brightness test", "Screen is at minimum brightness. Press is OK if readable, cancel otherwise") != CORE_EVT_UI_OK) {
core_usb_err_sw(apdu, 0x6f, 0x01);
return;
goto backlight_teardown;
}

hal_pwm_set_dutycycle(PWM_BACKLIGHT, 100);
if (ui_prompt("Brightness test", "Screen is at full brightness. Press is OK if very bright, cancel otherwise") != CORE_EVT_UI_OK) {
core_usb_err_sw(apdu, 0x6f, 0x02);
return;
goto backlight_teardown;
}

hal_pwm_set_dutycycle(PWM_BACKLIGHT, 75);

core_usb_err_sw(apdu, 0x90, 0x00);

backlight_teardown:
hal_pwm_set_dutycycle(PWM_BACKLIGHT, 75);
}

static void core_lcd_test(apdu_t* apdu) {
Expand Down Expand Up @@ -213,6 +214,7 @@ static void core_test_run(apdu_t* apdu) {
break;
case P1_TEST_CAMERA:
core_camera_test(apdu);
break;
default:
core_usb_err_sw(apdu, 0x6a, 0x86);
}
Expand Down

0 comments on commit 5fcd431

Please sign in to comment.