From 660b646b57a5bd6404549d69ccfab291af250bf8 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 27 Nov 2019 11:29:55 +0100 Subject: [PATCH] RR Wiki for Dcodes open D-1, D80, D81, D106, D2130 --- Firmware/Dcodes.cpp | 146 +++++++++++++++++++++++++++++++++- Firmware/Marlin_main.cpp | 164 ++++++++++++++++++++++++++++++++------- 2 files changed, 283 insertions(+), 27 deletions(-) diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index d2016ded5..86dd1aa4a 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -99,7 +99,19 @@ void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperl #ifdef DEBUG_DCODE3 #define EEPROM_SIZE 0x1000 -void dcode_3() + /*! + * + ### D3 - Read/Write EEPROM D3: Read/Write EEPROM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x0fff) + - `C` - Count (0x0001-0x1000) + - `X` - Data + * + */ + void dcode_3() { DBG(_N("D3 - Read/Write EEPROM\n")); uint16_t address = 0x0000; //default 0x0000 @@ -176,6 +188,14 @@ extern float axis_steps_per_unit[NUM_AXIS]; #endif //0 #define LOG(args...) + /*! + * + ### D-1 - Endless Loop D-1: Endless Loop + + D-1 + + * + */ void dcode__1() { printf_P(PSTR("D-1 - Endless loop\n")); @@ -185,6 +205,15 @@ void dcode__1() #ifdef DEBUG_DCODES + /*! + * + ### D0 - Reset D0: Reset + + D0 [ B ] + + - `B` - Bootloader + * + */ void dcode_0() { if (*(strchr_pointer + 1) == 0) return; @@ -203,6 +232,14 @@ void dcode_0() } } + /*! + * + ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET + + D1 + + * + */ void dcode_1() { LOG("D1 - Clear EEPROM and RESET\n"); @@ -213,6 +250,18 @@ void dcode_1() while(1); } + /*! + * + ### D2 - Read/Write RAM D3: Read/Write RAM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x1fff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + * + */ void dcode_2() { LOG("D2 - Read/Write RAM\n"); @@ -256,6 +305,19 @@ void dcode_2() }*/ } + /*! + * + ### D4 - Read/Write PIN D4: Read/Write PIN + + To read the digital value of a pin you need only to define the pin number. + + D4 [ P | F | V ] + + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) + * + */ void dcode_4() { LOG("D4 - Read/Write PIN\n"); @@ -288,6 +350,19 @@ void dcode_4() #ifdef DEBUG_DCODE5 + /*! + * + ### D5 - Read/Write FLASH D5: Read/Write Flash + This command can be used without any additional parameters. It will read the 1kb FLASH. + + D3 [ A | C | X | E ] + + - `A` - Address (0x00000-0x3ffff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + - `E` - Erase + * + */ void dcode_5() { printf_P(PSTR("D5 - Read/Write FLASH\n")); @@ -351,11 +426,25 @@ void dcode_5() #ifdef DEBUG_DCODES + /*! + * + ### D6 - Read/Write external FLASH D6: Read/Write external Flash + + Reserved + * + */ void dcode_6() { LOG("D6 - Read/Write external FLASH\n"); } + /*! + * + ### D7 - Read/Write Bootloader D7: Read/Write Bootloader + + Reserved + * + */ void dcode_7() { LOG("D7 - Read/Write Bootloader\n"); @@ -371,6 +460,18 @@ void dcode_7() */ } + /*! + * + ### D8 - Read/Write PINDA D8: Read/Write PINDA + + D8 [ ? | ! | P | Z ] + + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] + * + */ void dcode_8() { printf_P(PSTR("D8 - Read/Write PINDA\n")); @@ -412,6 +513,23 @@ void dcode_8() printf_P(PSTR("temp_pinda=%d offset_z=%d.%03d\n"), (int)temp_pinda, (int)offset_z, ((int)(1000 * offset_z) % 1000)); } + /*! + * + ### D9 - Read ADC D9: Read ADC + + D9 [ I | V ] + + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated + * + */ const char* dcode_9_ADC_name(uint8_t i) { switch (i) @@ -485,12 +603,24 @@ void dcode_9() } } + /*! + * + ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK + + * + */ void dcode_10() {//Tell the printer that XYZ calibration went OK LOG("D10 - XYZ calibration = OK\n"); calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST); } + /*! + * + ### D12 - Time D12: Time + + * + */ void dcode_12() {//Time LOG("D12 - Time\n"); @@ -636,6 +766,20 @@ void dcode_2130() #endif //TMC2130 #ifdef PAT9125 + /*! + * + ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor + + D9125 [ ? | ! | R | X | Y | L ] + + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log + * + */ void dcode_9125() { LOG("D9125 - PAT9125\n"); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 394c818c6..2674ba829 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8517,73 +8517,173 @@ Sigma_Exit: switch((int)code_value()) { - //! ### D-1 - Endless loop - // ------------------- + /*! + * + ### D-1 - Endless Loop D-1: Endless Loop + + D-1 + + * + */ case -1: dcode__1(); break; #ifdef DEBUG_DCODES - //! ### D0 - Reset - // -------------- + /*! + * + ### D0 - Reset D0: Reset + + D0 [ B ] + + - `B` - Bootloader + * + */ case 0: dcode_0(); break; - //! ### D1 - Clear EEPROM - // ------------------ + /*! + * + ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET + + D1 + + * + */ case 1: dcode_1(); break; - //! ### D2 - Read/Write RAM - // -------------------- + /*! + * + ### D2 - Read/Write RAM D3: Read/Write RAM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x1fff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + * + */ case 2: dcode_2(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE3 - //! ### D3 - Read/Write EEPROM - // ----------------------- + /*! + * + ### D3 - Read/Write EEPROM D3: Read/Write EEPROM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x0fff) + - `C` - Count (0x0001-0x1000) + - `X` - Data + * + */ case 3: dcode_3(); break; #endif //DEBUG_DCODE3 #ifdef DEBUG_DCODES - //! ### D4 - Read/Write PIN - // --------------------- + /*! + * + ### D4 - Read/Write PIN D4: Read/Write PIN + + To read the digital value of a pin you need only to define the pin number. + + D4 [ P | F | V ] + + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) + * + */ case 4: dcode_4(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE5 - //! ### D5 - Read/Write FLASH - // ------------------------ + /*! + * + ### D5 - Read/Write FLASH D5: Read/Write Flash + This command can be used without any additional parameters. It will read the 1kb FLASH. + + D3 [ A | C | X | E ] + + - `A` - Address (0x00000-0x3ffff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + - `E` - Erase + * + */ case 5: dcode_5(); break; break; #endif //DEBUG_DCODE5 #ifdef DEBUG_DCODES - //! ### D6 - Read/Write external FLASH - // --------------------------------------- + /*! + * + ### D6 - Read/Write external FLASH D6: Read/Write external Flash + + Reserved + * + */ case 6: dcode_6(); break; - //! ### D7 - Read/Write Bootloader - // ------------------------------- + /*! + * + ### D7 - Read/Write Bootloader D7: Read/Write Bootloader + + Reserved + * + */ case 7: dcode_7(); break; - //! ### D8 - Read/Write PINDA - // --------------------------- + /*! + * + ### D8 - Read/Write PINDA D8: Read/Write PINDA + + D8 [ ? | ! | P | Z ] + + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] + * + */ case 8: dcode_8(); break; - // ### D9 - Read/Write ADC - // ------------------------ + /*! + * + ### D9 - Read ADC D9: Read ADC + + D9 [ I | V ] + + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated + * + */ case 9: dcode_9(); break; - //! ### D10 - XYZ calibration = OK - // ------------------------------ + /*! + * + ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK + + * + */ case 10: dcode_10(); break; #endif //DEBUG_DCODES @@ -8715,8 +8815,20 @@ Sigma_Exit: #if (defined (FILAMENT_SENSOR) && defined(PAT9125)) - //! ### D9125 - FILAMENT_SENSOR - // --------------------------------- + /*! + * + ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor + + D9125 [ ? | ! | R | X | Y | L ] + + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log + * + */ case 9125: dcode_9125(); break; #endif //FILAMENT_SENSOR