Skip to content

Fix TMC_DEBUG undefined report_tmc_status#11993

Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
thinkyhead:bf2_fix_tmc_debug
Oct 3, 2018
Merged

Fix TMC_DEBUG undefined report_tmc_status#11993
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
thinkyhead:bf2_fix_tmc_debug

Conversation

@thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Oct 3, 2018

Addressing #11992
Issue introduced by #11943

The report_tmc_status variable was only defined for MONITOR_DRIVER_STATUS. This PR ensures that the variable is defined based on TMC_DEBUG.

Concise Diff

@thinkyhead thinkyhead merged commit 8daadd2 into MarlinFirmware:bugfix-2.0.x Oct 3, 2018
@thinkyhead thinkyhead deleted the bf2_fix_tmc_debug branch October 3, 2018 16:56
@teemuatlut
Copy link
Member

No it should be under MONITOR_DRIVER_STATUS. That is the function that periodically polls the driver.
The way I see it, the feedback provided is also more closely related to monitoring than the one time debug call.

@thinkyhead
Copy link
Member Author

thinkyhead commented Oct 3, 2018

Well, the flag is only used / settable with TMC_DEBUG, so I'm just following your lead here…

#if ENABLED(TMC_DEBUG)

  . . .

  /**
   * M122 report functions
   */
  void tmc_set_report_status(const bool status) {
    if ((report_tmc_status = status))
      SERIAL_ECHOLNPGM("axis:pwm_scale |status_response|");
  }

  . . .

#endif // TMC_DEBUG

…and…

#if ENABLED(TMC_DEBUG)

#include "../../gcode.h"
#include "../../../feature/tmc_util.h"

/**
 * M122: Debug TMC drivers
 */
void GcodeSuite::M122() {
  if (parser.seen('S'))
    tmc_set_report_status(parser.value_bool());
  else
    tmc_report_all();
}

#endif // TMC_DEBUG

@teemuatlut
Copy link
Member

Ah true. Maybe I'll need to revise that once I know what I want to do with the feature. Maybe it should require both config options.

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.

2 participants

Comments