Browse Source

Option to use raw digipot values (#17536)

grauerfuchs 4 years ago
parent
commit
4a5a3d27ed
No account linked to committer's email address

+ 14
- 9
Marlin/Configuration_adv.h View File

@@ -926,9 +926,20 @@
926 926
 //#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
927 927
 //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
928 928
 
929
-// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro)
930
-//#define DIGIPOT_I2C
931
-#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)
929
+/**
930
+ * I2C-based DIGIPOTs (e.g., Azteeg X3 Pro)
931
+ */
932
+//#define DIGIPOT_MCP4018             // Requires https://github.com/stawel/SlowSoftI2CMaster
933
+//#define DIGIPOT_MCP4451
934
+#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
935
+  #define DIGIPOT_I2C_NUM_CHANNELS 8  // 5DPRINT:4   AZTEEG_X3_PRO:8   MKS_SBASE:5   MIGHTYBOARD_REVE:5
936
+
937
+  // Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS.
938
+  // These correspond to the physical drivers, so be mindful if the order is changed.
939
+  #define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
940
+
941
+  //#define DIGIPOT_USE_RAW_VALUES    // Use DIGIPOT_MOTOR_CURRENT raw wiper values (instead of A4988 motor currents)
942
+
932 943
   /**
933 944
    * Common slave addresses:
934 945
    *
@@ -943,12 +954,6 @@
943 954
   #define DIGIPOT_I2C_ADDRESS_B 0x2D  // unshifted slave address for second DIGIPOT
944 955
 #endif
945 956
 
946
-//#define DIGIPOT_MCP4018          // Requires library from https://github.com/stawel/SlowSoftI2CMaster
947
-#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4     AZTEEG_X3_PRO: 8     MKS SBASE: 5
948
-// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS.
949
-// These correspond to the physical drivers, so be mindful if the order is changed.
950
-#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }  //  AZTEEG_X3_PRO
951
-
952 957
 //===========================================================================
953 958
 //=============================Additional Features===========================
954 959
 //===========================================================================

+ 0
- 10
Marlin/src/HAL/AVR/inc/SanityCheck.h View File

@@ -26,16 +26,6 @@
26 26
  */
27 27
 
28 28
 /**
29
- * Digipot requirement
30
- */
31
- #if ENABLED(DIGIPOT_MCP4018)
32
-  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
33
-    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
34
-      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
35
-  #endif
36
-#endif
37
-
38
-/**
39 29
  * Checks for FAST PWM
40 30
  */
41 31
 #if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))

+ 1
- 1
Marlin/src/HAL/LPC1768/inc/SanityCheck.h View File

@@ -174,7 +174,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
174 174
 //
175 175
 // Flag any i2c pin conflicts
176 176
 //
177
-#if ANY(DIGIPOT_I2C, DIGIPOT_MCP4018, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM)
177
+#if ANY(HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM)
178 178
   #define USEDI2CDEV_M 1  // <Arduino>/Wire.cpp
179 179
 
180 180
   #if USEDI2CDEV_M == 0         // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1)

+ 2
- 2
Marlin/src/MarlinCore.cpp View File

@@ -70,7 +70,7 @@
70 70
   #include "libs/buzzer.h"
71 71
 #endif
72 72
 
73
-#if ENABLED(DIGIPOT_I2C)
73
+#if HAS_I2C_DIGIPOT
74 74
   #include "feature/digipot/digipot.h"
75 75
 #endif
76 76
 
@@ -1070,7 +1070,7 @@ void setup() {
1070 1070
     SETUP_RUN(enableStepperDrivers());
1071 1071
   #endif
1072 1072
 
1073
-  #if ENABLED(DIGIPOT_I2C)
1073
+  #if HAS_I2C_DIGIPOT
1074 1074
     SETUP_RUN(digipot_i2c_init());
1075 1075
   #endif
1076 1076
 

+ 34
- 36
Marlin/src/feature/digipot/digipot_mcp4018.cpp View File

@@ -22,53 +22,46 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018)
25
+#if ENABLED(DIGIPOT_MCP4018)
26 26
 
27 27
 #include <Stream.h>
28
-#include <SlowSoftI2CMaster.h>  //https://github.com/stawel/SlowSoftI2CMaster
28
+#include <SlowSoftI2CMaster.h>  // https://github.com/stawel/SlowSoftI2CMaster
29 29
 
30 30
 // Settings for the I2C based DIGIPOT (MCP4018) based on WT150
31 31
 
32 32
 #define DIGIPOT_A4988_Rsx               0.250
33 33
 #define DIGIPOT_A4988_Vrefmax           1.666
34
-#define DIGIPOT_A4988_MAX_VALUE         127
34
+#define DIGIPOT_MCP4018_MAX_VALUE     127
35 35
 
36
-#define DIGIPOT_A4988_Itripmax(Vref)    ((Vref)/(8.0*DIGIPOT_A4988_Rsx))
36
+#define DIGIPOT_A4988_Itripmax(Vref)    ((Vref) / (8.0 * DIGIPOT_A4988_Rsx))
37 37
 
38
-#define DIGIPOT_A4988_FACTOR            ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
38
+#define DIGIPOT_A4988_FACTOR            ((DIGIPOT_MCP4018_MAX_VALUE) / DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
39 39
 #define DIGIPOT_A4988_MAX_CURRENT       2.0
40 40
 
41 41
 static byte current_to_wiper(const float current) {
42
-  const int16_t value = ceil(float(DIGIPOT_A4988_FACTOR) * current);
43
-  return byte(constrain(value, 0, DIGIPOT_A4988_MAX_VALUE));
42
+  const int16_t value = TERN(DIGIPOT_USE_RAW_VALUES, current, CEIL(current * DIGIPOT_A4988_FACTOR));
43
+  return byte(constrain(value, 0, DIGIPOT_MCP4018_MAX_VALUE));
44 44
 }
45 45
 
46
-const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = {
47
-  DIGIPOTS_I2C_SDA_X
48
-  #if DIGIPOT_I2C_NUM_CHANNELS > 1
49
-    , DIGIPOTS_I2C_SDA_Y
50
-    #if DIGIPOT_I2C_NUM_CHANNELS > 2
51
-      , DIGIPOTS_I2C_SDA_Z
52
-      #if DIGIPOT_I2C_NUM_CHANNELS > 3
53
-        , DIGIPOTS_I2C_SDA_E0
54
-        #if DIGIPOT_I2C_NUM_CHANNELS > 4
55
-          , DIGIPOTS_I2C_SDA_E1
56
-        #endif
57
-      #endif
58
-    #endif
59
-  #endif
60
-};
61
-
62 46
 static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = {
63
-  SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL }
47
+  SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_X, DIGIPOTS_I2C_SCL)
64 48
   #if DIGIPOT_I2C_NUM_CHANNELS > 1
65
-    , SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL }
49
+    , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Y, DIGIPOTS_I2C_SCL)
66 50
     #if DIGIPOT_I2C_NUM_CHANNELS > 2
67
-      , SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL }
51
+      , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_Z, DIGIPOTS_I2C_SCL)
68 52
       #if DIGIPOT_I2C_NUM_CHANNELS > 3
69
-        , SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL }
53
+        , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E0, DIGIPOTS_I2C_SCL)
70 54
         #if DIGIPOT_I2C_NUM_CHANNELS > 4
71
-          , SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL }
55
+          , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E1, DIGIPOTS_I2C_SCL)
56
+          #if DIGIPOT_I2C_NUM_CHANNELS > 5
57
+            , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E2, DIGIPOTS_I2C_SCL)
58
+            #if DIGIPOT_I2C_NUM_CHANNELS > 6
59
+              , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E3, DIGIPOTS_I2C_SCL)
60
+              #if DIGIPOT_I2C_NUM_CHANNELS > 7
61
+                , SlowSoftI2CMaster(DIGIPOTS_I2C_SDA_E4, DIGIPOTS_I2C_SCL)
62
+              #endif
63
+            #endif
64
+          #endif
72 65
         #endif
73 66
       #endif
74 67
     #endif
@@ -85,18 +78,23 @@ static void i2c_send(const uint8_t channel, const byte v) {
85 78
 
86 79
 // This is for the MCP4018 I2C based digipot
87 80
 void digipot_i2c_set_current(const uint8_t channel, const float current) {
88
-  i2c_send(channel, current_to_wiper(_MIN(_MAX(current, 0), float(DIGIPOT_A4988_MAX_CURRENT))));
81
+  const float ival = _MIN(_MAX(current, 0), float(DIGIPOT_MCP4018_MAX_VALUE));
82
+  i2c_send(channel, current_to_wiper(ival));
89 83
 }
90 84
 
91 85
 void digipot_i2c_init() {
92
-  static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
93
-
94
-  LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS)
95
-    pots[i].i2c_init();
96
-
97
-  // setup initial currents as defined in Configuration_adv.h
86
+  LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS) pots[i].i2c_init();
87
+
88
+  // Init currents according to Configuration_adv.h
89
+  static const float digipot_motor_current[] PROGMEM =
90
+    #if ENABLED(DIGIPOT_USE_RAW_VALUES)
91
+      DIGIPOT_MOTOR_CURRENT
92
+    #else
93
+      DIGIPOT_I2C_MOTOR_CURRENTS
94
+    #endif
95
+  ;
98 96
   LOOP_L_N(i, COUNT(digipot_motor_current))
99 97
     digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
100 98
 }
101 99
 
102
-#endif // DIGIPOT_I2C && DIGIPOT_MCP4018
100
+#endif // DIGIPOT_MCP4018

+ 14
- 14
Marlin/src/feature/digipot/digipot_mcp4451.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018)
25
+#if ENABLED(DIGIPOT_MCP4451)
26 26
 
27 27
 #include <Stream.h>
28 28
 #include <Wire.h>
@@ -33,18 +33,18 @@
33 33
 
34 34
 // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
35 35
 #if MB(5DPRINT)
36
-  #define DIGIPOT_I2C_FACTOR 117.96
37
-  #define DIGIPOT_I2C_MAX_CURRENT 1.736
36
+  #define DIGIPOT_I2C_FACTOR      117.96f
37
+  #define DIGIPOT_I2C_MAX_CURRENT   1.736f
38 38
 #elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI)
39
-  #define DIGIPOT_I2C_FACTOR 113.5
40
-  #define DIGIPOT_I2C_MAX_CURRENT 2.0
39
+  #define DIGIPOT_I2C_FACTOR      113.5f
40
+  #define DIGIPOT_I2C_MAX_CURRENT   2.0f
41 41
 #else
42
-  #define DIGIPOT_I2C_FACTOR 106.7
43
-  #define DIGIPOT_I2C_MAX_CURRENT 2.5
42
+  #define DIGIPOT_I2C_FACTOR      106.7f
43
+  #define DIGIPOT_I2C_MAX_CURRENT   2.5f
44 44
 #endif
45 45
 
46 46
 static byte current_to_wiper(const float current) {
47
-  return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current))));
47
+  return byte(TERN(DIGIPOT_USE_RAW_VALUES, current, CEIL(DIGIPOT_I2C_FACTOR * current)));
48 48
 }
49 49
 
50 50
 static void digipot_i2c_send(const byte addr, const byte a, const byte b) {
@@ -62,8 +62,8 @@ static void digipot_i2c_send(const byte addr, const byte a, const byte b) {
62 62
 
63 63
 // This is for the MCP4451 I2C based digipot
64 64
 void digipot_i2c_set_current(const uint8_t channel, const float current) {
65
-  // these addresses are specific to Azteeg X3 Pro, can be set to others,
66
-  // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
65
+  // These addresses are specific to Azteeg X3 Pro, can be set to others.
66
+  // In this case first digipot is at address A0=0, A1=0, second one is at A0=0, A1=1
67 67
   const byte addr = channel < 4 ? DIGIPOT_I2C_ADDRESS_A : DIGIPOT_I2C_ADDRESS_B; // channel 0-3 vs 4-7
68 68
 
69 69
   // Initial setup
@@ -77,14 +77,14 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) {
77 77
 
78 78
 void digipot_i2c_init() {
79 79
   #if MB(MKS_SBASE)
80
-    configure_i2c(16); // Setting clock_option to 16 ensure the I2C bus is initialized at 400kHz
80
+    configure_i2c(16); // Set clock_option to 16 ensure I2C is initialized at 400kHz
81 81
   #else
82 82
     Wire.begin();
83 83
   #endif
84
-  // setup initial currents as defined in Configuration_adv.h
85
-  static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
84
+  // Set up initial currents as defined in Configuration_adv.h
85
+  static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS);
86 86
   LOOP_L_N(i, COUNT(digipot_motor_current))
87 87
     digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
88 88
 }
89 89
 
90
-#endif // DIGIPOT_I2C
90
+#endif // DIGIPOT_MCP4451

+ 4
- 4
Marlin/src/gcode/feature/digipot/M907-M910.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../../inc/MarlinConfig.h"
24 24
 
25
-#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
25
+#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || ENABLED(DAC_STEPPER_CURRENT)
26 26
 
27 27
 #include "../../gcode.h"
28 28
 
@@ -30,7 +30,7 @@
30 30
   #include "../../../module/stepper.h"
31 31
 #endif
32 32
 
33
-#if ENABLED(DIGIPOT_I2C)
33
+#if HAS_I2C_DIGIPOT
34 34
   #include "../../../feature/digipot/digipot.h"
35 35
 #endif
36 36
 
@@ -62,7 +62,7 @@ void GcodeSuite::M907() {
62 62
 
63 63
   #endif
64 64
 
65
-  #if ENABLED(DIGIPOT_I2C)
65
+  #if HAS_I2C_DIGIPOT
66 66
     // this one uses actual amps in floating point
67 67
     LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float());
68 68
     // Additional extruders use B,C,D for channels 4,5,6.
@@ -103,4 +103,4 @@ void GcodeSuite::M907() {
103 103
 
104 104
 #endif // DAC_STEPPER_CURRENT
105 105
 
106
-#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT || HAS_MOTOR_CURRENT_PWM || DIGIPOT_I2C
106
+#endif // HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || DAC_STEPPER_CURRENT

+ 1
- 1
Marlin/src/gcode/gcode.cpp View File

@@ -794,7 +794,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
794 794
         case 900: M900(); break;                                  // M900: Set advance K factor.
795 795
       #endif
796 796
 
797
-      #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
797
+      #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || ENABLED(DAC_STEPPER_CURRENT)
798 798
         case 907: M907(); break;                                  // M907: Set digital trimpot motor current using axis codes.
799 799
         #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
800 800
           case 908: M908(); break;                                // M908: Control digital trimpot directly.

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -938,7 +938,7 @@ private:
938 938
     static void M918();
939 939
   #endif
940 940
 
941
-  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
941
+  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || HAS_I2C_DIGIPOT || ENABLED(DAC_STEPPER_CURRENT)
942 942
     static void M907();
943 943
     #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
944 944
       static void M908();

+ 4
- 0
Marlin/src/inc/Conditionals_adv.h View File

@@ -113,6 +113,10 @@
113 113
   #define HAS_LEDS_OFF_FLAG 1
114 114
 #endif
115 115
 
116
+#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
117
+  #define HAS_I2C_DIGIPOT 1
118
+#endif
119
+
116 120
 // Multiple Z steppers
117 121
 #ifndef NUM_Z_STEPPER_DRIVERS
118 122
   #define NUM_Z_STEPPER_DRIVERS 1

+ 9
- 3
Marlin/src/inc/SanityCheck.h View File

@@ -497,6 +497,8 @@
497 497
   #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM. Please update Configuration_adv.h."
498 498
 #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
499 499
   #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM. Please update Configuration_adv.h."
500
+#elif defined(DIGIPOT_I2C)
501
+  #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018). Please update Configuration_adv.h."
500 502
 #endif
501 503
 
502 504
 /**
@@ -1587,6 +1589,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1587 1589
 // Pins are required for heaters
1588 1590
 #if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
1589 1591
   #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
1592
+#elif HOTENDS && !HAS_TEMP_HOTEND
1593
+  #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
1590 1594
 #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
1591 1595
   #error "HEATER_1_PIN not defined for this board."
1592 1596
 #endif
@@ -2443,10 +2447,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
2443 2447
 /**
2444 2448
  * Digipot requirement
2445 2449
  */
2446
-#if ENABLED(DIGIPOT_MCP4018)
2447
-  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
2450
+#if HAS_I2C_DIGIPOT
2451
+  #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
2452
+    #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
2453
+  #elif !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
2448 2454
     || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
2449
-      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
2455
+      #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
2450 2456
   #endif
2451 2457
 #endif
2452 2458
 

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp View File

@@ -780,7 +780,7 @@ namespace ExtUI {
780 780
      */
781 781
     int16_t mmToWholeSteps(const float mm, const axis_t axis) {
782 782
       const float steps = mm / planner.steps_to_mm[axis];
783
-      return steps > 0 ? ceil(steps) : floor(steps);
783
+      return steps > 0 ? CEIL(steps) : FLOOR(steps);
784 784
     }
785 785
   #endif
786 786
 

+ 5
- 3
buildroot/share/tests/mega2560-tests View File

@@ -127,13 +127,15 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Cyrillic"
127 127
 # Test many less common options
128 128
 #
129 129
 restore_configs
130
-opt_set MOTHERBOARD BOARD_MEGATRONICS_32
130
+opt_set MOTHERBOARD BOARD_MIGHTYBOARD_REVE
131
+opt_set TEMP_SENSOR_0 -2
132
+opt_set DIGIPOT_I2C_NUM_CHANNELS 5
131 133
 opt_set LCD_LANGUAGE it
132 134
 opt_set MIXING_STEPPERS 2
133 135
 opt_set SERVO_DELAY "{ 300, 300, 300 }"
134 136
 opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \
135 137
            BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \
136
-           REPRAP_DISCOUNT_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \
138
+           REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \
137 139
            ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \
138 140
            FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR \
139 141
            Z_SAFE_HOMING SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \
@@ -143,7 +145,7 @@ opt_set FAN_MIN_PWM 50
143 145
 opt_set FAN_KICKSTART_TIME 100
144 146
 opt_set XY_FREQUENCY_LIMIT 15
145 147
 opt_add FILWIDTH_PIN 5
146
-exec_test $1 $2 "Megatronics 3.2 | Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..."
148
+exec_test $1 $2 "Mightyboard Rev. E | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..."
147 149
 
148 150
 ######## Other Standard LCD/Panels ##############
149 151
 #

Loading…
Cancel
Save