Skip to content

Commit

Permalink
main: look for LOGO.BMP when idle
Browse files Browse the repository at this point in the history
..and show that instead of the BornHack 2019 logo if found
  • Loading branch information
esmil committed Nov 30, 2019
1 parent 583d256 commit 1407575
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "power.h"
#include "font.h"
#include "display.h"
#include "sdcard.h"
#include "menu.h"

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

extern const struct dp_cimage logo;

static FRESULT show_logo(void)
{
FATFS fs;
FRESULT res;

sd_init();

res = f_mount(&fs, "", 1);
if (res != FR_OK)
goto err;

res = dp_showbmp_at("LOGO.BMP", 0, 0);
err:
sd_uninit();
return res;
}

static void
idle(void)
{
struct ticker tick1s;
unsigned int count = 0;

dp_fill(0, 0, 240, 240, 0x000);
dp_cimage(0, 10, &logo);
if (show_logo() != FR_OK)
dp_cimage(0, 10, &logo);
buttons_config(anypressed);

ticker_start(&tick1s, 1000, 2);
Expand Down

0 comments on commit 1407575

Please sign in to comment.