diff --git a/g2core/cycle_homing.cpp b/g2core/cycle_homing.cpp index 519afcb5..2873aa48 100644 --- a/g2core/cycle_homing.cpp +++ b/g2core/cycle_homing.cpp @@ -100,7 +100,7 @@ static stat_t _set_homing_func(stat_t (*func)(int8_t axis)) { * Will be registered only during homing mode - see gpio.h for more info */ gpioDigitalInputHandler _homing_handler { - [&](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { + [](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { if (cm->cycle_type != CYCLE_HOMING) { return GPIO_NOT_HANDLED; } if (triggering_pin_number != hm.homing_input) { return GPIO_NOT_HANDLED; } if (edge != INPUT_EDGE_LEADING) { return GPIO_NOT_HANDLED; } diff --git a/g2core/cycle_probing.cpp b/g2core/cycle_probing.cpp index 77ec1665..bd7e9b4f 100644 --- a/g2core/cycle_probing.cpp +++ b/g2core/cycle_probing.cpp @@ -129,7 +129,7 @@ static void _motion_end_callback(float* vect, bool* flag) * Will be registered only during homing mode - see gpio.h for more info */ gpioDigitalInputHandler _probing_handler { - [&](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { + [](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { if (cm->cycle_type != CYCLE_PROBE) { return GPIO_NOT_HANDLED; } if (triggering_pin_number != pb.probe_input) { return GPIO_NOT_HANDLED; } diff --git a/g2core/gpio.h b/g2core/gpio.h index 3bf7a87b..5151506d 100644 --- a/g2core/gpio.h +++ b/g2core/gpio.h @@ -116,7 +116,7 @@ extern gpioDigitalInputReader* const in_r[16]; * Example gpioDigitalInputHandler object creation: gpioDigitalInputHandler limitHandler { - [&](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { + [](const bool state, const inputEdgeFlag edge, const uint8_t triggering_pin_number) { if (edge != INPUT_EDGE_LEADING) { return; } limit_requested = true; // record that a limit was requested for later processing return false; // allow others to see this notice diff --git a/g2core/stepper.cpp b/g2core/stepper.cpp index 021cdc80..0e2b1d27 100644 --- a/g2core/stepper.cpp +++ b/g2core/stepper.cpp @@ -98,7 +98,7 @@ https://github.com/synthetos/Motate/blob/41e5b92a98de4b268d1804bf6eadf3333298fc7 It's just like a function, and is used as a function pointer. But the closure part means that whatever variables that were in scope where the -[&](parameters){code} is will be captured by the compiler as references in the generated +[](parameters){code} is will be captured by the compiler as references in the generated function and used wherever the function gets called. In this particular use, there isn't anything that wouldn't be available anywhere in that file, but they're not being called from that file. They're being called by the systick interrupt which is over in SamTmers.cpp