Skip to content

Commit 1407575

Browse files
committed
main: look for LOGO.BMP when idle
..and show that instead of the BornHack 2019 logo if found
1 parent 583d256 commit 1407575

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

main.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "power.h"
2929
#include "font.h"
3030
#include "display.h"
31+
#include "sdcard.h"
3132
#include "menu.h"
3233

3334
#ifdef NDEBUG
@@ -51,14 +52,32 @@ static const struct button_config anypressed[BTN_MAX] = {
5152

5253
extern const struct dp_cimage logo;
5354

55+
static FRESULT show_logo(void)
56+
{
57+
FATFS fs;
58+
FRESULT res;
59+
60+
sd_init();
61+
62+
res = f_mount(&fs, "", 1);
63+
if (res != FR_OK)
64+
goto err;
65+
66+
res = dp_showbmp_at("LOGO.BMP", 0, 0);
67+
err:
68+
sd_uninit();
69+
return res;
70+
}
71+
5472
static void
5573
idle(void)
5674
{
5775
struct ticker tick1s;
5876
unsigned int count = 0;
5977

6078
dp_fill(0, 0, 240, 240, 0x000);
61-
dp_cimage(0, 10, &logo);
79+
if (show_logo() != FR_OK)
80+
dp_cimage(0, 10, &logo);
6281
buttons_config(anypressed);
6382

6483
ticker_start(&tick1s, 1000, 2);

0 commit comments

Comments
 (0)