-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu_prepare.cpp
101 lines (90 loc) · 2.59 KB
/
menu_prepare.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "Marlin.h"
#include "language.h"
#include "temperature.h"
#include "ultralcd.h"
#ifdef ULTRA_LCD
#include "language.h"
#include "temperature.h"
#include "EEPROMwrite.h"
#include "cardreader.h"
extern CardReader card;
#define MP_DISABLE_STEPPERS 1
#define MP_AUTO_HOME 2
#define MP_SET_ORIGIN 3
#if 0
static void mp_ClickAutostart(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which)
{
#ifdef SDSUPPORT
card.lastnr=0;
card.setroot();
card.checkautostart(true);
#endif
beepshort();
}
#endif
static void mp_ClickEnqueue(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which)
{
switch (which) {
case MP_SET_ORIGIN:
enquecommand("G92 X0 Y0 Z0");
break;
case MP_AUTO_HOME:
enquecommand("G28");
break;
case MP_DISABLE_STEPPERS:
enquecommand("M84");
break;
default:
break;
}
beepshort();
}
#if EXTRUDERS > 0
static void mp_ClickPreheatPLA(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which)
{
setTargetHotend(plaPreheatHotendTemp, 0);
setTargetBed(plaPreheatHPBTemp);
#if FAN_PIN > -1
FanSpeed = plaPreheatFanSpeed;
analogWrite(FAN_PIN, FanSpeed);
#endif
beepshort();
}
static void mp_ClickPreheatABS(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which)
{
setTargetHotend(absPreheatHotendTemp, 0);
setTargetBed(absPreheatHPBTemp);
#if FAN_PIN > -1
FanSpeed = absPreheatFanSpeed;
analogWrite(FAN_PIN, FanSpeed);
#endif
beepshort();
}
static void mp_ClickCooldown(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which)
{
setTargetHotend(0,0);
setTargetHotend(0,1);
setTargetHotend(0,2);
setTargetBed(0);
beepshort();
}
#endif
static const menu_t menu[] __attribute__((__progmem__)) = {
{ MSG_MAIN, NULL, mct_ClickMenu, NULL, Main_Menu },
#if EXTRUDERS > 0
{ MSG_PREHEAT_PLA, NULL, mp_ClickPreheatPLA, NULL, 0 },
{ MSG_PREHEAT_ABS, NULL, mp_ClickPreheatABS, NULL, 0 },
{ MSG_COOLDOWN, NULL, mp_ClickCooldown, NULL, 0 },
#endif
{ MSG_MOVE_AXIS, NULL, mct_ClickMenu, NULL, Sub_PrepareMove },
{ MSG_DISABLE_STEPPERS,NULL, mp_ClickEnqueue, NULL, MP_DISABLE_STEPPERS },
{ MSG_AUTO_HOME, NULL, mp_ClickEnqueue, NULL, MP_AUTO_HOME },
{ MSG_SET_ORIGIN, NULL, mp_ClickEnqueue, NULL, MP_SET_ORIGIN },
//{ MSG_AUTOSTART, NULL, mp_ClickAutostart, NULL, 0 },
};
#define MENU_MAX (sizeof(menu) / sizeof(menu[0]))
void MainMenu::showPrepare()
{
show(menu, MENU_MAX);
}
#endif