Prusa MINI Firmware overview
|
#include "ff.h"
#include "dbg.h"
#include "gui.h"
#include "config.h"
#include "window_header.h"
#include "status_footer.h"
#include "marlin_client.h"
#include "screen_print_preview.h"
#include "screen_printing.h"
#include "print_utils.h"
#include "../Marlin/src/sd/cardreader.h"
◆ BUTTON_PRINT
◆ BUTTON_PREHEAT
◆ BUTTON_FILAMENT
#define BUTTON_FILAMENT 2 |
◆ BUTTON_CALIBRATION
#define BUTTON_CALIBRATION 3 |
◆ BUTTON_SETTINGS
#define BUTTON_SETTINGS 4 |
◆ BUTTON_INFO
◆ pw
◆ find_latest_gcode()
static bool find_latest_gcode |
( |
char * |
fpath, |
|
|
int |
fpath_len, |
|
|
char * |
fname, |
|
|
int |
fname_len |
|
) |
| |
|
static |
224 if (result !=
FR_OK) {
229 WORD latest_fdate = 0;
230 WORD latest_ftime = 0;
233 result =
f_findfirst(&dir, ¤t_finfo,
"",
"*.gcode");
234 while (result ==
FR_OK && current_finfo.
fname[0]) {
237 bool is_newer = latest_fdate != current_finfo.
fdate
238 ? latest_fdate < current_finfo.
fdate
239 : latest_ftime < current_finfo.
ftime;
241 if ((fname[0] == 0 || is_newer) && !skip) {
242 const char *short_name = current_finfo.altname[0] ? current_finfo.altname : current_finfo.
fname;
243 snprintf(fpath, fpath_len,
"/%s", short_name);
244 snprintf(fname, fname_len,
"%s", current_finfo.
fname);
245 latest_fdate = current_finfo.
fdate;
246 latest_ftime = current_finfo.
ftime;
253 return result ==
FR_OK && fname[0] != 0 ? true :
false;
◆ screen_home_disable_print_button()
257 pw->w_buttons[0].win.f_disabled = 1;
258 pw->w_buttons[0].win.f_enabled = 0;
◆ screen_home_init()
85 pw->is_starting = (
pw->time < 5000) ? 1 : 0;
101 for (
uint8_t row = 0; row < 2; row++) {
102 for (
uint8_t col = 0; col < 3; col++) {
105 rect_ui16(8 + (15 + 64) * col, 88 + (14 + 64) * row, 64, 64),
106 &(
pw->w_buttons[row * 3 + col]));
121 rect_ui16(80 * col, 152 + (15 + 64) * row, 80, 14),
122 &(
pw->w_labels[row * 3 + col]));
130 if (!IS_SD_INSERTED())
◆ screen_home_done()
◆ screen_home_draw()
◆ on_print_preview_action()
◆ screen_home_event()
161 if ((now -
pw->time) > 950) {
195 switch ((
int)param) {
◆ pscreen_filebrowser
◆ pscreen_menu_preheat
◆ menu_preheat_type
◆ pscreen_menu_filament
◆ pscreen_menu_calibration
◆ pscreen_menu_settings
◆ pscreen_menu_info
◆ icons
◆ labels
Initial value:= {
"Print",
"Preheat",
"Filament",
"Calibration",
"Settings",
"Info",
"No USB"
}
◆ screen_home
◆ pscreen_home
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
#define IDR_PNG_status_logo_prusa_prn
Definition: resource.h:18
Definition: screen_print_preview.h:10
#define IDR_PNG_menu_icon_settings
Definition: resource.h:33
const char * labels[7]
Definition: screen_home.cpp:45
void window_set_padding(int16_t id, padding_ui8_t padding)
Definition: window.c:549
#define IDR_PNG_menu_icon_spool
Definition: resource.h:30
#define AM_HID
Definition: ff.h:352
void print_begin(const char *filename)
Definition: print_utils.cpp:6
#define IDR_PNG_status_icon_home
Definition: resource.h:25
#define MARLIN_EVT_MediaError
Definition: marlin_events.h:12
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
BYTE fattrib
Definition: ff.h:201
char screen_printing_file_path[_MAX_LFN+2]
Definition: screen_printing.cpp:165
#define ALIGN_CENTER
Definition: guitypes.h:19
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
static void on_print_preview_action(print_preview_action_t action)
Definition: screen_home.cpp:143
unsigned short WORD
Definition: onboard_sd.h:14
WORD fdate
Definition: ff.h:199
const char * screen_print_preview_get_gcode_filepath()
Definition: screen_print_preview.c:85
void window_destroy(int16_t id)
Definition: window.c:132
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
char screen_printing_file_name[_MAX_LFN+1]
Definition: screen_printing.cpp:164
Definition: screen_home.cpp:58
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
void screen_print_preview_set_gcode_filename(const char *fname)
Definition: screen_print_preview.c:89
#define IDR_PNG_menu_icon_preheat
Definition: resource.h:29
#define BUTTON_SETTINGS
Definition: screen_home.cpp:33
void screen_open(int16_t screen_id)
Definition: screen.c:62
int screen_home_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_home.cpp:153
#define MARLIN_EVT_MediaInserted
Definition: marlin_events.h:11
#define IDR_PNG_menu_icon_calibration
Definition: resource.h:32
void screen_home_disable_print_button(screen_t *screen)
Definition: screen_home.cpp:256
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
void screen_close(void)
Definition: screen.c:80
#define pw
Definition: screen_home.cpp:76
#define BUTTON_INFO
Definition: screen_home.cpp:34
static bool find_latest_gcode(char *fpath, int fpath_len, char *fname, int fname_len)
Definition: screen_home.cpp:220
Definition: screen_print_preview.h:9
#define COLOR_GRAY
Definition: guitypes.h:50
screen_t * pscreen_menu_calibration
Definition: screen_menu_calibration.c:101
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
screen_t * pscreen_printing
Definition: screen_printing.cpp:161
#define IDR_PNG_menu_icon_info
Definition: resource.h:34
#define BUTTON_CALIBRATION
Definition: screen_home.cpp:32
#define WINDOW_CLS_FRAME
Definition: window.h:9
WORD ftime
Definition: ff.h:200
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:4221
#define BUTTON_FILAMENT
Definition: screen_home.cpp:31
void window_set_focus(int16_t id)
Definition: window.c:480
#define BUTTON_PREHEAT
Definition: screen_home.cpp:30
void screen_print_preview_set_gcode_filepath(const char *fpath)
Definition: screen_print_preview.c:81
int window_is_focused(int16_t id)
Definition: window.c:267
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
#define BUTTON_PRINT
Definition: screen_home.cpp:29
const uint8_t[]
Definition: 404_html.c:3
screen_t * pscreen_menu_preheat
Definition: screen_menu_preheat.cpp:93
TCHAR fname[13]
Definition: ff.h:206
#define AM_SYS
Definition: ff.h:353
void screen_print_preview_set_on_action(print_preview_action_handler_t handler)
Definition: screen_print_preview.c:93
#define WINDOW_CLS_ICON
Definition: window.h:12
#define WINDOW_CLS_TEXT
Definition: window.h:10
screen_t * pscreen_menu_settings
Definition: screen_menu_settings.c:133
FRESULT
Definition: ff.h:214
FRESULT f_findnext(DIR *dp, FILINFO *fno)
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
screen_t * pscreen_menu_filament
Definition: screen_menu_filament.c:124
#define WINDOW_EVENT_CLICK
Definition: window.h:46
screen_t * pscreen_menu_info
Definition: screen_menu_info.c:66
void screen_home_done(screen_t *screen)
Definition: screen_home.cpp:136
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
void window_enable(int16_t id)
Definition: window.c:517
#define IDR_FNT_SMALL
Definition: resource.h:9
int16_t id
Definition: screen.h:19
screen_t * pscreen_filebrowser
Definition: screen_filebrowser.cpp:177
void screen_home_init(screen_t *screen)
Definition: screen_home.cpp:81
#define IDR_PNG_menu_icon_print
Definition: resource.h:28
#define MARLIN_EVT_MediaRemoved
Definition: marlin_events.h:13
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
const uint16_t icons[6]
Definition: screen_home.cpp:36
FRESULT f_findfirst(DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern)
screen_t *const pscreen_print_preview
Definition: screen_print_preview.c:77
void screen_home_draw(screen_t *screen)
Definition: screen_home.cpp:140
uint8_t menu_preheat_type
Definition: screen_menu_preheat.cpp:14