Skip to content

Commit

Permalink
estop checked after startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrawipf committed Apr 26, 2024
1 parent d6142b2 commit 7f395d0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Firmware/FFBoard/UserExtensions/Src/FFBHIDMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ FFBHIDMain::FFBHIDMain(uint8_t axisCount) :
restoreFlash(); // Load parameters
registerCommands();


#ifdef E_STOP_Pin
bool estopState = HAL_GPIO_ReadPin(E_STOP_GPIO_Port, E_STOP_Pin) == GPIO_PIN_RESET;
if(estopState){ // Estop pressed at startup
emergencyStop(!estopState);
lastEstop = HAL_GetTick();
}
#endif

}

/**
Expand Down Expand Up @@ -138,6 +129,14 @@ void FFBHIDMain::saveFlash(){


void FFBHIDMain::Run(){
#ifdef E_STOP_Pin
bool estopState = HAL_GPIO_ReadPin(E_STOP_GPIO_Port, E_STOP_Pin) == GPIO_PIN_RESET;
if(estopState){ // Estop pressed at startup
emergencyStop(!estopState);
// control.emergency = true; // Immediately enter emergency state but without notifying other classes yet
lastEstop = HAL_GetTick();
}
#endif
while(true){
Delay(1);
updateControl();
Expand Down

0 comments on commit 7f395d0

Please sign in to comment.