From e4ab0e598226e6d5fbca46dc7762af4ab6a83e6b Mon Sep 17 00:00:00 2001 From: Bernhard Date: Mon, 28 Nov 2011 22:11:17 +0100 Subject: [PATCH] more inlines --- Marlin/Marlin.pde | 16 ++++++++-------- Marlin/temperature.h | 2 +- Marlin/ultralcd.pde | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 11bdec4729..3c6791336f 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -289,7 +289,7 @@ void loop() } -inline void get_command() +FORCE_INLINE void get_command() { while( MSerial.available() > 0 && buflen < BUFSIZE) { serial_char = MSerial.read(); @@ -436,20 +436,20 @@ inline void get_command() } -inline float code_value() +FORCE_INLINE float code_value() { return (strtod(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL)); } -inline long code_value_long() +FORCE_INLINE long code_value_long() { return (strtol(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL, 10)); } -inline bool code_seen(char code_string[]) //Return True if the string was found +FORCE_INLINE bool code_seen(char code_string[]) //Return True if the string was found { return (strstr(cmdbuffer[bufindr], code_string) != NULL); } -inline bool code_seen(char code) +FORCE_INLINE bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); return (strchr_pointer != NULL); //Return True if a character was found @@ -481,7 +481,7 @@ inline bool code_seen(char code) endstops_hit_on_purpose();\ } -inline void process_commands() +FORCE_INLINE void process_commands() { unsigned long codenum; //throw away variable char *starpos = NULL; @@ -1075,7 +1075,7 @@ void ClearToSend() SERIAL_PROTOCOLLNPGM("ok"); } -inline void get_coordinates() +FORCE_INLINE void get_coordinates() { for(int8_t i=0; i < NUM_AXIS; i++) { if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i]; @@ -1087,7 +1087,7 @@ inline void get_coordinates() } } -inline void get_arc_coordinates() +FORCE_INLINE void get_arc_coordinates() { get_coordinates(); if(code_seen('I')) offset[0] = code_value(); diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 13a0e0c1f5..a12ef03109 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -69,7 +69,7 @@ FORCE_INLINE float degHotend(uint8_t extruder){ FORCE_INLINE float degTargetHotend0() { return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]);}; FORCE_INLINE float degTargetHotend1() { return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]);}; -inline float degTargetHotend(uint8_t extruder){ +FORCE_INLINE float degTargetHotend(uint8_t extruder){ if(extruder == 0) return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]); if(extruder == 1) return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]); }; diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index a4bb640b70..4ca93aa0c7 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -60,7 +60,7 @@ void lcdProgMemprint(const char *str) //=============================functions ============================ //=========================================================================== -inline int intround(const float &x){return int(0.5+x);} +FORCE_INLINE int intround(const float &x){return int(0.5+x);} void lcd_status(const char* message) { @@ -83,7 +83,7 @@ void lcd_statuspgm(const char* message) *target=0; } -inline void clear() +FORCE_INLINE void clear() { lcd.clear(); }