Prusa MINI Firmware overview
screen_menu_temperature.c File Reference
#include "gui.h"
#include "screen_menu.h"
#include "marlin_client.h"
#include "menu_vars.h"

Enumerations

enum  MI_t {
  MI_RETURN, MI_RETURN, MI_WIZARD, MI_Z_OFFSET,
  MI_AUTO_HOME, MI_MESH_BED, MI_SELFTEST, MI_CALIB_FIRST,
  MI_RETURN, MI_LOAD, MI_UNLOAD, MI_CHANGE,
  MI_PURGE, MI_RETURN, MI_ALWAYS, MI_ON_RESTART,
  MI_COUNT, MI_RETURN, MI_SYS_INFO, MI_VERSIONS,
  MI_RETURN, MI_MOVE_X, MI_MOVE_Y, MI_MOVE_Z,
  MI_MOVE_E, MI_RETURN, MI_SYS_RESET, MI_CLR_EEPROM,
  MI_WDG_TEST, MI_PLL, MI_SSCG, MI_SSCG_FREQ,
  MI_SSCG_DEPTH, MI_SPI_PRESC, MI_MESH, MI_BSOD,
  MI_BSOD_HARD_FAULT, MI_COUNT, MI_RETURN, MI_TEMPERATURE,
  MI_MOVE_AXIS, MI_DISABLE_STEP, MI_FACTORY_DEFAULTS, MI_FW_UPDATE,
  MI_FILAMENT_SENSOR, MI_TIMEOUT, MI_LAN_SETTINGS, MI_RETURN,
  MI_NOZZLE, MI_HEATBED, MI_PRINTFAN, MI_COOLDOWN,
  MI_RETURN, MI_NOZZLE, MI_HEAT_PWM_PERIOD, MI_HEATBED,
  MI_FAN_PWM_PERIOD, MI_PRINTFAN, MI_COOLDOWN, MI_COUNT
}
 

Functions

void screen_menu_temperature_init (screen_t *screen)
 
int screen_menu_temperature_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

const menu_item_t _menu_temperature_items []
 
screen_t screen_menu_temperature
 
const screen_tpscreen_menu_temperature = &screen_menu_temperature
 

Enumeration Type Documentation

◆ MI_t

enum MI_t
Enumerator
MI_RETURN 
MI_RETURN 
MI_WIZARD 
MI_Z_OFFSET 
MI_AUTO_HOME 
MI_MESH_BED 
MI_SELFTEST 
MI_CALIB_FIRST 
MI_RETURN 
MI_LOAD 
MI_UNLOAD 
MI_CHANGE 
MI_PURGE 
MI_RETURN 
MI_ALWAYS 
MI_ON_RESTART 
MI_COUNT 
MI_RETURN 
MI_SYS_INFO 
MI_VERSIONS 
MI_RETURN 
MI_MOVE_X 
MI_MOVE_Y 
MI_MOVE_Z 
MI_MOVE_E 
MI_RETURN 
MI_SYS_RESET 
MI_CLR_EEPROM 
MI_WDG_TEST 
MI_PLL 
MI_SSCG 
MI_SSCG_FREQ 
MI_SSCG_DEPTH 
MI_SPI_PRESC 
MI_MESH 
MI_BSOD 
MI_BSOD_HARD_FAULT 
MI_COUNT 
MI_RETURN 
MI_TEMPERATURE 
MI_MOVE_AXIS 
MI_DISABLE_STEP 
MI_FACTORY_DEFAULTS 
MI_FW_UPDATE 
MI_FILAMENT_SENSOR 
MI_TIMEOUT 
MI_LAN_SETTINGS 
MI_RETURN 
MI_NOZZLE 
MI_HEATBED 
MI_PRINTFAN 
MI_COOLDOWN 
MI_RETURN 
MI_NOZZLE 
MI_HEAT_PWM_PERIOD 
MI_HEATBED 
MI_FAN_PWM_PERIOD 
MI_PRINTFAN 
MI_COOLDOWN 
MI_COUNT 
9  {
10  MI_RETURN,
11  MI_NOZZLE,
12  MI_HEATBED,
15 } MI_t;

Function Documentation

◆ screen_menu_temperature_init()

void screen_menu_temperature_init ( screen_t screen)
24  {
25  marlin_vars_t *vars;
26  int count = sizeof(_menu_temperature_items) / sizeof(menu_item_t);
27  screen_menu_init(screen, "TEMPERATURE", count + 1, 1, 0);
29  memcpy(psmd->items + 1, _menu_temperature_items, count * sizeof(menu_item_t));
30 
31  vars = marlin_update_vars(
33  psmd->items[MI_NOZZLE].item.wi_spin.value = (int32_t)(vars->target_nozzle * 1000);
34  psmd->items[MI_HEATBED].item.wi_spin.value = (int32_t)(vars->target_bed * 1000);
35  psmd->items[MI_PRINTFAN].item.wi_spin.value = (int32_t)(vars->fan_speed * 1000);
36 }
Here is the call graph for this function:

◆ screen_menu_temperature_event()

int screen_menu_temperature_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
38  {
39  if (screen_menu_event(screen, window, event, param))
40  return 1;
41  if (event == WINDOW_EVENT_CHANGE) {
42  switch ((int)param) {
43  case MI_NOZZLE:
44  marlin_set_target_nozzle(psmd->items[MI_NOZZLE].item.wi_spin.value / 1000);
45  break;
46  case MI_HEATBED:
47  marlin_set_target_bed(psmd->items[MI_HEATBED].item.wi_spin.value / 1000);
48  break;
49  case MI_PRINTFAN:
50  marlin_set_fan_speed(psmd->items[MI_PRINTFAN].item.wi_spin.value / 1000);
51  break;
52  }
53  } else if ((event == WINDOW_EVENT_CLICK) && (int)param == MI_COOLDOWN) {
57  psmd->items[MI_NOZZLE].item.wi_spin.value = 0;
58  psmd->items[MI_HEATBED].item.wi_spin.value = 0;
59  psmd->items[MI_PRINTFAN].item.wi_spin.value = 0;
60  _window_invalidate(&(psmd->root.win));
61  }
62  return 0;
63 }
Here is the call graph for this function:

Variable Documentation

◆ _menu_temperature_items

const menu_item_t _menu_temperature_items[]
Initial value:
= {
{ { "Nozzle", 0, WI_SPIN, .wi_spin = { 0, nozzle_range } }, SCREEN_MENU_NO_SCREEN },
{ { "Heatbed", 0, WI_SPIN, .wi_spin = { 0, heatbed_range } }, SCREEN_MENU_NO_SCREEN },
{ { "Print Fan", 0, WI_SPIN, .wi_spin = { 0, printfan_range } }, SCREEN_MENU_NO_SCREEN },
{ { "Cooldown", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
}

◆ screen_menu_temperature

◆ pscreen_menu_temperature

const screen_t* pscreen_menu_temperature = &screen_menu_temperature
printfan_range
const int32_t printfan_range[3]
Definition: menu_vars.cpp:33
_menu_item_t
Definition: screen_menu.h:19
marlin_set_target_nozzle
float marlin_set_target_nozzle(float val)
Definition: marlin_client.c:401
screen_menu_draw
void screen_menu_draw(screen_t *screen)
Definition: screen_menu.c:90
screen_menu_temperature_event
int screen_menu_temperature_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_menu_temperature.c:38
marlin_set_target_bed
float marlin_set_target_bed(float val)
Definition: marlin_client.c:405
screen_menu_event
int screen_menu_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_menu.c:92
MARLIN_VAR_FANSPEED
#define MARLIN_VAR_FANSPEED
Definition: marlin_vars.h:24
screen_menu_done
void screen_menu_done(screen_t *screen)
Definition: screen_menu.c:78
MARLIN_VAR_TTEM_BED
#define MARLIN_VAR_TTEM_BED
Definition: marlin_vars.h:22
MI_RETURN
Definition: screen_menu_temperature.c:10
MI_NOZZLE
Definition: screen_menu_temperature.c:11
SCREEN_MENU_NO_SCREEN
#define SCREEN_MENU_NO_SCREEN
Definition: screen_menu.h:39
_menu_temperature_items
const menu_item_t _menu_temperature_items[]
Definition: screen_menu_temperature.c:17
WI_SPIN
Definition: window_menu.h:15
WINDOW_EVENT_CHANGE
#define WINDOW_EVENT_CHANGE
Definition: window.h:47
screen_menu_temperature_init
void screen_menu_temperature_init(screen_t *screen)
Definition: screen_menu_temperature.c:24
MI_PRINTFAN
Definition: screen_menu_temperature.c:13
MI_COOLDOWN
Definition: screen_menu_temperature.c:14
screen_menu_init
void screen_menu_init(screen_t *screen, const char *label, int count, uint8_t footer, uint8_t help)
Definition: screen_menu.c:25
MI_t
MI_t
Definition: screen_menu_temperature.c:9
MI_HEATBED
Definition: screen_menu_temperature.c:12
_marlin_vars_t::target_nozzle
float target_nozzle
Definition: marlin_vars.h:85
psmd
#define psmd
Definition: screen_menu.h:40
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
WI_LABEL
Definition: window_menu.h:14
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
menu_item_return
const menu_item_t menu_item_return
Definition: screen_menu.c:14
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
screen_menu_data_t
Definition: screen_menu.h:24
_marlin_vars_t
Definition: marlin_vars.h:77
marlin_set_fan_speed
uint8_t marlin_set_fan_speed(uint8_t val)
Definition: marlin_client.c:413
MARLIN_VAR_TTEM_NOZ
#define MARLIN_VAR_TTEM_NOZ
Definition: marlin_vars.h:21
nozzle_range
const int32_t nozzle_range[3]
Definition: menu_vars.cpp:31
_marlin_vars_t::target_bed
float target_bed
Definition: marlin_vars.h:86
_window_invalidate
static void _window_invalidate(window_t *window)
Definition: window.h:257
heatbed_range
const int32_t heatbed_range[3]
Definition: menu_vars.cpp:32
_marlin_vars_t::fan_speed
uint8_t fan_speed
Definition: marlin_vars.h:88