Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #143 from StefanBruens/fix_stm32_probe
Browse files Browse the repository at this point in the history
Correct bitmask/bool mixup for STM32 probe pin
  • Loading branch information
terjeio authored Dec 18, 2020
2 parents 498320f + e84af59 commit 2569bb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/STM32F1xx/Src/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ static control_signals_t systemGetState (void)
// and the probing cycle modes for toward-workpiece/away-from-workpiece.
static void probeConfigure(bool is_probe_away, bool probing)
{
probe_invert = settings.probe.invert_probe_pin;
probe_invert = settings.probe.invert_probe_pin ? 1 : 0;

if (is_probe_away)
probe_invert ^= PROBE_BIT;
probe_invert ^= 1;
}

// Returns the probe connected and triggered pin states.
Expand Down
4 changes: 2 additions & 2 deletions drivers/STM32F4xx/Src/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,10 @@ static control_signals_t systemGetState (void)
// and the probing cycle modes for toward-workpiece/away-from-workpiece.
static void probeConfigure(bool is_probe_away, bool probing)
{
probe_invert = settings.probe.invert_probe_pin;
probe_invert = settings.probe.invert_probe_pin ? 1 : 0;
#ifdef PROBE_PIN
if (is_probe_away)
probe_invert ^= PROBE_BIT;
probe_invert ^= 1;
#endif
}

Expand Down

0 comments on commit 2569bb2

Please sign in to comment.