Browse Source

more inlines

Bernhard 13 years ago
parent
commit
e4ab0e5982
3 changed files with 11 additions and 11 deletions
  1. 8
    8
      Marlin/Marlin.pde
  2. 1
    1
      Marlin/temperature.h
  3. 2
    2
      Marlin/ultralcd.pde

+ 8
- 8
Marlin/Marlin.pde View File

289
 }
289
 }
290
 
290
 
291
 
291
 
292
-inline void get_command() 
292
+FORCE_INLINE void get_command() 
293
 { 
293
 { 
294
   while( MSerial.available() > 0  && buflen < BUFSIZE) {
294
   while( MSerial.available() > 0  && buflen < BUFSIZE) {
295
     serial_char = MSerial.read();
295
     serial_char = MSerial.read();
436
 }
436
 }
437
 
437
 
438
 
438
 
439
-inline float code_value() 
439
+FORCE_INLINE float code_value() 
440
 { 
440
 { 
441
   return (strtod(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL)); 
441
   return (strtod(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL)); 
442
 }
442
 }
443
-inline long code_value_long() 
443
+FORCE_INLINE long code_value_long() 
444
 { 
444
 { 
445
   return (strtol(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL, 10)); 
445
   return (strtol(&cmdbuffer[bufindr][strchr_pointer - cmdbuffer[bufindr] + 1], NULL, 10)); 
446
 }
446
 }
447
-inline bool code_seen(char code_string[]) //Return True if the string was found
447
+FORCE_INLINE bool code_seen(char code_string[]) //Return True if the string was found
448
 { 
448
 { 
449
   return (strstr(cmdbuffer[bufindr], code_string) != NULL); 
449
   return (strstr(cmdbuffer[bufindr], code_string) != NULL); 
450
 }  
450
 }  
451
 
451
 
452
-inline bool code_seen(char code)
452
+FORCE_INLINE bool code_seen(char code)
453
 {
453
 {
454
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
454
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
455
   return (strchr_pointer != NULL);  //Return True if a character was found
455
   return (strchr_pointer != NULL);  //Return True if a character was found
481
     endstops_hit_on_purpose();\
481
     endstops_hit_on_purpose();\
482
   }
482
   }
483
 
483
 
484
-inline void process_commands()
484
+FORCE_INLINE void process_commands()
485
 {
485
 {
486
   unsigned long codenum; //throw away variable
486
   unsigned long codenum; //throw away variable
487
   char *starpos = NULL;
487
   char *starpos = NULL;
1075
   SERIAL_PROTOCOLLNPGM("ok"); 
1075
   SERIAL_PROTOCOLLNPGM("ok"); 
1076
 }
1076
 }
1077
 
1077
 
1078
-inline void get_coordinates()
1078
+FORCE_INLINE void get_coordinates()
1079
 {
1079
 {
1080
   for(int8_t i=0; i < NUM_AXIS; i++) {
1080
   for(int8_t i=0; i < NUM_AXIS; i++) {
1081
     if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
1081
     if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
1087
   }
1087
   }
1088
 }
1088
 }
1089
 
1089
 
1090
-inline void get_arc_coordinates()
1090
+FORCE_INLINE void get_arc_coordinates()
1091
 {
1091
 {
1092
    get_coordinates();
1092
    get_coordinates();
1093
    if(code_seen('I')) offset[0] = code_value();
1093
    if(code_seen('I')) offset[0] = code_value();

+ 1
- 1
Marlin/temperature.h View File

69
 
69
 
70
 FORCE_INLINE float degTargetHotend0() {  return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]);};
70
 FORCE_INLINE float degTargetHotend0() {  return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]);};
71
 FORCE_INLINE float degTargetHotend1() {  return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]);};
71
 FORCE_INLINE float degTargetHotend1() {  return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]);};
72
-inline float degTargetHotend(uint8_t extruder){  
72
+FORCE_INLINE float degTargetHotend(uint8_t extruder){  
73
   if(extruder == 0) return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]);
73
   if(extruder == 0) return analog2temp(target_raw[TEMPSENSOR_HOTEND_0]);
74
   if(extruder == 1) return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]);
74
   if(extruder == 1) return analog2temp(target_raw[TEMPSENSOR_HOTEND_1]);
75
 };
75
 };

+ 2
- 2
Marlin/ultralcd.pde View File

60
 //=============================functions         ============================
60
 //=============================functions         ============================
61
 //===========================================================================
61
 //===========================================================================
62
 
62
 
63
-inline int intround(const float &x){return int(0.5+x);}
63
+FORCE_INLINE int intround(const float &x){return int(0.5+x);}
64
 
64
 
65
 void lcd_status(const char* message)
65
 void lcd_status(const char* message)
66
 {
66
 {
83
   *target=0;
83
   *target=0;
84
 }
84
 }
85
 
85
 
86
-inline void clear()
86
+FORCE_INLINE void clear()
87
 {
87
 {
88
   lcd.clear();
88
   lcd.clear();
89
 }
89
 }

Loading…
Cancel
Save