From 4359e2eaa9fd42ff66200b6dbc82d67034c40a90 Mon Sep 17 00:00:00 2001 From: Astra <93453568+Astrrra@users.noreply.github.com> Date: Thu, 2 Mar 2023 13:56:23 +0200 Subject: [PATCH] [FL-3103] New pin reset splashscreen (#2405) * New pin reset splashscreen * Recovery: optimize drawing routine * Recovery: increase erase confirmation time * Change the required button Co-authored-by: Aleksandr Kutuzov --- assets/icons/ErasePin/Erase_pin_128x64.png | Bin 0 -> 5220 bytes firmware/targets/f7/src/recovery.c | 34 +++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 assets/icons/ErasePin/Erase_pin_128x64.png diff --git a/assets/icons/ErasePin/Erase_pin_128x64.png b/assets/icons/ErasePin/Erase_pin_128x64.png new file mode 100644 index 0000000000000000000000000000000000000000..92ca5f91cbb528563ced1b4f585c40ca3e8c27c6 GIT binary patch literal 5220 zcmbVP2T)U6w?1^FO1+{8ktT?w5=t~m6_Ac}1PMumKpIJ;2^c}7ND&bgQK>&g5EKvr zDJop4A}ZZNN06>GrM+PL-<`Sl&7GH-le5p>-}?6Y)>?bbInh=YMuL31`2YYAG%+@? zVcnUmONW=8_3v6Xq0G8*dg_|%0>Fa={&fr&0PrCR`ubLM8zViCiJ`s*Oj|=k4Gx9@ zfN|sPYyP&jJ(7_xYy5*UUO-<<1to!@%tbJ0FQ@gc)7-mSfO-LQVpN`vfrtp3;pKED zTULf~VU)){(3reD+_CQC!GVEuV`D3gH3R*gbM%$IvuO{(fP$qg7{Yap z9h94N~9@p>(OV$w1< ze9Q86p=~VyG@WV~Ct9FP8@|d}w1{WN%pl})o-4#i9g9wZ9JgwqdBnSn{wFO&vd_A0 z8Ykn@FnsGoUo#Q55*2Xv;$?Y{2BQWpsgo8tQIt!L2$LIa5(_TAM0jM15D=qK&aYJ% zAd(t&qd{1RA+kUNsM!?|t#N)yY6<7Cer0y{=`WSO3+z>3(*&|N=|%ck8azph{d~sJ zq~xa2(n+vNbH16I25`x9^PrS3X);sJ<)*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zyNXSqiVM{ctwU?;eA&92BJn*f>{RkQ9^fT51bCu$No-d8X=4L(1$cDf39pREik{O> zVbHT^Ti#%x9~vi%Yj$9|z3}R6+cmfXn6x6D26zV7Xu;$8G>*&Hf}e)ICja00Z&k zr`~5|W-a0d?Z#Sxw$8|f1Iy~SlY8{S!ZXEy%Htz>a4BY)F5Aobu2E>&i)J3CgHR!` zYokFVj0(w_l`bf4KWJQX6)A`(m-O$v@oprvR zx`GK~AoTTeule(A0m0xGRSK;a4g=Cdg`BbNfo7M|&OfRPMlzSTQf1Ak>P1g9O;hfK zT+Y1$98fc*$6^?gQh4zY4PCY(5)#RQJbCeuB{8Kw>bbXF|;r! I(sK{{A0@`iOaK4? literal 0 HcmV?d00001 diff --git a/firmware/targets/f7/src/recovery.c b/firmware/targets/f7/src/recovery.c index d56be4fe0..db538b0d5 100644 --- a/firmware/targets/f7/src/recovery.c +++ b/firmware/targets/f7/src/recovery.c @@ -5,24 +5,20 @@ #include #include -#define COUNTER_VALUE (100U) +#define COUNTER_VALUE (136U) static void flipper_boot_recovery_draw_splash(u8g2_t* fb, size_t progress) { - u8g2_ClearBuffer(fb); - u8g2_SetDrawColor(fb, 0x01); - - u8g2_SetFont(fb, u8g2_font_helvB08_tr); - u8g2_DrawStr(fb, 2, 8, "PIN and Factory Reset"); - u8g2_SetFont(fb, u8g2_font_haxrcorp4089_tr); - u8g2_DrawStr(fb, 2, 21, "Hold Right to confirm"); - u8g2_DrawStr(fb, 2, 31, "Press Down to cancel"); - if(progress < COUNTER_VALUE) { - size_t width = progress / (COUNTER_VALUE / 100); - u8g2_DrawBox(fb, 14 + (50 - width / 2), 54, width, 3); + // Fill the progress bar while the progress is going down + u8g2_SetDrawColor(fb, 0x01); + u8g2_DrawRFrame(fb, 59, 41, 69, 8, 2); + size_t width = (COUNTER_VALUE - progress) * 68 / COUNTER_VALUE; + u8g2_DrawBox(fb, 60, 42, width, 6); + } else { + u8g2_SetDrawColor(fb, 0x00); + u8g2_DrawRBox(fb, 59, 41, 69, 8, 2); } - u8g2_SetPowerSave(fb, 0); u8g2_SendBuffer(fb); } @@ -31,6 +27,18 @@ void flipper_boot_recovery_exec() { u8g2_Setup_st756x_flipper(fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(fb); + furi_hal_compress_icon_init(); + uint8_t* splash_data = NULL; + furi_hal_compress_icon_decode(icon_get_data(&I_Erase_pin_128x64), &splash_data); + + u8g2_ClearBuffer(fb); + u8g2_SetDrawColor(fb, 0x01); + + // Draw the recovery picture + u8g2_DrawXBM(fb, 0, 0, 128, 64, splash_data); + u8g2_SendBuffer(fb); + u8g2_SetPowerSave(fb, 0); + size_t counter = COUNTER_VALUE; while(counter) { if(!furi_hal_gpio_read(&gpio_button_down)) {