2
$\begingroup$

Can someone point me out an appropriate entry code for this task in Marlin source code?

$\endgroup$
2
$\begingroup$

Apparently, given one

  • has already enabled USE_<AXIS>_PLUG (for example <AXIS> = XMIN) in Marlin's Configuration.h,
  • one can add an additional define (for example <AXIS>_ENDSTOP_CUSTOM) in Configuration.h and
  • make this block the else statement in an <AXIS>_ENDSTOP_CUSTOM existence check, with the positive case being your arbitrary task.

The function that gets executed in the standard case in the linked block is PROCESS_ENDSTOP, so cloning it would be a good starting point to make a PROCESS_ENDSTOP_CUSTOM task, too.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Interesting - presumably you could then execute both the current endstop task (stop moving, indicate zero, etc) and some new tasks (launch cruise missiles, start playing Fast& Furious on the large-screen monitor). $\endgroup$ – Carl Witthoft Sep 24 '19 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.