Prusa MINI Firmware overview
screen_watchdog.c File Reference
#include "gui.h"
#include "config.h"

Classes

struct  screen_watchdog_data_t
 
struct  _screen_watchdog_t
 

Typedefs

typedef struct _screen_watchdog_t screen_watchdog_t
 

Functions

void screen_watchdog_init (screen_watchdog_t *screen)
 
void screen_watchdog_done (screen_watchdog_t *screen)
 
void screen_watchdog_draw (screen_watchdog_t *screen)
 
int screen_watchdog_event (screen_watchdog_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

screen_watchdog_t screen_watchdog
 
const screen_tpscreen_watchdog = (screen_t *)&screen_watchdog
 

Typedef Documentation

◆ screen_watchdog_t

Function Documentation

◆ screen_watchdog_init()

void screen_watchdog_init ( screen_watchdog_t screen)
23  {
24  if (screen->pd == 0) {
25  int16_t id;
26  int16_t id0;
28  screen->pd = pd;
29 
30  id0 = window_create_ptr(WINDOW_CLS_FRAME, -1, rect_ui16(0, 0, 0, 0), &(pd->frame));
32 
33  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 70, 220, 24), &(pd->text0));
34  pd->text0.font = resource_font(IDR_FNT_BIG);
35  window_set_text(id, "WATCHDOG RESET");
37 
38  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(0, 110, 240, 24), &(pd->text1));
39  pd->text1.font = resource_font(IDR_FNT_NORMAL);
40  window_set_text(id, "press to continue...");
42  window_enable(id);
43  window_set_tag(id, 1);
44  }
45 }
Here is the call graph for this function:

◆ screen_watchdog_done()

void screen_watchdog_done ( screen_watchdog_t screen)
47  {
48  if (screen->pd) {
49  window_destroy(screen->pd->frame.win.id);
50  gui_free(screen->pd);
51  screen->pd = 0;
52  }
53 }
Here is the call graph for this function:

◆ screen_watchdog_draw()

void screen_watchdog_draw ( screen_watchdog_t screen)
55  {
56 }

◆ screen_watchdog_event()

int screen_watchdog_event ( screen_watchdog_t screen,
window_t window,
uint8_t  event,
void param 
)
58  {
59  if (event == WINDOW_EVENT_CLICK)
60  screen_close();
61  return 0;
62 }
Here is the call graph for this function:

Variable Documentation

◆ screen_watchdog

◆ pscreen_watchdog

const screen_t* pscreen_watchdog = (screen_t *)&screen_watchdog
window_set_alignment
void window_set_alignment(int16_t id, uint8_t alignment)
Definition: window.c:561
screen_watchdog_data_t::frame
window_frame_t frame
Definition: screen_watchdog.c:11
gui_free
void gui_free(void *ptr)
Definition: gui.c:39
window_set_color_back
void window_set_color_back(int16_t id, color_t clr)
Definition: window.c:431
screen_watchdog_done
void screen_watchdog_done(screen_watchdog_t *screen)
Definition: screen_watchdog.c:47
pd
#define pd
Definition: screen_filebrowser.cpp:39
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
COLOR_RED
#define COLOR_RED
Definition: guitypes.h:42
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
gui_malloc
void * gui_malloc(unsigned int size)
Definition: gui.c:35
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
IDR_FNT_NORMAL
#define IDR_FNT_NORMAL
Definition: resource.h:10
screen_event_t
int() screen_event_t(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen.h:13
_window_t::id
int16_t id
Definition: window.h:79
screen_close
void screen_close(void)
Definition: screen.c:80
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
screen_init_t
void() screen_init_t(screen_t *screen)
Definition: screen.h:10
window_set_tag
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
_screen_watchdog_t::pd
screen_watchdog_data_t * pd
Definition: screen_watchdog.c:18
_window_frame_t::win
window_t win
Definition: window_frame.h:19
screen_watchdog_data_t
Definition: screen_watchdog.c:9
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
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_watchdog_init
void screen_watchdog_init(screen_watchdog_t *screen)
Definition: screen_watchdog.c:23
window_enable
void window_enable(int16_t id)
Definition: window.c:517
screen_watchdog_event
int screen_watchdog_event(screen_watchdog_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_watchdog.c:58
screen_draw_t
void() screen_draw_t(screen_t *screen)
Definition: screen.h:12
screen_done_t
void() screen_done_t(screen_t *screen)
Definition: screen.h:11
screen_watchdog_draw
void screen_watchdog_draw(screen_watchdog_t *screen)
Definition: screen_watchdog.c:55