Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BL Touch debug leveling #15232

Merged

Conversation

FabioBatSilva
Copy link

Hi..

First time contributing here and its been a long time since I wrote any cpp..
Please let me know if I messed something here..

Description

Looks like #14839 introduced a issue when DEBUG_LEVELING_FEATURE is defined
Where SERIAL_ECHO* is called with the wrong number of arguments..

if I define

#define BLTOUCH
#define DEBUG_LEVELING_FEATURE

There is a compilation error when running pio run

RCH_AVR -DARDUINO=10805 -IMarlin -I/Users/fabio/.platformio/packages/framework-arduinoavr/libraries/__cores__/arMarlin/Marlin_main.cpp:2128:78: error: macro "SERIAL_ECHOLNPAIR" requires 2 arguments, but only 1 given
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch DEPLOY requested");
                                                                              ^
Marlin/Marlin_main.cpp:2135:105: error: macro "SERIAL_ECHOLNPAIR" requires 2 arguments, but only 1 given
           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch ALARM or TRIGGER after DEPLOY, recovering");
                                                                                                         ^
Marlin/Marlin_main.cpp:2144:81: error: macro "SERIAL_ECHOLNPAIR" requires 2 arguments, but only 1 given
             if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch Recovery Failed");
                                                                                 ^
Marlin/Marlin_main.cpp:2163:79: error: macro "SERIAL_ECHOLNPAIR" requires 2 arguments, but only 1 given
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("bltouch.deploy_proc() end");
                                                                               ^
Marlin/Marlin_main.cpp:2172:76: error: macro "SERIAL_ECHOLNPAIR" requires 2 arguments, but only 1 given
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("BLTouch STOW requested");

Benefits

Use SERIAL_ECHO instead of SERIAL_ECHOLNPAIR to write a single
Use SERIAL_ECHOLNPGM instead of undefined DEBUG_ECHOLNPAIR ?

Related Issues

#14839

Use SERIAL_ECHO instead of SERIAL_ECHOLNPAIR
Use SERIAL_ECHOLNPGM instead of DEBUG_ECHOLNPAIR
@tpruvot
Copy link
Contributor

tpruvot commented Sep 12, 2019

SERIAL_ECHO doesnt put "\n", need SERIAL_ECHOLN

Marlin/src/core/serial.h:70:#define SERIAL_ECHO(x)          SERIAL_OUT(print, x)
Marlin/src/core/serial.h:72:#define SERIAL_ECHOLN(x)        SERIAL_OUT(println, x)

@thinkyhead
Copy link
Member

SERIAL_ECHOLNPGM is even better!

@thinkyhead thinkyhead merged commit 3b4ae17 into MarlinFirmware:bugfix-1.1.x Sep 12, 2019
@FabioBatSilva FabioBatSilva deleted the fix-bltouch-debug branch September 13, 2019 00:58
FabioBatSilva added a commit to FabioBatSilva/Marlin that referenced this pull request Mar 17, 2020
TiagoJustino added a commit to TiagoJustino/Marlin that referenced this pull request Apr 2, 2020
* MarlinFirmware/1.1.x: (133 commits)
  Fix Z position after ABL bilinear G29 with fade (MarlinFirmware#17174)
  Change DUMMY_PID_VALUE to NAN (MarlinFirmware#17079)
  Disable integration testing
  Enable DUAL_NOZZLE_DUPLICATION_MODE (MarlinFirmware#16436)
  [1.1.x] Polish language UTF8 (MarlinFirmware#16141)
  Links for the "New Issue" page
  Add Korean language (MarlinFirmware#15918)
  [1.1.x] MKS_GEN_L_V2 controller (MarlinFirmware#15805)
  Update bug_report.md
  [1.1.x] Fix autostart w/out SD_DETECT_PIN (MarlinFirmware#15667)
  [1.1.x] RAMPS + Viki1 LCD compatibility (MarlinFirmware#15736)
  [1.1.x] Fix compiler warning (MarlinFirmware#15642)
  [1.1.x] Fix for G2/G3 rounding error (MarlinFirmware#15546)
  Let MINIPANEL use SW SPI if needed (MarlinFirmware#15246)
  Fix BLTouch debugging (MarlinFirmware#15232)
  Fix Creality bed thermistor
  Fix PT-BR strings (MarlinFirmware#15023)
  Fix #else extra tokens (MarlinFirmware#15013)
  [1.1.x] Autobuild formatting (MarlinFirmware#14858)
  [1.1.x] BLTouch 3.0 - 3.1 (MarlinFirmware#14839)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants