|
@@ -44,7 +44,9 @@ static void lcd_status_screen();
|
44
|
44
|
|
45
|
45
|
#ifdef ULTIPANEL
|
46
|
46
|
|
47
|
|
- extern bool powersupply;
|
|
47
|
+ #if HAS_POWER_SWITCH
|
|
48
|
+ extern bool powersupply;
|
|
49
|
+ #endif
|
48
|
50
|
static float manual_feedrate[] = MANUAL_FEEDRATE;
|
49
|
51
|
static void lcd_main_menu();
|
50
|
52
|
static void lcd_tune_menu();
|
|
@@ -616,6 +618,7 @@ static void lcd_prepare_menu() {
|
616
|
618
|
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
617
|
619
|
MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
|
618
|
620
|
//MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
|
|
621
|
+
|
619
|
622
|
#if TEMP_SENSOR_0 != 0
|
620
|
623
|
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
|
621
|
624
|
MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu);
|
|
@@ -625,15 +628,16 @@ static void lcd_prepare_menu() {
|
625
|
628
|
MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0);
|
626
|
629
|
#endif
|
627
|
630
|
#endif
|
|
631
|
+
|
628
|
632
|
MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
|
629
|
|
- #if defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1
|
630
|
|
- if (powersupply) {
|
|
633
|
+
|
|
634
|
+ #if HAS_POWER_SWITCH
|
|
635
|
+ if (powersupply)
|
631
|
636
|
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
|
632
|
|
- }
|
633
|
|
- else {
|
|
637
|
+ else
|
634
|
638
|
MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
|
635
|
|
- }
|
636
|
639
|
#endif
|
|
640
|
+
|
637
|
641
|
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
|
638
|
642
|
|
639
|
643
|
#if defined(MANUAL_BED_LEVELING)
|
|
@@ -1338,7 +1342,7 @@ void lcd_update() {
|
1338
|
1342
|
}
|
1339
|
1343
|
|
1340
|
1344
|
lastEncoderMovementMillis = ms;
|
1341
|
|
- }
|
|
1345
|
+ } // encoderRateMultiplierEnabled
|
1342
|
1346
|
#endif //ENCODER_RATE_MULTIPLIER
|
1343
|
1347
|
|
1344
|
1348
|
lcdDrawUpdate = 1;
|
|
@@ -1541,70 +1545,62 @@ bool lcd_clicked() { return LCD_CLICKED; }
|
1541
|
1545
|
|
1542
|
1546
|
#endif //ULTIPANEL
|
1543
|
1547
|
|
1544
|
|
-/********************************/
|
1545
|
|
-/** Float conversion utilities **/
|
1546
|
|
-/********************************/
|
1547
|
|
-// convert float to string with +123.4 format
|
|
1548
|
+/*********************************/
|
|
1549
|
+/** Number to string conversion **/
|
|
1550
|
+/*********************************/
|
|
1551
|
+
|
1548
|
1552
|
char conv[8];
|
1549
|
|
-char *ftostr3(const float &x)
|
1550
|
|
-{
|
|
1553
|
+
|
|
1554
|
+// Convert float to string with +123.4 format
|
|
1555
|
+char *ftostr3(const float &x) {
|
1551
|
1556
|
return itostr3((int)x);
|
1552
|
1557
|
}
|
1553
|
1558
|
|
1554
|
|
-char *itostr2(const uint8_t &x)
|
1555
|
|
-{
|
|
1559
|
+// Convert int to string with 12 format
|
|
1560
|
+char *itostr2(const uint8_t &x) {
|
1556
|
1561
|
//sprintf(conv,"%5.1f",x);
|
1557
|
|
- int xx=x;
|
1558
|
|
- conv[0]=(xx/10)%10+'0';
|
1559
|
|
- conv[1]=(xx)%10+'0';
|
1560
|
|
- conv[2]=0;
|
|
1562
|
+ int xx = x;
|
|
1563
|
+ conv[0] = (xx / 10) % 10 + '0';
|
|
1564
|
+ conv[1] = xx % 10 + '0';
|
|
1565
|
+ conv[2] = 0;
|
1561
|
1566
|
return conv;
|
1562
|
1567
|
}
|
1563
|
1568
|
|
1564
|
|
-// Convert float to string with 123.4 format, dropping sign
|
1565
|
|
-char *ftostr31(const float &x)
|
1566
|
|
-{
|
1567
|
|
- int xx=x*10;
|
1568
|
|
- conv[0]=(xx>=0)?'+':'-';
|
1569
|
|
- xx=abs(xx);
|
1570
|
|
- conv[1]=(xx/1000)%10+'0';
|
1571
|
|
- conv[2]=(xx/100)%10+'0';
|
1572
|
|
- conv[3]=(xx/10)%10+'0';
|
1573
|
|
- conv[4]='.';
|
1574
|
|
- conv[5]=(xx)%10+'0';
|
1575
|
|
- conv[6]=0;
|
|
1569
|
+// Convert float to string with +123.4 format
|
|
1570
|
+char *ftostr31(const float &x) {
|
|
1571
|
+ int xx = abs(x * 10);
|
|
1572
|
+ conv[0] = (x >= 0) ? '+' : '-';
|
|
1573
|
+ conv[1] = (xx / 1000) % 10 + '0';
|
|
1574
|
+ conv[2] = (xx / 100) % 10 + '0';
|
|
1575
|
+ conv[3] = (xx / 10) % 10 + '0';
|
|
1576
|
+ conv[4] = '.';
|
|
1577
|
+ conv[5] = xx % 10 + '0';
|
|
1578
|
+ conv[6] = 0;
|
1576
|
1579
|
return conv;
|
1577
|
1580
|
}
|
1578
|
1581
|
|
1579
|
|
-// Convert float to string with 123.4 format
|
1580
|
|
-char *ftostr31ns(const float &x)
|
1581
|
|
-{
|
1582
|
|
- int xx=x*10;
|
1583
|
|
- //conv[0]=(xx>=0)?'+':'-';
|
1584
|
|
- xx=abs(xx);
|
1585
|
|
- conv[0]=(xx/1000)%10+'0';
|
1586
|
|
- conv[1]=(xx/100)%10+'0';
|
1587
|
|
- conv[2]=(xx/10)%10+'0';
|
1588
|
|
- conv[3]='.';
|
1589
|
|
- conv[4]=(xx)%10+'0';
|
1590
|
|
- conv[5]=0;
|
|
1582
|
+// Convert float to string with 123.4 format, dropping sign
|
|
1583
|
+char *ftostr31ns(const float &x) {
|
|
1584
|
+ int xx = abs(x * 10);
|
|
1585
|
+ conv[0] = (xx / 1000) % 10 + '0';
|
|
1586
|
+ conv[1] = (xx / 100) % 10 + '0';
|
|
1587
|
+ conv[2] = (xx / 10) % 10 + '0';
|
|
1588
|
+ conv[3] = '.';
|
|
1589
|
+ conv[4] = xx % 10 + '0';
|
|
1590
|
+ conv[5] = 0;
|
1591
|
1591
|
return conv;
|
1592
|
1592
|
}
|
1593
|
1593
|
|
1594
|
|
-char *ftostr32(const float &x)
|
1595
|
|
-{
|
1596
|
|
- long xx=x*100;
|
1597
|
|
- if (xx >= 0)
|
1598
|
|
- conv[0]=(xx/10000)%10+'0';
|
1599
|
|
- else
|
1600
|
|
- conv[0]='-';
|
1601
|
|
- xx=abs(xx);
|
1602
|
|
- conv[1]=(xx/1000)%10+'0';
|
1603
|
|
- conv[2]=(xx/100)%10+'0';
|
1604
|
|
- conv[3]='.';
|
1605
|
|
- conv[4]=(xx/10)%10+'0';
|
1606
|
|
- conv[5]=(xx)%10+'0';
|
1607
|
|
- conv[6]=0;
|
|
1594
|
+// Convert float to string with 123.4 format
|
|
1595
|
+char *ftostr32(const float &x) {
|
|
1596
|
+ long xx = abs(x * 100);
|
|
1597
|
+ conv[0] = x >= 0 ? (xx / 10000) % 10 + '0' : '-';
|
|
1598
|
+ conv[1] = (xx / 1000) % 10 + '0';
|
|
1599
|
+ conv[2] = (xx / 100) % 10 + '0';
|
|
1600
|
+ conv[3] = '.';
|
|
1601
|
+ conv[4] = (xx / 10) % 10 + '0';
|
|
1602
|
+ conv[5] = xx % 10 + '0';
|
|
1603
|
+ conv[6] = 0;
|
1608
|
1604
|
return conv;
|
1609
|
1605
|
}
|
1610
|
1606
|
|
|
@@ -1625,7 +1621,7 @@ char *ftostr43(const float &x)
|
1625
|
1621
|
return conv;
|
1626
|
1622
|
}
|
1627
|
1623
|
|
1628
|
|
-//Float to string with 1.23 format
|
|
1624
|
+// Convert float to string with 1.23 format
|
1629
|
1625
|
char *ftostr12ns(const float &x)
|
1630
|
1626
|
{
|
1631
|
1627
|
long xx=x*100;
|
|
@@ -1639,7 +1635,7 @@ char *ftostr12ns(const float &x)
|
1639
|
1635
|
return conv;
|
1640
|
1636
|
}
|
1641
|
1637
|
|
1642
|
|
-// convert float to space-padded string with -_23.4_ format
|
|
1638
|
+// Convert float to space-padded string with -_23.4_ format
|
1643
|
1639
|
char *ftostr32sp(const float &x) {
|
1644
|
1640
|
long xx = abs(x * 100);
|
1645
|
1641
|
uint8_t dig;
|
|
@@ -1685,58 +1681,51 @@ char *ftostr32sp(const float &x) {
|
1685
|
1681
|
return conv;
|
1686
|
1682
|
}
|
1687
|
1683
|
|
1688
|
|
-char *itostr31(const int &xx)
|
1689
|
|
-{
|
1690
|
|
- conv[0]=(xx>=0)?'+':'-';
|
1691
|
|
- conv[1]=(xx/1000)%10+'0';
|
1692
|
|
- conv[2]=(xx/100)%10+'0';
|
1693
|
|
- conv[3]=(xx/10)%10+'0';
|
1694
|
|
- conv[4]='.';
|
1695
|
|
- conv[5]=(xx)%10+'0';
|
1696
|
|
- conv[6]=0;
|
|
1684
|
+// Convert int to lj string with +123.0 format
|
|
1685
|
+char *itostr31(const int &x) {
|
|
1686
|
+ conv[0] = x >= 0 ? '+' : '-';
|
|
1687
|
+ int xx = abs(x);
|
|
1688
|
+ conv[1] = (xx / 100) % 10 + '0';
|
|
1689
|
+ conv[2] = (xx / 10) % 10 + '0';
|
|
1690
|
+ conv[3] = xx % 10 + '0';
|
|
1691
|
+ conv[4] = '.';
|
|
1692
|
+ conv[5] = '0';
|
|
1693
|
+ conv[6] = 0;
|
1697
|
1694
|
return conv;
|
1698
|
1695
|
}
|
1699
|
1696
|
|
1700
|
1697
|
// Convert int to rj string with 123 or -12 format
|
1701
|
|
-char *itostr3(const int &x)
|
1702
|
|
-{
|
|
1698
|
+char *itostr3(const int &x) {
|
1703
|
1699
|
int xx = x;
|
1704
|
1700
|
if (xx < 0) {
|
1705
|
|
- conv[0]='-';
|
|
1701
|
+ conv[0] = '-';
|
1706
|
1702
|
xx = -xx;
|
1707
|
|
- } else if (xx >= 100)
|
1708
|
|
- conv[0]=(xx/100)%10+'0';
|
1709
|
|
- else
|
1710
|
|
- conv[0]=' ';
|
1711
|
|
- if (xx >= 10)
|
1712
|
|
- conv[1]=(xx/10)%10+'0';
|
|
1703
|
+ }
|
1713
|
1704
|
else
|
1714
|
|
- conv[1]=' ';
|
1715
|
|
- conv[2]=(xx)%10+'0';
|
1716
|
|
- conv[3]=0;
|
|
1705
|
+ conv[0] = xx >= 100 ? (xx / 100) % 10 + '0' : ' ';
|
|
1706
|
+
|
|
1707
|
+ conv[1] = xx >= 10 ? (xx / 10) % 10 + '0' : ' ';
|
|
1708
|
+ conv[2] = xx % 10 + '0';
|
|
1709
|
+ conv[3] = 0;
|
1717
|
1710
|
return conv;
|
1718
|
1711
|
}
|
1719
|
1712
|
|
1720
|
1713
|
// Convert int to lj string with 123 format
|
1721
|
|
-char *itostr3left(const int &xx)
|
1722
|
|
-{
|
1723
|
|
- if (xx >= 100)
|
1724
|
|
- {
|
1725
|
|
- conv[0]=(xx/100)%10+'0';
|
1726
|
|
- conv[1]=(xx/10)%10+'0';
|
1727
|
|
- conv[2]=(xx)%10+'0';
|
1728
|
|
- conv[3]=0;
|
|
1714
|
+char *itostr3left(const int &xx) {
|
|
1715
|
+ if (xx >= 100) {
|
|
1716
|
+ conv[0] = (xx / 100) % 10 + '0';
|
|
1717
|
+ conv[1] = (xx / 10) % 10 + '0';
|
|
1718
|
+ conv[2] = xx % 10 + '0';
|
|
1719
|
+ conv[3] = 0;
|
1729
|
1720
|
}
|
1730
|
|
- else if (xx >= 10)
|
1731
|
|
- {
|
1732
|
|
- conv[0]=(xx/10)%10+'0';
|
1733
|
|
- conv[1]=(xx)%10+'0';
|
1734
|
|
- conv[2]=0;
|
|
1721
|
+ else if (xx >= 10) {
|
|
1722
|
+ conv[0] = (xx / 10) % 10 + '0';
|
|
1723
|
+ conv[1] = xx % 10 + '0';
|
|
1724
|
+ conv[2] = 0;
|
1735
|
1725
|
}
|
1736
|
|
- else
|
1737
|
|
- {
|
1738
|
|
- conv[0]=(xx)%10+'0';
|
1739
|
|
- conv[1]=0;
|
|
1726
|
+ else {
|
|
1727
|
+ conv[0] = xx % 10 + '0';
|
|
1728
|
+ conv[1] = 0;
|
1740
|
1729
|
}
|
1741
|
1730
|
return conv;
|
1742
|
1731
|
}
|
|
@@ -1764,34 +1753,30 @@ char *ftostr5(const float &x) {
|
1764
|
1753
|
}
|
1765
|
1754
|
|
1766
|
1755
|
// Convert float to string with +1234.5 format
|
1767
|
|
-char *ftostr51(const float &x)
|
1768
|
|
-{
|
1769
|
|
- long xx=x*10;
|
1770
|
|
- conv[0]=(xx>=0)?'+':'-';
|
1771
|
|
- xx=abs(xx);
|
1772
|
|
- conv[1]=(xx/10000)%10+'0';
|
1773
|
|
- conv[2]=(xx/1000)%10+'0';
|
1774
|
|
- conv[3]=(xx/100)%10+'0';
|
1775
|
|
- conv[4]=(xx/10)%10+'0';
|
1776
|
|
- conv[5]='.';
|
1777
|
|
- conv[6]=(xx)%10+'0';
|
1778
|
|
- conv[7]=0;
|
|
1756
|
+char *ftostr51(const float &x) {
|
|
1757
|
+ long xx = abs(x * 10);
|
|
1758
|
+ conv[0] = (x >= 0) ? '+' : '-';
|
|
1759
|
+ conv[1] = (xx / 10000) % 10 + '0';
|
|
1760
|
+ conv[2] = (xx / 1000) % 10 + '0';
|
|
1761
|
+ conv[3] = (xx / 100) % 10 + '0';
|
|
1762
|
+ conv[4] = (xx / 10) % 10 + '0';
|
|
1763
|
+ conv[5] = '.';
|
|
1764
|
+ conv[6] = xx % 10 + '0';
|
|
1765
|
+ conv[7] = 0;
|
1779
|
1766
|
return conv;
|
1780
|
1767
|
}
|
1781
|
1768
|
|
1782
|
1769
|
// Convert float to string with +123.45 format
|
1783
|
|
-char *ftostr52(const float &x)
|
1784
|
|
-{
|
1785
|
|
- long xx=x*100;
|
1786
|
|
- conv[0]=(xx>=0)?'+':'-';
|
1787
|
|
- xx=abs(xx);
|
1788
|
|
- conv[1]=(xx/10000)%10+'0';
|
1789
|
|
- conv[2]=(xx/1000)%10+'0';
|
1790
|
|
- conv[3]=(xx/100)%10+'0';
|
1791
|
|
- conv[4]='.';
|
1792
|
|
- conv[5]=(xx/10)%10+'0';
|
1793
|
|
- conv[6]=(xx)%10+'0';
|
1794
|
|
- conv[7]=0;
|
|
1770
|
+char *ftostr52(const float &x) {
|
|
1771
|
+ conv[0] = (x >= 0) ? '+' : '-';
|
|
1772
|
+ long xx = abs(x * 100);
|
|
1773
|
+ conv[1] = (xx / 10000) % 10 + '0';
|
|
1774
|
+ conv[2] = (xx / 1000) % 10 + '0';
|
|
1775
|
+ conv[3] = (xx / 100) % 10 + '0';
|
|
1776
|
+ conv[4] = '.';
|
|
1777
|
+ conv[5] = (xx / 10) % 10 + '0';
|
|
1778
|
+ conv[6] = xx % 10 + '0';
|
|
1779
|
+ conv[7] = 0;
|
1795
|
1780
|
return conv;
|
1796
|
1781
|
}
|
1797
|
1782
|
|