Skip to content

Commit

Permalink
Merge branch 'edge' into stacker_fix-limit-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Nov 25, 2024
2 parents 6364d5c + 5a03363 commit ca3ffd3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static motor_hardware_t _motor_hardware = {
.direction = {L_DIR_PORT, L_DIR_PIN, GPIO_PIN_SET},
.step = {L_STEP_PORT, L_STEP_PIN, GPIO_PIN_SET},
.limit_switch_minus = {L_N_HELD_PORT, L_N_HELD_PIN, GPIO_PIN_RESET},
.limit_switch_plus = {L_N_RELEASED_PORT, L_N_RELEASED_PIN, GPIO_PIN_RESET},
.limit_switch_plus = {0},
.diag0 = {MOTOR_DIAG0_PORT, MOTOR_DIAG0_PIN, GPIO_PIN_SET},
.ebrake = {0},
},
Expand Down Expand Up @@ -178,9 +178,6 @@ void motor_hardware_gpio_init(void){
init.Pin = L_N_HELD_PIN;
HAL_GPIO_Init(L_N_HELD_PORT, &init);

init.Pin = L_N_RELEASED_PIN;
HAL_GPIO_Init(L_N_RELEASED_PORT, &init);

/*Configure GPIO pins : INPUTs IRQ */
init.Mode = GPIO_MODE_IT_FALLING;
init.Pull = GPIO_PULLUP;
Expand Down
2 changes: 0 additions & 2 deletions stm32-modules/include/flex-stacker/firmware/motor_hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ bool hw_is_estop_pin(uint16_t pin);
/* Note: Mechanical limit switches */
#define L_N_HELD_PIN (GPIO_PIN_5)
#define L_N_HELD_PORT (GPIOB)
#define L_N_RELEASED_PIN (GPIO_PIN_11)
#define L_N_RELEASED_PORT (GPIOC)

/**************** COMMON ********************/
#define N_ESTOP_PIN (GPIO_PIN_6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,11 @@ struct GetLimitSwitches {
std::sized_sentinel_for<InputIt, InLimit>
static auto write_response_into(InputIt buf, InLimit limit, int x_extended,
int x_retracted, int z_extended,
int z_retracted, int l_released, int l_held)
-> InputIt {
int z_retracted, int l_held) -> InputIt {
int res = 0;
res = snprintf(&*buf, (limit - buf),
"M119 XE:%i XR:%i ZE:%i ZR:%i LR:%i LH:%i OK\n",
x_extended, x_retracted, z_extended, z_retracted,
l_released, l_held);
"M119 XE:%i XR:%i ZE:%i ZR:%i LR:%i OK\n", x_extended,
x_retracted, z_extended, z_retracted, l_held);
if (res <= 0) {
return buf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ struct GetLimitSwitchesResponses {
bool x_retract_triggered;
bool z_extend_triggered;
bool z_retract_triggered;
bool l_released_triggered;
bool l_held_triggered;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ class MotorTask {
policy.check_limit_switch(MotorID::MOTOR_Z, true),
.z_retract_triggered =
policy.check_limit_switch(MotorID::MOTOR_Z, false),
.l_released_triggered =
policy.check_limit_switch(MotorID::MOTOR_L, true),
.l_held_triggered =
policy.check_limit_switch(MotorID::MOTOR_L, false),
};
Expand Down

0 comments on commit ca3ffd3

Please sign in to comment.