This commit is contained in:
andrea
2026-04-16 20:28:50 +02:00
parent 60536ed738
commit 63d3980ddc
71 changed files with 93079 additions and 70708 deletions

View File

@@ -95,6 +95,7 @@ uint16_t twap;
uint16_t t1ch;
uint16_t t2ch;
uint16_t t3ch;
uint16_t t4ch;
uint16_t twch;
uint16_t tramp;
@@ -302,72 +303,72 @@ void manageCiclo(void){
case omaperto:
if(stPulsanti&P1START){
stBuz=bzmoving;
(void)ramp(M3,BW,mrampstart[M3-1],m3pwmch,tramp,RAMPINIT);
(void)ramp(M1,BW,mrampstart[M1-1],m1pwmch,tramp,RAMPINIT);
stCiclo=omchiusura1;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura1:
if((ramp(M3,BW,mrampstart[M3-1],m3pwmch,tramp,RAMPRUN)==DONE)&&(ramp(M1,BW,mrampstart[M1-1],m1pwmch,tramp,RAMPRUN)==DONE)){
rtCiclo=t1ch;
if(ramp(M1,BW,mrampstart[M1-1],m1pwmch,tramp,RAMPRUN)==DONE){
rtCiclo=t4ch;
stCiclo=omchiusura2;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura2:
if(rtCiclo==0){
(void)ramp(M3,BW,m3pwmch,0,tramp,RAMPINIT);
(void)ramp(M1,BW,m1pwmch,0,tramp,RAMPINIT);
(void)ramp(M3,BW,mrampstart[M3-1],m3pwmch,tramp,RAMPINIT);
stCiclo=omchiusura3;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura3:
if((ramp(M3,BW,m3pwmch,0,tramp,RAMPRUN)==DONE)&&(ramp(M1,BW,m1pwmch,0,tramp,RAMPRUN)==DONE)){
rtCiclo=twch;
if(ramp(M3,BW,mrampstart[M3-1],m3pwmch,tramp,RAMPRUN)==DONE){
rtCiclo=t1ch;
stCiclo=omchiusura4;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura4:
if(rtCiclo==0){
(void)ramp(M2,FW,mrampstart[M2-1],m2pwmch,tramp,RAMPINIT);
(void)ramp(M3,BW,m3pwmch,0,tramp,RAMPINIT);
(void)ramp(M1,BW,m1pwmch,0,tramp,RAMPINIT);
stCiclo=omchiusura5;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura5:
if(ramp(M2,FW,mrampstart[M2-1],m2pwmch,tramp,RAMPRUN)==DONE){
rtCiclo=t2ch;
if((ramp(M3,BW,m3pwmch,0,tramp,RAMPRUN)==DONE)&&(ramp(M1,BW,m1pwmch,0,tramp,RAMPRUN)==DONE)){
rtCiclo=twch;
stCiclo=omchiusura6;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura6:
if(rtCiclo==0){
(void)ramp(M2,FW,m2pwmch,0,tramp,RAMPINIT);
(void)ramp(M2,FW,mrampstart[M2-1],m2pwmch,tramp,RAMPINIT);
(void)ramp(M4,BW,mrampstart[M4-1],m4pwmch,tramp,RAMPINIT);
stCiclo=omchiusura7;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura7:
if(ramp(M2,FW,m2pwmch,0,tramp,RAMPRUN)==DONE){
rtCiclo=twch;
if((ramp(M2,FW,mrampstart[M2-1],m2pwmch,tramp,RAMPRUN)==DONE)&&(ramp(M4,BW,mrampstart[M4-1],m4pwmch,tramp,RAMPRUN)==DONE)){
rtCiclo=t3ch;
stCiclo=omchiusura8;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura8:
if(rtCiclo==0){
(void)ramp(M4,BW,mrampstart[M4-1],m4pwmch,tramp,RAMPINIT);
(void)ramp(M2,FW,m2pwmch,0,tramp,RAMPINIT);
stCiclo=omchiusura9;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura9:
if(ramp(M4,BW,mrampstart[M4-1],m4pwmch,tramp,RAMPRUN)==DONE){
rtCiclo=t3ch;
if(ramp(M2,FW,m2pwmch,0,tramp,RAMPRUN)==DONE){
rtCiclo=t2ch;
stCiclo=omchiusura10;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
@@ -382,11 +383,25 @@ void manageCiclo(void){
case omchiusura11:
if(ramp(M4,BW,m4pwmch,0,tramp,RAMPRUN)==DONE){
rtCiclo=twch;
stCiclo=omchiusura12;
stCiclo=omchiusura14;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura12:
if(rtCiclo==0){
//(void)ramp(M4,BW,m4pwmch,0,tramp,RAMPINIT);
stCiclo=omchiusura14;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura13:
if(ramp(M4,BW,m4pwmch,0,tramp,RAMPRUN)==DONE){
rtCiclo=twch;
stCiclo=omchiusura14;
}
if(stPulsanti&P1STOP)stCiclo=omstopchiusura;
break;
case omchiusura14:
if(rtCiclo==0){
stBuz=bzoff;
stCiclo=omchiuso;