Browse Source

Use bit-length types in block_t

Scott Lahteine 7 years ago
parent
commit
23f05f8be7
1 changed files with 25 additions and 24 deletions
  1. 25
    24
      Marlin/planner.h

+ 25
- 24
Marlin/planner.h View File

@@ -74,53 +74,54 @@ enum BlockFlag {
74 74
  */
75 75
 typedef struct {
76 76
 
77
+  uint8_t flag;                             // Block flags (See BlockFlag enum above)
78
+
77 79
   unsigned char active_extruder;            // The extruder to move (if E move)
78 80
 
79
-  // Fields used by the bresenham algorithm for tracing the line
80
-  long steps[NUM_AXIS];                     // Step count along each axis
81
-  unsigned long step_event_count;           // The number of step events required to complete this block
81
+  // Fields used by the Bresenham algorithm for tracing the line
82
+  int32_t steps[NUM_AXIS];                  // Step count along each axis
83
+  uint32_t step_event_count;                // The number of step events required to complete this block
82 84
 
83 85
   #if ENABLED(MIXING_EXTRUDER)
84
-    unsigned long mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers
86
+    uint32_t mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers
85 87
   #endif
86 88
 
87
-  long accelerate_until,                    // The index of the step event on which to stop acceleration
88
-       decelerate_after,                    // The index of the step event on which to start decelerating
89
-       acceleration_rate;                   // The acceleration rate used for acceleration calculation
89
+  int32_t accelerate_until,                 // The index of the step event on which to stop acceleration
90
+          decelerate_after,                 // The index of the step event on which to start decelerating
91
+          acceleration_rate;                // The acceleration rate used for acceleration calculation
90 92
 
91
-  unsigned char direction_bits;             // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
93
+  uint8_t direction_bits;                   // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
92 94
 
93 95
   // Advance extrusion
94 96
   #if ENABLED(LIN_ADVANCE)
95 97
     bool use_advance_lead;
96
-    int e_speed_multiplier8; // Factorised by 2^8 to avoid float
98
+    int16_t e_speed_multiplier8; // Factorised by 2^8 to avoid float
97 99
   #elif ENABLED(ADVANCE)
98
-    long advance_rate;
99
-    volatile long initial_advance;
100
-    volatile long final_advance;
100
+    int32_t advance_rate;
101
+    volatile int32_t initial_advance;
102
+    volatile int32_t final_advance;
101 103
     float advance;
102 104
   #endif
103 105
 
104 106
   // Fields used by the motion planner to manage acceleration
105
-  float nominal_speed,                          // The nominal speed for this block in mm/sec
106
-        entry_speed,                            // Entry speed at previous-current junction in mm/sec
107
-        max_entry_speed,                        // Maximum allowable junction entry speed in mm/sec
108
-        millimeters,                            // The total travel of this block in mm
109
-        acceleration;                           // acceleration mm/sec^2
110
-  uint8_t flag;                                 // Block flags (See BlockFlag enum above)
107
+  float nominal_speed,                      // The nominal speed for this block in mm/sec
108
+        entry_speed,                        // Entry speed at previous-current junction in mm/sec
109
+        max_entry_speed,                    // Maximum allowable junction entry speed in mm/sec
110
+        millimeters,                        // The total travel of this block in mm
111
+        acceleration;                       // acceleration mm/sec^2
111 112
 
112 113
   // Settings for the trapezoid generator
113
-  uint32_t nominal_rate,                        // The nominal step rate for this block in step_events/sec
114
-           initial_rate,                        // The jerk-adjusted step rate at start of block
115
-           final_rate,                          // The minimal rate at exit
116
-           acceleration_steps_per_s2;           // acceleration steps/sec^2
114
+  uint32_t nominal_rate,                    // The nominal step rate for this block in step_events/sec
115
+           initial_rate,                    // The jerk-adjusted step rate at start of block
116
+           final_rate,                      // The minimal rate at exit
117
+           acceleration_steps_per_s2;       // acceleration steps/sec^2
117 118
 
118 119
   #if FAN_COUNT > 0
119
-    unsigned long fan_speed[FAN_COUNT];
120
+    uint32_t fan_speed[FAN_COUNT];
120 121
   #endif
121 122
 
122 123
   #if ENABLED(BARICUDA)
123
-    unsigned long valve_pressure, e_to_p_pressure;
124
+    uint32_t valve_pressure, e_to_p_pressure;
124 125
   #endif
125 126
 
126 127
 } block_t;

Loading…
Cancel
Save