Prusa MINI Firmware overview
|
#include "bsod.h"
#include "stm32f4xx_hal.h"
#include "config.h"
#include "gui.h"
#include "term.h"
#include "st7789v.h"
#include "window_term.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "safe_state.h"
#include <inttypes.h>
#include "jogwheel.h"
#include "gpio.h"
#include "sys.h"
#include "hwio.h"
#include "version.h"
#include "task.h"
#include "StackMacros.h"
|
static void | get_fw_version (void) |
|
static void | stop_common (void) |
| Put HW into safe state, activate display safe mode and initialize it twice. More...
|
|
static void | print_error (term_t *term, color_t background_color) |
| print white error message on background More...
|
|
void | general_error (const char *error, const char *module) |
| Marlin stopped. More...
|
|
void | temp_error (const char *error, const char *module, float t_noz, float tt_noz, float t_bed, float tt_bed) |
|
void | _bsod (const char *fmt, const char *file_name, int line_number,...) |
|
◆ PADDING
◆ X_MAX
◆ tskTCB
◆ TCB_t
◆ get_fw_version()
117 uint16_t fw_parser = FW_VERSION;
119 FW_version[0] = (
uint8_t)(fw_parser / 100);
120 fw_parser -= FW_version[0] * 100;
121 FW_version[1] = (
uint8_t)(fw_parser / 10);
122 fw_parser -= FW_version[1] * 10;
123 FW_version[2] = (
uint8_t)fw_parser;
125 #ifdef PRERELEASE_STR
127 FW_version[0], FW_version[1], FW_version[2],
131 FW_version[1], FW_version[2]);
◆ stop_common()
Put HW into safe state, activate display safe mode and initialize it twice.
◆ print_error()
print white error message on background
It prints also firmware version on bottom of the screen.
- Parameters
-
term | input message |
background_color | background color |
◆ general_error()
Marlin stopped.
Disable interrupts, print red error message and stop in infinite loop.
Known possible reasons.
MSG_INVALID_EXTRUDER_NUM
MSG_T_THERMAL_RUNAWAY
MSG_T_HEATING_FAILED
MSG_T_MAXTEMP
MSG_T_MINTEMP
"Emergency stop (M112)"
"Inactive time kill"
- Parameters
-
error | Null terminated string shown in header |
module | Null terminated string shown in the rest of the screen |
195 gui_reset_jogwheel();
◆ temp_error()
void temp_error |
( |
const char * |
error, |
|
|
const char * |
module, |
|
|
float |
t_noz, |
|
|
float |
tt_noz, |
|
|
float |
t_bed, |
|
|
float |
tt_bed |
|
) |
| |
209 snprintf(buff,
sizeof(buff),
210 "The requested %s\ntemperature was not\nreached.\n\nNozzle temp: %d/%d\nBed temp: %d/%d",
211 module, (
int)t_noz, (
int)tt_noz, (
int)t_bed, (
int)tt_bed);
◆ _bsod()
void _bsod |
( |
const char * |
fmt, |
|
|
const char * |
file_name, |
|
|
int |
line_number, |
|
|
|
... |
|
) |
| |
217 va_start(
args, line_number);
240 pc = strrchr(file_name,
'/');
243 pc = strrchr(file_name,
'\\');
251 if ((file_name != 0) && (line_number != -1))
253 if (line_number != -1)
255 if ((file_name != 0) || (line_number != -1))
262 int lines_to_print = term.
rows - term.
row - 1;
263 int stack_sz = pTopOfStack - pBotOfStack;
266 if (stack_sz < lines_to_print * 2)
267 lastAddr = pBotOfStack - 1;
269 lastAddr = pTopOfStack - 2 * lines_to_print;
◆ FW_version_str
char FW_version_str[22] = { '\0' } |
◆ pxCurrentTCB
◆ hiwdg
Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
IWDG_HandleTypeDef hiwdg
Definition: watchdog.h:24
jogwheel_config_t jogwheel_config
Definition: jogwheel.c:95
void hwio_beeper_set_pwm(uint32_t per, uint32_t pul)
Definition: hwio_a3ides_2209_02.c:491
#define COLOR_NAVY
Definition: guitypes.h:56
bool error
Definition: auto_build.py:637
uint8_t row
Definition: term.h:51
uint8_t rows
Definition: term.h:45
#define COLOR_WHITE
Definition: guitypes.h:41
void hwio_safe_state(void)
Put hardware into safe state.
Definition: safe_state.c:8
void sys_reset(void)
Definition: sys.cpp:20
PRIVILEGED_INITIALIZED_DATA TCB_t *volatile pxCurrentTCB
Definition: tasks.c:372
#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
font_t * font
Definition: guitypes.h:110
void jogwheel_init(void)
Definition: jogwheel.c:16
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
uint8_t i
Definition: screen_test_graph.c:72
void general_error(const char *error, const char *module)
Marlin stopped.
Definition: bsod.c:174
display_draw_text_t * draw_text
Definition: display.h:35
static void get_fw_version(void)
Definition: bsod.c:115
StackType_t * pxStack
Definition: tasks.c:304
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
volatile StackType_t * pxTopOfStack
Definition: tasks.c:295
HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg)
#define IDR_PNG_icon_pepa_psod
Definition: resource.h:61
const int version_build_nr
build number
Definition: version.c:44
display_init_t * init
Definition: display.h:27
portSTACK_TYPE StackType_t
Definition: portmacro.h:97
void st7789v_enable_safe_mode(void)
enable safe mode (direct acces + safe delay)
Definition: st7789v.c:923
void render_term(rect_ui16_t rc, term_t *pt, font_t *font, color_t clr0, color_t clr1)
Definition: window_term.c:13
display_clear_t * clear
Definition: display.h:29
char pcTaskName[configMAX_TASK_NAME_LEN]
Definition: tasks.c:305
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
const uint8_t[]
Definition: 404_html.c:3
#define IDR_FNT_BIG
Definition: resource.h:11
display_t * display
Definition: display.c:6
char FW_version_str[22]
Definition: bsod.c:106
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
void term_init(term_t *pt, uint8_t cols, uint8_t rows, uint8_t *buff)
Definition: term.c:6
int vterm_printf(term_t *pt, const char *fmt, va_list va)
Definition: term.c:191
#define configMAX_TASK_NAME_LEN
Definition: FreeRTOSConfig.h:113
#define PADDING
Definition: bsod.c:135
#define COLOR_BLACK
Definition: guitypes.h:40
#define COLOR_RED_ALERT
Definition: guitypes.h:43
static void stop_common(void)
Put HW into safe state, activate display safe mode and initialize it twice.
Definition: bsod.c:139
static void print_error(term_t *term, color_t background_color)
print white error message on background
Definition: bsod.c:153
display_draw_icon_t * draw_icon
Definition: display.h:36
uint16_t w
Definition: display.h:25
#define TERM_BUFF_SIZE(c, r)
Definition: term.h:36
gui_defaults_t gui_defaults
Definition: gui.c:20
png_structrp png_const_color_16p background_color
Definition: png.h:1302
args
Definition: createSpeedLookupTable.py:17
display_draw_line_t * draw_line
Definition: display.h:31
uint8_t pinENC
Definition: jogwheel.h:23
int term_printf(term_t *pt, const char *fmt,...)
Definition: term.c:178
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
#define X_MAX
Definition: bsod.c:136