|
@@ -62,6 +62,11 @@ millis_t next_lcd_update_ms;
|
62
|
62
|
|
63
|
63
|
uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
|
64
|
64
|
|
|
65
|
+#if ENABLED(DAC_STEPPER_CURRENT)
|
|
66
|
+ #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
|
|
67
|
+ uint16_t driverPercent[XYZE];
|
|
68
|
+#endif
|
|
69
|
+
|
65
|
70
|
#if ENABLED(ULTIPANEL)
|
66
|
71
|
|
67
|
72
|
// place-holders for Ki and Kd edits
|
|
@@ -114,6 +119,13 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
114
|
119
|
static void lcd_control_motion_menu();
|
115
|
120
|
static void lcd_control_volumetric_menu();
|
116
|
121
|
|
|
122
|
+ #if ENABLED(DAC_STEPPER_CURRENT)
|
|
123
|
+ static void dac_driver_commit();
|
|
124
|
+ static void dac_driver_getValues();
|
|
125
|
+ static void lcd_dac_menu();
|
|
126
|
+ static void lcd_dac_write_eeprom();
|
|
127
|
+ #endif
|
|
128
|
+
|
117
|
129
|
#if ENABLED(LCD_INFO_MENU)
|
118
|
130
|
#if ENABLED(PRINTCOUNTER)
|
119
|
131
|
static void lcd_info_stats_menu();
|
|
@@ -848,6 +860,32 @@ void kill_screen(const char* lcd_msg) {
|
848
|
860
|
|
849
|
861
|
/**
|
850
|
862
|
*
|
|
863
|
+ * "Driver current control" submenu items
|
|
864
|
+ *
|
|
865
|
+ */
|
|
866
|
+ #if ENABLED(DAC_STEPPER_CURRENT)
|
|
867
|
+ static void dac_driver_getValues() {LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent(i); }
|
|
868
|
+
|
|
869
|
+ static void dac_driver_commit() { dac_current_set_percents(driverPercent); }
|
|
870
|
+
|
|
871
|
+ static void dac_driver_eeprom_write() { dac_commit_eeprom(); }
|
|
872
|
+
|
|
873
|
+ static void lcd_dac_menu() {
|
|
874
|
+ dac_driver_getValues();
|
|
875
|
+ START_MENU();
|
|
876
|
+ MENU_ITEM(back, MSG_CONTROL);
|
|
877
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit);
|
|
878
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit);
|
|
879
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit);
|
|
880
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_E " " MSG_DAC_PERCENT, &driverPercent[E_AXIS], 0, 100, dac_driver_commit);
|
|
881
|
+ MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_driver_eeprom_write);
|
|
882
|
+ END_MENU();
|
|
883
|
+ }
|
|
884
|
+ #endif
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+ /**
|
|
888
|
+ *
|
851
|
889
|
* "Prepare" submenu items
|
852
|
890
|
*
|
853
|
891
|
*/
|
|
@@ -1529,6 +1567,10 @@ void kill_screen(const char* lcd_msg) {
|
1529
|
1567
|
#if ENABLED(FWRETRACT)
|
1530
|
1568
|
MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
|
1531
|
1569
|
#endif
|
|
1570
|
+ #if ENABLED(DAC_STEPPER_CURRENT)
|
|
1571
|
+ MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_dac_menu);
|
|
1572
|
+ #endif
|
|
1573
|
+
|
1532
|
1574
|
#if ENABLED(EEPROM_SETTINGS)
|
1533
|
1575
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
1534
|
1576
|
MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings);
|