Browse Source

FORCE_INLINE before static

Scott Lahteine 7 years ago
parent
commit
8be7a0b131
3 changed files with 24 additions and 24 deletions
  1. 4
    4
      Marlin/MarlinSerial.h
  2. 6
    6
      Marlin/planner.h
  3. 14
    14
      Marlin/stepper.h

+ 4
- 4
Marlin/MarlinSerial.h View File

144
       static void printFloat(double, uint8_t);
144
       static void printFloat(double, uint8_t);
145
 
145
 
146
     public:
146
     public:
147
-      static FORCE_INLINE void write(const char* str) { while (*str) write(*str++); }
148
-      static FORCE_INLINE void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
149
-      static FORCE_INLINE void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
150
-      static FORCE_INLINE void print(const char* str) { write(str); }
147
+      FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); }
148
+      FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
149
+      FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
150
+      FORCE_INLINE static void print(const char* str) { write(str); }
151
 
151
 
152
       static void print(char, int = BYTE);
152
       static void print(char, int = BYTE);
153
       static void print(unsigned char, int = BYTE);
153
       static void print(unsigned char, int = BYTE);

+ 6
- 6
Marlin/planner.h View File

140
       static uint8_t last_extruder;             // Respond to extruder change
140
       static uint8_t last_extruder;             // Respond to extruder change
141
     #endif
141
     #endif
142
 
142
 
143
-    static int16_t flow_percentage[EXTRUDERS];  // Extrusion factor for each extruder
143
+    static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
144
 
144
 
145
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
145
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
146
                  filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
146
                  filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
388
      *  fr_mm_s      - (target) speed of the move (mm/s)
388
      *  fr_mm_s      - (target) speed of the move (mm/s)
389
      *  extruder     - target extruder
389
      *  extruder     - target extruder
390
      */
390
      */
391
-    static FORCE_INLINE void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder) {
391
+    FORCE_INLINE static void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder) {
392
       #if PLANNER_LEVELING && IS_CARTESIAN
392
       #if PLANNER_LEVELING && IS_CARTESIAN
393
         apply_leveling(rx, ry, rz);
393
         apply_leveling(rx, ry, rz);
394
       #endif
394
       #endif
404
      *  fr_mm_s  - (target) speed of the move (mm/s)
404
      *  fr_mm_s  - (target) speed of the move (mm/s)
405
      *  extruder - target extruder
405
      *  extruder - target extruder
406
      */
406
      */
407
-    static FORCE_INLINE void buffer_line_kinematic(const float cart[XYZE], const float &fr_mm_s, const uint8_t extruder) {
407
+    FORCE_INLINE static void buffer_line_kinematic(const float cart[XYZE], const float &fr_mm_s, const uint8_t extruder) {
408
       #if PLANNER_LEVELING
408
       #if PLANNER_LEVELING
409
         float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] };
409
         float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] };
410
         apply_leveling(raw);
410
         apply_leveling(raw);
428
      *
428
      *
429
      * Clears previous speed values.
429
      * Clears previous speed values.
430
      */
430
      */
431
-    static FORCE_INLINE void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
431
+    FORCE_INLINE static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
432
       #if PLANNER_LEVELING && IS_CARTESIAN
432
       #if PLANNER_LEVELING && IS_CARTESIAN
433
         apply_leveling(rx, ry, rz);
433
         apply_leveling(rx, ry, rz);
434
       #endif
434
       #endif
436
     }
436
     }
437
     static void set_position_mm_kinematic(const float position[NUM_AXIS]);
437
     static void set_position_mm_kinematic(const float position[NUM_AXIS]);
438
     static void set_position_mm(const AxisEnum axis, const float &v);
438
     static void set_position_mm(const AxisEnum axis, const float &v);
439
-    static FORCE_INLINE void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); }
440
-    static FORCE_INLINE void set_e_position_mm(const float &e) { set_position_mm(AxisEnum(E_AXIS), e); }
439
+    FORCE_INLINE static void set_z_position_mm(const float &z) { set_position_mm(Z_AXIS, z); }
440
+    FORCE_INLINE static void set_e_position_mm(const float &e) { set_position_mm(AxisEnum(E_AXIS), e); }
441
 
441
 
442
     /**
442
     /**
443
      * Sync from the stepper positions. (e.g., after an interrupted move)
443
      * Sync from the stepper positions. (e.g., after an interrupted move)

+ 14
- 14
Marlin/stepper.h View File

225
     // SCARA AB axes are in degrees, not mm
225
     // SCARA AB axes are in degrees, not mm
226
     //
226
     //
227
     #if IS_SCARA
227
     #if IS_SCARA
228
-      static FORCE_INLINE float get_axis_position_degrees(AxisEnum axis) { return get_axis_position_mm(axis); }
228
+      FORCE_INLINE static float get_axis_position_degrees(AxisEnum axis) { return get_axis_position_mm(axis); }
229
     #endif
229
     #endif
230
 
230
 
231
     //
231
     //
247
     //
247
     //
248
     // The direction of a single motor
248
     // The direction of a single motor
249
     //
249
     //
250
-    static FORCE_INLINE bool motor_direction(AxisEnum axis) { return TEST(last_direction_bits, axis); }
250
+    FORCE_INLINE static bool motor_direction(AxisEnum axis) { return TEST(last_direction_bits, axis); }
251
 
251
 
252
     #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
252
     #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
253
       static void digitalPotWrite(const int16_t address, const int16_t value);
253
       static void digitalPotWrite(const int16_t address, const int16_t value);
261
     #endif
261
     #endif
262
 
262
 
263
     #if ENABLED(X_DUAL_ENDSTOPS)
263
     #if ENABLED(X_DUAL_ENDSTOPS)
264
-      static FORCE_INLINE void set_homing_flag_x(const bool state) { performing_homing = state; }
265
-      static FORCE_INLINE void set_x_lock(const bool state) { locked_x_motor = state; }
266
-      static FORCE_INLINE void set_x2_lock(const bool state) { locked_x2_motor = state; }
264
+      FORCE_INLINE static void set_homing_flag_x(const bool state) { performing_homing = state; }
265
+      FORCE_INLINE static void set_x_lock(const bool state) { locked_x_motor = state; }
266
+      FORCE_INLINE static void set_x2_lock(const bool state) { locked_x2_motor = state; }
267
     #endif
267
     #endif
268
     #if ENABLED(Y_DUAL_ENDSTOPS)
268
     #if ENABLED(Y_DUAL_ENDSTOPS)
269
-      static FORCE_INLINE void set_homing_flag_y(const bool state) { performing_homing = state; }
270
-      static FORCE_INLINE void set_y_lock(const bool state) { locked_y_motor = state; }
271
-      static FORCE_INLINE void set_y2_lock(const bool state) { locked_y2_motor = state; }
269
+      FORCE_INLINE static void set_homing_flag_y(const bool state) { performing_homing = state; }
270
+      FORCE_INLINE static void set_y_lock(const bool state) { locked_y_motor = state; }
271
+      FORCE_INLINE static void set_y2_lock(const bool state) { locked_y2_motor = state; }
272
     #endif
272
     #endif
273
     #if ENABLED(Z_DUAL_ENDSTOPS)
273
     #if ENABLED(Z_DUAL_ENDSTOPS)
274
-      static FORCE_INLINE void set_homing_flag_z(const bool state) { performing_homing = state; }
275
-      static FORCE_INLINE void set_z_lock(const bool state) { locked_z_motor = state; }
276
-      static FORCE_INLINE void set_z2_lock(const bool state) { locked_z2_motor = state; }
274
+      FORCE_INLINE static void set_homing_flag_z(const bool state) { performing_homing = state; }
275
+      FORCE_INLINE static void set_z_lock(const bool state) { locked_z_motor = state; }
276
+      FORCE_INLINE static void set_z2_lock(const bool state) { locked_z2_motor = state; }
277
     #endif
277
     #endif
278
 
278
 
279
     #if ENABLED(BABYSTEPPING)
279
     #if ENABLED(BABYSTEPPING)
292
     //
292
     //
293
     // Triggered position of an axis in mm (not core-savvy)
293
     // Triggered position of an axis in mm (not core-savvy)
294
     //
294
     //
295
-    static FORCE_INLINE float triggered_position_mm(AxisEnum axis) {
295
+    FORCE_INLINE static float triggered_position_mm(AxisEnum axis) {
296
       return endstops_trigsteps[axis] * planner.steps_to_mm[axis];
296
       return endstops_trigsteps[axis] * planner.steps_to_mm[axis];
297
     }
297
     }
298
 
298
 
302
 
302
 
303
   private:
303
   private:
304
 
304
 
305
-    static FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
305
+    FORCE_INLINE static unsigned short calc_timer(unsigned short step_rate) {
306
       unsigned short timer;
306
       unsigned short timer;
307
 
307
 
308
       NOMORE(step_rate, MAX_STEP_FREQUENCY);
308
       NOMORE(step_rate, MAX_STEP_FREQUENCY);
344
 
344
 
345
     // Initialize the trapezoid generator from the current block.
345
     // Initialize the trapezoid generator from the current block.
346
     // Called whenever a new block begins.
346
     // Called whenever a new block begins.
347
-    static FORCE_INLINE void trapezoid_generator_reset() {
347
+    FORCE_INLINE static void trapezoid_generator_reset() {
348
 
348
 
349
       static int8_t last_extruder = -1;
349
       static int8_t last_extruder = -1;
350
 
350
 

Loading…
Cancel
Save