gcode_process.c: more preprocessor conditions for homing movements.

Well, optimizer isn't _that_ smart. It apparently removes
empty functions in the same compilation unit ( = source code file),
but not ones across units.

This saves 10 bytes binary size per endstop not used, so 30 bytes
in a standard configuration. All without any drawbacks.
This commit is contained in:
Markus Hitter 2014-05-25 19:06:07 +02:00
parent d53407bdc3
commit e76bfa0d05
1 changed files with 24 additions and 12 deletions

View File

@ -295,12 +295,18 @@ void process_gcode_command() {
//? //?
//? Find the minimum limit of the specified axes by searching for the limit switch. //? Find the minimum limit of the specified axes by searching for the limit switch.
//? //?
if (next_target.seen_X) #if defined X_MIN_PIN
home_x_negative(); if (next_target.seen_X)
if (next_target.seen_Y) home_x_negative();
home_y_negative(); #endif
if (next_target.seen_Z) #if defined Y_MIN_PIN
home_z_negative(); if (next_target.seen_Y)
home_y_negative();
#endif
#if defined Z_MIN_PIN
if (next_target.seen_Z)
home_z_negative();
#endif
break; break;
case 162: case 162:
@ -308,12 +314,18 @@ void process_gcode_command() {
//? //?
//? Find the maximum limit of the specified axes by searching for the limit switch. //? Find the maximum limit of the specified axes by searching for the limit switch.
//? //?
if (next_target.seen_X) #if defined X_MAX_PIN
home_x_positive(); if (next_target.seen_X)
if (next_target.seen_Y) home_x_positive();
home_y_positive(); #endif
if (next_target.seen_Z) #if defined Y_MAX_PIN
home_z_positive(); if (next_target.seen_Y)
home_y_positive();
#endif
#if defined Z_MAX_PIN
if (next_target.seen_Z)
home_z_positive();
#endif
break; break;
// unknown gcode: spit an error // unknown gcode: spit an error