Prusa MINI Firmware overview
bsod.h
Go to the documentation of this file.
1 /*
2  * bsod.h
3  *
4  * Created on: 2019-10-01
5  * Author: Radek Vana
6  */
7 
8 #ifndef _BSOD_H
9 #define _BSOD_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif //__cplusplus
14 
15 //following does not work with macro parameters
16 //#define QUOTE_X(t)#t
17 //#define QUOTE(t)QUOTE_X(t)
18 //#define bsod(format, ...) _bsod(QUOTE(FILE:\n %s\nLINE: %d\n) format, __FILE__ , __LINE__ , ##__VA_ARGS__)
19 
20 #define bsod(fmt, ...) _bsod(fmt, __FILE__, __LINE__, ##__VA_ARGS__)
21 
22 //no file name
23 #define bsod_nofn(fmt, ...) _bsod(fmt, 0, __LINE__, ##__VA_ARGS__)
24 //no line number
25 #define bsod_noln(fmt, ...) _bsod(fmt, __FILE__, -1, ##__VA_ARGS__)
26 //no file name, no line number
27 #define bsod_nofn_noln(fmt, ...) _bsod(fmt, 0, -1, ##__VA_ARGS__)
28 
29 void _bsod(const char *fmt, const char *fine_name, int line_number, ...); //with file name and line number
30 
31 void general_error(const char *error, const char *module);
32 
33 void temp_error(const char *error, const char *module, float t_noz, float tt_noz, float t_bed, float tt_bed);
34 
35 #ifdef __cplusplus
36 }
37 #endif //__cplusplus
38 
39 #endif //_BSOD_H
hiwdg
IWDG_HandleTypeDef hiwdg
Definition: watchdog.h:24
uxTaskNumber
static PRIVILEGED_INITIALIZED_DATA UBaseType_t uxTaskNumber
Definition: tasks.c:403
jogwheel_config
jogwheel_config_t jogwheel_config
Definition: jogwheel.c:95
temp_error
void temp_error(const char *error, const char *module, float t_noz, float tt_noz, float t_bed, float tt_bed)
Definition: bsod.c:207
hwio_beeper_set_pwm
void hwio_beeper_set_pwm(uint32_t per, uint32_t pul)
Definition: hwio_a3ides_2209_02.c:491
TaskHookFunction_t
BaseType_t(* TaskHookFunction_t)(void *)
Definition: task.h:109
task.h
tskTaskControlBlock::xStateListItem
ListItem_t xStateListItem
Definition: tasks.c:301
COLOR_NAVY
#define COLOR_NAVY
Definition: guitypes.h:56
auto_build.error
bool error
Definition: auto_build.py:637
_term_t::row
uint8_t row
Definition: term.h:51
tskTaskControlBlock::uxPriority
UBaseType_t uxPriority
Definition: tasks.c:303
_term_t::rows
uint8_t rows
Definition: term.h:45
COLOR_WHITE
#define COLOR_WHITE
Definition: guitypes.h:41
hwio_safe_state
void hwio_safe_state(void)
Put hardware into safe state.
Definition: safe_state.c:8
sys_reset
void sys_reset(void)
Definition: sys.cpp:20
pxCurrentTCB
PRIVILEGED_INITIALIZED_DATA TCB_t *volatile pxCurrentTCB
Definition: tasks.c:372
tskTaskControlBlock
Definition: tasks.c:293
TCB_t
tskTCB TCB_t
Definition: bsod.c:105
xLIST_ITEM
Definition: list.h:181
window_term.h
IWDG_HandleTypeDef
IWDG Handle Structure definition.
Definition: stm32f4xx_hal_iwdg.h:76
_term_t
Definition: term.h:43
ALIGN_CENTER
#define ALIGN_CENTER
Definition: guitypes.h:19
sys.h
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_defaults_t::font
font_t * font
Definition: guitypes.h:110
bsod.h
term.h
safe_state.h
jogwheel_init
void jogwheel_init(void)
Definition: jogwheel.c:16
padding_ui8
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
i
uint8_t i
Definition: screen_test_graph.c:72
configNUM_THREAD_LOCAL_STORAGE_POINTERS
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS
Definition: FreeRTOS.h:236
general_error
void general_error(const char *error, const char *module)
Marlin stopped.
Definition: bsod.c:174
_display_t::draw_text
display_draw_text_t * draw_text
Definition: display.h:35
get_fw_version
static void get_fw_version(void)
Definition: bsod.c:115
tskTaskControlBlock::pxStack
StackType_t * pxStack
Definition: tasks.c:304
gpio_get
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
StackMacros.h
tskTaskControlBlock::pxTopOfStack
volatile StackType_t * pxTopOfStack
Definition: tasks.c:295
HAL_IWDG_Refresh
HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg)
IDR_PNG_icon_pepa_psod
#define IDR_PNG_icon_pepa_psod
Definition: resource.h:61
version_build_nr
const int version_build_nr
build number
Definition: version.c:44
UBaseType_t
unsigned long UBaseType_t
Definition: portmacro.h:99
PRIVILEGED_INITIALIZED_DATA
#define PRIVILEGED_INITIALIZED_DATA
Definition: mpu_wrappers.h:206
_display_t::init
display_init_t * init
Definition: display.h:27
StackType_t
portSTACK_TYPE StackType_t
Definition: portmacro.h:97
st7789v_enable_safe_mode
void st7789v_enable_safe_mode(void)
enable safe mode (direct acces + safe delay)
Definition: st7789v.c:923
render_term
void render_term(rect_ui16_t rc, term_t *pt, font_t *font, color_t clr0, color_t clr1)
Definition: window_term.c:13
gpio.h
st7789v.h
_display_t::clear
display_clear_t * clear
Definition: display.h:29
tskTaskControlBlock::xEventListItem
ListItem_t xEventListItem
Definition: tasks.c:302
uxCriticalNesting
static UBaseType_t uxCriticalNesting
Definition: port.c:157
tskTaskControlBlock::pcTaskName
char pcTaskName[configMAX_TASK_NAME_LEN]
Definition: tasks.c:305
render_text_align
void render_text_align(rect_ui16_t rc, const char *text, font_t *font, color_t clr0, color_t clr1, padding_ui8_t padding, uint16_t flags)
Definition: display_helper.c:6
uint8_t
const uint8_t[]
Definition: 404_html.c:3
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
display
display_t * display
Definition: display.c:6
FW_version_str
char FW_version_str[22]
Definition: bsod.c:106
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
jogwheel.h
term_init
void term_init(term_t *pt, uint8_t cols, uint8_t rows, uint8_t *buff)
Definition: term.c:6
vterm_printf
int vterm_printf(term_t *pt, const char *fmt, va_list va)
Definition: term.c:191
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
configMAX_TASK_NAME_LEN
#define configMAX_TASK_NAME_LEN
Definition: FreeRTOSConfig.h:113
PADDING
#define PADDING
Definition: bsod.c:135
COLOR_BLACK
#define COLOR_BLACK
Definition: guitypes.h:40
COLOR_RED_ALERT
#define COLOR_RED_ALERT
Definition: guitypes.h:43
stop_common
static void stop_common(void)
Put HW into safe state, activate display safe mode and initialize it twice.
Definition: bsod.c:139
print_error
static void print_error(term_t *term, color_t background_color)
print white error message on background
Definition: bsod.c:153
_display_t::draw_icon
display_draw_icon_t * draw_icon
Definition: display.h:36
version.h
_display_t::w
uint16_t w
Definition: display.h:25
config.h
color_t
uint32_t color_t
Definition: guitypes.h:62
TERM_BUFF_SIZE
#define TERM_BUFF_SIZE(c, r)
Definition: term.h:36
gui.h
gui_defaults
gui_defaults_t gui_defaults
Definition: gui.c:20
background_color
png_structrp png_const_color_16p background_color
Definition: png.h:1302
createSpeedLookupTable.args
args
Definition: createSpeedLookupTable.py:17
hwio.h
general_error
void general_error(const char *error, const char *module)
Marlin stopped.
Definition: bsod.c:174
tskTCB
struct tskTaskControlBlock tskTCB
temp_error
void temp_error(const char *error, const char *module, float t_noz, float tt_noz, float t_bed, float tt_bed)
Definition: bsod.c:207
_display_t::draw_line
display_draw_line_t * draw_line
Definition: display.h:31
_bsod
void _bsod(const char *fmt, const char *file_name, int line_number,...)
Definition: bsod.c:215
_bsod
void _bsod(const char *fmt, const char *fine_name, int line_number,...)
Definition: bsod.c:215
_jogwheel_config_t::pinENC
uint8_t pinENC
Definition: jogwheel.h:23
term_printf
int term_printf(term_t *pt, const char *fmt,...)
Definition: term.c:178
point_ui16
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
X_MAX
#define X_MAX
Definition: bsod.c:136