Prusa MINI Firmware overview
screen_splash.c File Reference
#include "gui.h"
#include "config.h"
#include "version.h"
#include "window_logo.h"
#include "wizard/wizard.h"
#include "eeprom.h"
#include "stm32f4xx_hal.h"

Classes

struct  screen_splash_data_t
 

Macros

#define _psd   ((screen_splash_data_t *)screen->pdata)
 

Functions

void screen_splash_timer (screen_t *screen, uint32_t mseconds)
 
void screen_splash_init (screen_t *screen)
 
void screen_splash_done (screen_t *screen)
 
void screen_splash_draw (screen_t *screen)
 
int screen_splash_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

screen_tpscreen_test
 
screen_t screen_splash
 
const screen_tpscreen_splash = &screen_splash
 

Macro Definition Documentation

◆ _psd

#define _psd   ((screen_splash_data_t *)screen->pdata)

Function Documentation

◆ screen_splash_timer()

void screen_splash_timer ( screen_t screen,
uint32_t  mseconds 
)
128  {
129  float percent = mseconds / 3000.0 * 100;
130  window_set_value(_psd->progress.win.id, (percent < 95) ? percent : 95);
131 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ screen_splash_init()

void screen_splash_init ( screen_t screen)
51  {
52  int16_t id;
53  int16_t id0;
54 
55  id0 = window_create_ptr(WINDOW_CLS_FRAME, -1, rect_ui16(0, 0, 0, 0),
56  &(_psd->frame));
57 
58  id = window_create_ptr(WINDOW_CLS_LOGO, id0, rect_ui16(0, 91, 240, 62),
59  &(_psd->logo_prusa_mini));
60 
61  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 171, 220, 20),
62  &(_psd->text_progress));
63  _psd->text_progress.font = resource_font(IDR_FNT_NORMAL);
65  window_set_text(id, "Loading ...");
66 
67  id = window_create_ptr(WINDOW_CLS_PROGRESS, id0, rect_ui16(10, 200, 220, 15),
68  &(_psd->progress));
69  _psd->progress.color_back = COLOR_GRAY;
70  _psd->progress.color_progress = COLOR_ORANGE;
71  _psd->progress.font = resource_font(IDR_FNT_BIG);
72  _psd->progress.height_progress = 15;
73 
74  id = window_create_ptr(WINDOW_CLS_ICON, id0, rect_ui16(80, 240, 80, 80),
75  &(_psd->icon_logo_marlin));
77 
78  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(00, 295, 240, 22),
79  &(_psd->text_version));
82 }
Here is the call graph for this function:

◆ screen_splash_done()

void screen_splash_done ( screen_t screen)
84  {
85  window_destroy(_psd->frame.win.id);
86 }
Here is the call graph for this function:

◆ screen_splash_draw()

void screen_splash_draw ( screen_t screen)
88  {
89 }

◆ screen_splash_event()

int screen_splash_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
91  {
93 
94 #ifdef _EXTUI
96  screen_close();
100  uint8_t run_wizard = (run_selftest && run_xyzcalib && run_firstlay) ? 1 : 0;
101  if ((run_wizard || run_firstlay)) {
102  if (run_wizard) {
105  } else if (run_firstlay) {
106  if (gui_msgbox("The printer is not calibrated. Start First Layer Calibration?", MSGBOX_BTN_YESNO | MSGBOX_ICO_WARNING) == MSGBOX_RES_YES) {
109  } else
111  }
112  } else
114 #else
115  if (HAL_GetTick() > 3000) {
116  screen_close();
117  #ifdef LCDSIM
119  #else
121  #endif
122 #endif
123  return 1;
124  }
125  return 0;
126 }
Here is the call graph for this function:

Variable Documentation

◆ pscreen_test

screen_t* pscreen_test

◆ screen_splash

◆ pscreen_splash

const screen_t* pscreen_splash = &screen_splash
window_set_alignment
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
screen_splash_init
void screen_splash_init(screen_t *screen)
Definition: screen_splash.c:51
MARLIN_EVT_Startup
#define MARLIN_EVT_Startup
Definition: marlin_events.h:8
ALIGN_CENTER_BOTTOM
#define ALIGN_CENTER_BOTTOM
Definition: guitypes.h:27
marlin_event
int marlin_event(uint8_t evt_id)
Definition: marlin_client.c:232
wizard_run_complete
void wizard_run_complete(void)
Definition: wizard.c:54
eeprom_get_var
variant8_t eeprom_get_var(uint8_t id)
Definition: eeprom.c:75
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
_variant8_t::ui8
uint8_t ui8
Definition: variant8.h:36
_psd
#define _psd
Definition: screen_splash.c:47
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
IDR_FNT_NORMAL
#define IDR_FNT_NORMAL
Definition: resource.h:10
EEVAR_RUN_FIRSTLAY
#define EEVAR_RUN_FIRSTLAY
Definition: eeprom.h:16
MSGBOX_ICO_WARNING
#define MSGBOX_ICO_WARNING
Definition: window_msgbox.h:35
window_set_icon_id
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
screen_splash_event
int screen_splash_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_splash.c:91
pscreen_test
screen_t * pscreen_test
Definition: screen_test.c:157
screen_open
void screen_open(int16_t screen_id)
Definition: screen.c:62
WINDOW_CLS_LOGO
int16_t WINDOW_CLS_LOGO
Definition: window_logo.c:11
pscreen_marlin
const screen_t * pscreen_marlin
Definition: screen_marlin.c:33
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
screen_close
void screen_close(void)
Definition: screen.c:80
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
EEVAR_RUN_XYZCALIB
#define EEVAR_RUN_XYZCALIB
Definition: eeprom.h:15
COLOR_ORANGE
#define COLOR_ORANGE
Definition: guitypes.h:57
EEVAR_RUN_SELFTEST
#define EEVAR_RUN_SELFTEST
Definition: eeprom.h:14
WINDOW_CLS_PROGRESS
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
MSGBOX_RES_YES
#define MSGBOX_RES_YES
Definition: window_msgbox.h:44
wizard_run_firstlay
void wizard_run_firstlay(void)
Definition: wizard.c:84
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
window_set_value
void window_set_value(int16_t id, float value)
Definition: window.c:363
screen_stack_push
void screen_stack_push(int16_t screen_id)
Definition: screen.c:48
uint8_t
const uint8_t[]
Definition: 404_html.c:3
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
WINDOW_CLS_ICON
#define WINDOW_CLS_ICON
Definition: window.h:12
screen_splash_timer
void screen_splash_timer(screen_t *screen, uint32_t mseconds)
Definition: screen_splash.c:128
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
pscreen_home
screen_t * pscreen_home
Definition: screen_home.cpp:278
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
screen_splash_draw
void screen_splash_draw(screen_t *screen)
Definition: screen_splash.c:88
MSGBOX_BTN_YESNO
#define MSGBOX_BTN_YESNO
Definition: window_msgbox.h:24
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
screen_splash_done
void screen_splash_done(screen_t *screen)
Definition: screen_splash.c:84
_screen_t::id
int16_t id
Definition: screen.h:19
IDR_PNG_splash_logo_marlin
#define IDR_PNG_splash_logo_marlin
Definition: resource.h:17
version_version
const char version_version[]
semantic version (https://semver.org) is Prusa3D standard
Definition: version.c:31
screen_splash_data_t
Definition: screen_splash.c:30