Browse Source

Drop FORCE_INLINE in planner.h

This change actually does increase the binary size by about 12 bytes,
but how does it affect performance?
Scott Lahteine 8 years ago
parent
commit
ff53819856
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      Marlin/planner.h

+ 9
- 9
Marlin/planner.h View File

@@ -187,7 +187,7 @@ class Planner {
187 187
     /**
188 188
      * Number of moves currently in the planner
189 189
      */
190
-    static FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
190
+    static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
191 191
 
192 192
     #if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING)
193 193
 
@@ -233,13 +233,13 @@ class Planner {
233 233
     /**
234 234
      * Does the buffer have any blocks queued?
235 235
      */
236
-    static FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); }
236
+    static bool blocks_queued() { return (block_buffer_head != block_buffer_tail); }
237 237
 
238 238
     /**
239 239
      * "Discards" the block and "releases" the memory.
240 240
      * Called when the current block is no longer needed.
241 241
      */
242
-    static FORCE_INLINE void discard_current_block() {
242
+    static void discard_current_block() {
243 243
       if (blocks_queued())
244 244
         block_buffer_tail = BLOCK_MOD(block_buffer_tail + 1);
245 245
     }
@@ -248,7 +248,7 @@ class Planner {
248 248
      * The current block. NULL if the buffer is empty.
249 249
      * This also marks the block as busy.
250 250
      */
251
-    static FORCE_INLINE block_t* get_current_block() {
251
+    static block_t* get_current_block() {
252 252
       if (blocks_queued()) {
253 253
         block_t* block = &block_buffer[block_buffer_tail];
254 254
         block->busy = true;
@@ -272,14 +272,14 @@ class Planner {
272 272
     /**
273 273
      * Get the index of the next / previous block in the ring buffer
274 274
      */
275
-    static FORCE_INLINE int8_t next_block_index(int8_t block_index) { return BLOCK_MOD(block_index + 1); }
276
-    static FORCE_INLINE int8_t prev_block_index(int8_t block_index) { return BLOCK_MOD(block_index - 1); }
275
+    static int8_t next_block_index(int8_t block_index) { return BLOCK_MOD(block_index + 1); }
276
+    static int8_t prev_block_index(int8_t block_index) { return BLOCK_MOD(block_index - 1); }
277 277
 
278 278
     /**
279 279
      * Calculate the distance (not time) it takes to accelerate
280 280
      * from initial_rate to target_rate using the given acceleration:
281 281
      */
282
-    static FORCE_INLINE float estimate_acceleration_distance(float initial_rate, float target_rate, float acceleration) {
282
+    static float estimate_acceleration_distance(float initial_rate, float target_rate, float acceleration) {
283 283
       if (acceleration == 0) return 0; // acceleration was 0, set acceleration distance to 0
284 284
       return (target_rate * target_rate - initial_rate * initial_rate) / (acceleration * 2);
285 285
     }
@@ -292,7 +292,7 @@ class Planner {
292 292
      * This is used to compute the intersection point between acceleration and deceleration
293 293
      * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed)
294 294
      */
295
-    static FORCE_INLINE float intersection_distance(float initial_rate, float final_rate, float acceleration, float distance) {
295
+    static float intersection_distance(float initial_rate, float final_rate, float acceleration, float distance) {
296 296
       if (acceleration == 0) return 0; // acceleration was 0, set intersection distance to 0
297 297
       return (acceleration * 2 * distance - initial_rate * initial_rate + final_rate * final_rate) / (acceleration * 4);
298 298
     }
@@ -302,7 +302,7 @@ class Planner {
302 302
      * to reach 'target_velocity' using 'acceleration' within a given
303 303
      * 'distance'.
304 304
      */
305
-    static FORCE_INLINE float max_allowable_speed(float acceleration, float target_velocity, float distance) {
305
+    static float max_allowable_speed(float acceleration, float target_velocity, float distance) {
306 306
       return sqrt(target_velocity * target_velocity - 2 * acceleration * distance);
307 307
     }
308 308
 

Loading…
Cancel
Save