Browse Source

Allow D2 to be enabled selectively

Yuri D'Elia 2 years ago
parent
commit
62f496e1d6
3 changed files with 9 additions and 0 deletions
  1. 4 0
      Firmware/Dcodes.cpp
  2. 3 0
      Firmware/Dcodes.h
  3. 2 0
      Firmware/Marlin_main.cpp

+ 4 - 0
Firmware/Dcodes.cpp

@@ -239,7 +239,9 @@ void dcode_1()
 		eeprom_write_byte((unsigned char*)i, (unsigned char)0xff);
 	softReset();
 }
+#endif
 
+#if defined DEBUG_DCODE2 || defined DEBUG_DCODES
     /*!
     ### D2 - Read/Write RAM <a href="https://reprap.org/wiki/G-code#D2:_Read.2FWrite_RAM">D3: Read/Write RAM</a>
     This command can be used without any additional parameters. It will read the entire RAM.
@@ -300,7 +302,9 @@ void dcode_2()
 		putchar('\n');
 	}*/
 }
+#endif
 
+#ifdef DEBUG_DCODES
     /*!
     
     ### D4 - Read/Write PIN <a href="https://reprap.org/wiki/G-code#D4:_Read.2FWrite_PIN">D4: Read/Write PIN</a>

+ 3 - 0
Firmware/Dcodes.h

@@ -4,7 +4,10 @@
 extern void dcode__1(); //D-1 - Endless loop (to simulate deadlock)
 extern void dcode_0(); //D0 - Reset
 extern void dcode_1(); //D1 - Clear EEPROM
+
+#if defined DEBUG_DCODE2 || defined DEBUG_DCODES
 extern void dcode_2(); //D2 - Read/Write RAM
+#endif
 
 #if defined DEBUG_DCODE3 || defined DEBUG_DCODES
 extern void dcode_3(); //D3 - Read/Write EEPROM

+ 2 - 0
Firmware/Marlin_main.cpp

@@ -9053,7 +9053,9 @@ Sigma_Exit:
     */
 	case 1:
 		dcode_1(); break;
+#endif
 
+#if defined DEBUG_DCODE2 || defined DEBUG_DCODES
     /*!
     ### D2 - Read/Write RAM <a href="https://reprap.org/wiki/G-code#D2:_Read.2FWrite_RAM">D3: Read/Write RAM</a>
     This command can be used without any additional parameters. It will read the entire RAM.