Browse Source

Merge pull request #5368 from thinkyhead/rc_croatian_update

Save PROGMEM with string changes
Scott Lahteine 8 years ago
parent
commit
0b9b529745
2 changed files with 25 additions and 38 deletions
  1. 22
    27
      Marlin/Marlin_main.cpp
  2. 3
    11
      Marlin/pinsDebug.h

+ 22
- 27
Marlin/Marlin_main.cpp View File

3551
     stepper.synchronize();
3551
     stepper.synchronize();
3552
   }
3552
   }
3553
 
3553
 
3554
+  // Save 130 bytes with non-duplication of PSTR
3555
+  void say_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); }
3556
+
3554
   /**
3557
   /**
3555
    * G29: Mesh-based Z probe, probes a grid and produces a
3558
    * G29: Mesh-based Z probe, probes a grid and produces a
3556
    *      mesh to compensate for variable bed height
3559
    *      mesh to compensate for variable bed height
3663
           }
3666
           }
3664
         }
3667
         }
3665
         else {
3668
         else {
3666
-          SERIAL_CHAR('X'); SERIAL_PROTOCOLLNPGM(" not entered.");
3669
+          SERIAL_CHAR('X'); say_not_entered();
3667
           return;
3670
           return;
3668
         }
3671
         }
3669
 
3672
 
3675
           }
3678
           }
3676
         }
3679
         }
3677
         else {
3680
         else {
3678
-          SERIAL_CHAR('Y'); SERIAL_PROTOCOLLNPGM(" not entered.");
3681
+          SERIAL_CHAR('Y'); say_not_entered();
3679
           return;
3682
           return;
3680
         }
3683
         }
3681
 
3684
 
3683
           mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
3686
           mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
3684
         }
3687
         }
3685
         else {
3688
         else {
3686
-          SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
3689
+          SERIAL_CHAR('Z'); say_not_entered();
3687
           return;
3690
           return;
3688
         }
3691
         }
3689
         break;
3692
         break;
3693
           mbl.z_offset = code_value_axis_units(Z_AXIS);
3696
           mbl.z_offset = code_value_axis_units(Z_AXIS);
3694
         }
3697
         }
3695
         else {
3698
         else {
3696
-          SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
3699
+          SERIAL_CHAR('Z'); say_not_entered();
3697
           return;
3700
           return;
3698
         }
3701
         }
3699
         break;
3702
         break;
5822
   #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
5825
   #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
5823
 
5826
 
5824
     // EEPROM (M500, M501)
5827
     // EEPROM (M500, M501)
5825
-    SERIAL_PROTOCOLPGM("Cap:");
5826
     #if ENABLED(EEPROM_SETTINGS)
5828
     #if ENABLED(EEPROM_SETTINGS)
5827
-      SERIAL_PROTOCOLLNPGM("EEPROM:1");
5829
+      SERIAL_PROTOCOLLNPGM("Cap:EEPROM:1");
5828
     #else
5830
     #else
5829
-      SERIAL_PROTOCOLLNPGM("EEPROM:0");
5831
+      SERIAL_PROTOCOLLNPGM("Cap:EEPROM:0");
5830
     #endif
5832
     #endif
5831
 
5833
 
5832
     // AUTOREPORT_TEMP (M155)
5834
     // AUTOREPORT_TEMP (M155)
5833
-    SERIAL_PROTOCOLPGM("Cap:");
5834
     #if ENABLED(AUTO_REPORT_TEMPERATURES)
5835
     #if ENABLED(AUTO_REPORT_TEMPERATURES)
5835
-      SERIAL_PROTOCOLLNPGM("AUTOREPORT_TEMP:1");
5836
+      SERIAL_PROTOCOLLNPGM("Cap:AUTOREPORT_TEMP:1");
5836
     #else
5837
     #else
5837
-      SERIAL_PROTOCOLLNPGM("AUTOREPORT_TEMP:0");
5838
+      SERIAL_PROTOCOLLNPGM("Cap:AUTOREPORT_TEMP:0");
5838
     #endif
5839
     #endif
5839
 
5840
 
5840
     // PROGRESS (M530 S L, M531 <file>, M532 X L)
5841
     // PROGRESS (M530 S L, M531 <file>, M532 X L)
5841
-    SERIAL_PROTOCOLPGM("Cap:");
5842
-    SERIAL_PROTOCOLLNPGM("PROGRESS:0");
5842
+    SERIAL_PROTOCOLLNPGM("Cap:PROGRESS:0");
5843
 
5843
 
5844
     // AUTOLEVEL (G29)
5844
     // AUTOLEVEL (G29)
5845
-    SERIAL_PROTOCOLPGM("Cap:");
5846
     #if HAS_ABL
5845
     #if HAS_ABL
5847
-      SERIAL_PROTOCOLLNPGM("AUTOLEVEL:1");
5846
+      SERIAL_PROTOCOLLNPGM("Cap:AUTOLEVEL:1");
5848
     #else
5847
     #else
5849
-      SERIAL_PROTOCOLLNPGM("AUTOLEVEL:0");
5848
+      SERIAL_PROTOCOLLNPGM("Cap:AUTOLEVEL:0");
5850
     #endif
5849
     #endif
5851
 
5850
 
5852
     // Z_PROBE (G30)
5851
     // Z_PROBE (G30)
5853
-    SERIAL_PROTOCOLPGM("Cap:");
5854
     #if HAS_BED_PROBE
5852
     #if HAS_BED_PROBE
5855
-      SERIAL_PROTOCOLLNPGM("Z_PROBE:1");
5853
+      SERIAL_PROTOCOLLNPGM("Cap:Z_PROBE:1");
5856
     #else
5854
     #else
5857
-      SERIAL_PROTOCOLLNPGM("Z_PROBE:0");
5855
+      SERIAL_PROTOCOLLNPGM("Cap:Z_PROBE:0");
5858
     #endif
5856
     #endif
5859
 
5857
 
5860
     // SOFTWARE_POWER (G30)
5858
     // SOFTWARE_POWER (G30)
5861
-    SERIAL_PROTOCOLPGM("Cap:");
5862
     #if HAS_POWER_SWITCH
5859
     #if HAS_POWER_SWITCH
5863
-      SERIAL_PROTOCOLLNPGM("SOFTWARE_POWER:1");
5860
+      SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1");
5864
     #else
5861
     #else
5865
-      SERIAL_PROTOCOLLNPGM("SOFTWARE_POWER:0");
5862
+      SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:0");
5866
     #endif
5863
     #endif
5867
 
5864
 
5868
     // TOGGLE_LIGHTS (M355)
5865
     // TOGGLE_LIGHTS (M355)
5869
-    SERIAL_PROTOCOLPGM("Cap:");
5870
     #if HAS_CASE_LIGHT
5866
     #if HAS_CASE_LIGHT
5871
-      SERIAL_PROTOCOLLNPGM("TOGGLE_LIGHTS:1");
5867
+      SERIAL_PROTOCOLLNPGM("Cap:TOGGLE_LIGHTS:1");
5872
     #else
5868
     #else
5873
-      SERIAL_PROTOCOLLNPGM("TOGGLE_LIGHTS:0");
5869
+      SERIAL_PROTOCOLLNPGM("Cap:TOGGLE_LIGHTS:0");
5874
     #endif
5870
     #endif
5875
 
5871
 
5876
     // EMERGENCY_PARSER (M108, M112, M410)
5872
     // EMERGENCY_PARSER (M108, M112, M410)
5877
-    SERIAL_PROTOCOLPGM("Cap:");
5878
     #if ENABLED(EMERGENCY_PARSER)
5873
     #if ENABLED(EMERGENCY_PARSER)
5879
-      SERIAL_PROTOCOLLNPGM("EMERGENCY_PARSER:1");
5874
+      SERIAL_PROTOCOLLNPGM("Cap:EMERGENCY_PARSER:1");
5880
     #else
5875
     #else
5881
-      SERIAL_PROTOCOLLNPGM("EMERGENCY_PARSER:0");
5876
+      SERIAL_PROTOCOLLNPGM("Cap:EMERGENCY_PARSER:0");
5882
     #endif
5877
     #endif
5883
 
5878
 
5884
   #endif // EXTENDED_CAPABILITIES_REPORT
5879
   #endif // EXTENDED_CAPABILITIES_REPORT

+ 3
- 11
Marlin/pinsDebug.h View File

730
 #define WGM_TEST2 (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13)
730
 #define WGM_TEST2 (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13)
731
 
731
 
732
 static void err_is_counter() {
732
 static void err_is_counter() {
733
-  SERIAL_PROTOCOLPGM("   Can't ");
734
-  SERIAL_PROTOCOLPGM("be used as a PWM because ");
735
-  SERIAL_PROTOCOLPGM("of counter mode");
733
+  SERIAL_PROTOCOLPGM("   Can't be used as a PWM because of counter mode");
736
 }
734
 }
737
 static void err_is_interrupt() {
735
 static void err_is_interrupt() {
738
-  SERIAL_PROTOCOLPGM("   Can't ");
739
-  SERIAL_PROTOCOLPGM("be used as a PWM because ");
740
-  SERIAL_PROTOCOLPGM("it's ");
741
-  SERIAL_PROTOCOLPGM("being used as an interrupt");
736
+  SERIAL_PROTOCOLPGM("   Can't be used as a PWM because it's being used as an interrupt");
742
 }
737
 }
743
 static void err_prob_interrupt() {
738
 static void err_prob_interrupt() {
744
-  SERIAL_PROTOCOLPGM("   Probably can't ");
745
-  SERIAL_PROTOCOLPGM("be used as a PWM because ");
746
-  SERIAL_PROTOCOLPGM("counter/timer is ");
747
-  SERIAL_PROTOCOLPGM("being used as an interrupt");
739
+  SERIAL_PROTOCOLPGM("   Probably can't be used as a PWM because counter/timer is being used as an interrupt");
748
 }
740
 }
749
 static void can_be_used() { SERIAL_PROTOCOLPGM("   can be used as PWM   "); }
741
 static void can_be_used() { SERIAL_PROTOCOLPGM("   can be used as PWM   "); }
750
 
742
 

Loading…
Cancel
Save