console fix + stepper step läuft

This commit is contained in:
fewikay committed 2026-10-23 17:02:17 +02:00
1 parent d076d981ac
commit 13eac4fd0c
3 files changed
+13 -25

No files matched your search

@@ -33,7 +33,7 @@ int StepperConsoleFunction( int argc, char** argv, void* ctx )
}
else if ( strcmp(argv[0], "reset") == 0 )
{
init_stepper(NULL, NULL, NULL);
reset_stepper(h);
}
else
{
@@ -76,7 +76,7 @@ void StepDriverReset(void* pGPO, const int ena){
}
void StepLibraryDelay(unsigned int ms){
HAL_Delay(ms);
vTaskDelay(pdMS_TO_TICKS(ms));
}
// 1) Funktion schreiben (oben in stepper.c, vor init_stepper)
@@ -91,9 +91,9 @@ static int StepLibraryStep( void* pPWM, int dir, unsigned int numPulses ){
for(unsigned int i = 0; i < numPulses; i++){
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_SET);
HAL_Delay(1);
vTaskDelay(pdMS_TO_TICKS(1));
HAL_GPIO_WritePin(STEP_PULSE_GPIO_Port, STEP_PULSE_Pin, GPIO_PIN_RESET);
HAL_Delay(1);
vTaskDelay(pdMS_TO_TICKS(1));
}
return 0;
}
@@ -123,6 +123,11 @@ L6474_Handle_t init_stepper(void* pIO, void* pGPO, void* pPWM){
//p.cancelStep = StepTimerCancelAsync;
L6474_Handle_t s = L6474_CreateInstance(&p, pIO, pGPO, pPWM);
return s;
}
void reset_stepper(L6474_Handle_t s){
L6474_BaseParameter_t b;
L6474_SetBaseParameter(&b); // sinnvolle Standardwerte
b.stepMode = smMICRO4;
@@ -136,22 +141,4 @@ L6474_Handle_t init_stepper(void* pIO, void* pGPO, void* pPWM){
result |= L6474_Initialize(s, &b);
result |= L6474_SetPowerOutputs(s, 1);
// in case we have no error, we can enable the drivers
// and then we step a bit
if ( result == 0 )
{
result |= L6474_StepIncremental(s, 10000 );
}
else
{
// error handling
}
return s;
}
void reset_stepper(){
}
@@ -307,6 +307,7 @@ int main(void)
//Konsole
ConsoleHandle_t c = CONSOLE_CreateInstance( 4*configMINIMAL_STACK_SIZE, configMAX_PRIORITIES - 5 );
L6474_Handle_t stepper1 = init_stepper(NULL, NULL, NULL);
CONSOLE_RegisterCommand(c, "capability", "prints a specified string of capability bits",
CapabilityFunc, NULL);
@@ -315,7 +316,7 @@ int main(void)
fabi, NULL);
CONSOLE_RegisterCommand(c, "stepper", "stepper command",
StepperConsoleFunction, NULL);
StepperConsoleFunction, stepper1);
//Spindle
init_spindle(c, 9000, -9000, 1600);
@@ -46,9 +46,9 @@
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="disable"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="freertos"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>