wip
This commit is contained in:
@@ -66,6 +66,8 @@ typedef enum{
|
||||
omchiusura10,
|
||||
omchiusura11,
|
||||
omchiusura12,
|
||||
omchiusura13,
|
||||
omchiusura14,
|
||||
omstopchiusura,
|
||||
}omCiclo_st;
|
||||
/* USER CODE END ET */
|
||||
|
||||
@@ -177,7 +177,7 @@ void manageCDC(void){
|
||||
for(i=0;i<32;i++){
|
||||
st=EEW_Read(i, &val);
|
||||
if (st == EE_OK){
|
||||
sprintf((char*)s,"0x%02x=0x%04x ",i,val);
|
||||
sprintf((char*)s,"\n0x%02x=%5d ",i,val);
|
||||
while (CDC_Transmit_FS(s, strlen((char*)s)) == USBD_BUSY);
|
||||
}else{
|
||||
sprintf((char*)s,"rderr %d ",st);
|
||||
|
||||
@@ -27,14 +27,15 @@ extern uint16_t tramp;
|
||||
extern uint16_t t1ch;
|
||||
extern uint16_t t2ch;
|
||||
extern uint16_t t3ch;
|
||||
extern uint16_t t4ch;
|
||||
extern uint16_t twch;
|
||||
|
||||
const uint8_t deftab[32]={
|
||||
40, //m1pwmap
|
||||
60, //m1pwmch
|
||||
50, //m2pwmap
|
||||
50, //m2pwmch
|
||||
40, //m3pwmap
|
||||
70, //m2pwmap
|
||||
70, //m2pwmch
|
||||
35, //m3pwmap
|
||||
40, //m3pwmch
|
||||
40, //m4pwmap
|
||||
40, //m4pwmch
|
||||
@@ -42,14 +43,15 @@ const uint8_t deftab[32]={
|
||||
20, //m2rampstart
|
||||
20, //m3rampstart
|
||||
20, //m4rampstart
|
||||
26, //t1ap
|
||||
2, //t2ap
|
||||
8, //t3ap
|
||||
28, //t1ap
|
||||
4, //t2ap
|
||||
10, //t3ap
|
||||
40, //t4ap
|
||||
1, //twap
|
||||
30, //t1ch
|
||||
30, //t2ch
|
||||
40, //t3ch
|
||||
20, //t1ch
|
||||
10, //t2ch
|
||||
30, //t3ch
|
||||
1, //t4ch
|
||||
1, //twch
|
||||
0,
|
||||
0,
|
||||
@@ -60,7 +62,6 @@ const uint8_t deftab[32]={
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
10, //tramp
|
||||
};
|
||||
|
||||
@@ -371,6 +372,7 @@ void loadEE(void){
|
||||
EEW_Read(T1CH, &t1ch);
|
||||
EEW_Read(T2CH, &t2ch);
|
||||
EEW_Read(T3CH, &t3ch);
|
||||
EEW_Read(T4CH, &t4ch);
|
||||
EEW_Read(TWCH, &twch);
|
||||
EEW_Read(TRAMP, &tramp);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ typedef enum
|
||||
#define T1CH 17 //t1ch
|
||||
#define T2CH 18 //t2ch
|
||||
#define T3CH 19 //t3ch
|
||||
#define TWCH 20 //twch
|
||||
#define T4CH 20 //t4ch
|
||||
#define TWCH 21 //twch
|
||||
#define TRAMP 31 //tramp
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
../Core/Src/eeprom.h:102:24:EEW_Read 1
|
||||
../Core/Src/eeprom.h:107:24:EEW_Write 1
|
||||
../Core/Src/eeprom.h:103:24:EEW_Read 1
|
||||
../Core/Src/eeprom.h:108:24:EEW_Write 1
|
||||
../Core/Src/cdc_int.c:27:6:toHex 17
|
||||
../Core/Src/cdc_int.c:63:6:manageCDC 71
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
../Core/Src/eeprom.h:102:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.h:107:24:EEW_Write 16 static
|
||||
../Core/Src/eeprom.h:103:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.h:108:24:EEW_Write 16 static
|
||||
../Core/Src/cdc_int.c:27:6:toHex 16 static
|
||||
../Core/Src/cdc_int.c:63:6:manageCDC 184 static
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
../Core/Src/eeprom.h:102:24:EEW_Read 1
|
||||
../Core/Src/eeprom.c:92:17:EE_GetPageStatus 1
|
||||
../Core/Src/eeprom.c:97:26:EE_FlashProgramHalfWord 1
|
||||
../Core/Src/eeprom.c:108:26:EE_FlashErasePage 1
|
||||
../Core/Src/eeprom.c:127:17:EE_FindFreeAddress 3
|
||||
../Core/Src/eeprom.c:149:18:EE_FindInPage 6
|
||||
../Core/Src/eeprom.c:189:18:EE_Format 4
|
||||
../Core/Src/eeprom.c:207:17:EE_GetOtherPageBase 2
|
||||
../Core/Src/eeprom.c:213:18:EE_PageTransfer 11
|
||||
../Core/Src/eeprom.c:286:10:EE_Init 7
|
||||
../Core/Src/eeprom.c:317:10:EE_ReadVariable 2
|
||||
../Core/Src/eeprom.c:334:10:EE_WriteVariable 4
|
||||
../Core/Src/eeprom.c:357:6:loadEE 1
|
||||
../Core/Src/eeprom.h:103:24:EEW_Read 1
|
||||
../Core/Src/eeprom.c:93:17:EE_GetPageStatus 1
|
||||
../Core/Src/eeprom.c:98:26:EE_FlashProgramHalfWord 1
|
||||
../Core/Src/eeprom.c:109:26:EE_FlashErasePage 1
|
||||
../Core/Src/eeprom.c:128:17:EE_FindFreeAddress 3
|
||||
../Core/Src/eeprom.c:150:18:EE_FindInPage 6
|
||||
../Core/Src/eeprom.c:190:18:EE_Format 4
|
||||
../Core/Src/eeprom.c:208:17:EE_GetOtherPageBase 2
|
||||
../Core/Src/eeprom.c:214:18:EE_PageTransfer 11
|
||||
../Core/Src/eeprom.c:287:10:EE_Init 7
|
||||
../Core/Src/eeprom.c:318:10:EE_ReadVariable 2
|
||||
../Core/Src/eeprom.c:335:10:EE_WriteVariable 4
|
||||
../Core/Src/eeprom.c:358:6:loadEE 1
|
||||
|
||||
Binary file not shown.
@@ -1,13 +1,13 @@
|
||||
../Core/Src/eeprom.h:102:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.c:92:17:EE_GetPageStatus 16 static
|
||||
../Core/Src/eeprom.c:97:26:EE_FlashProgramHalfWord 32 static
|
||||
../Core/Src/eeprom.c:108:26:EE_FlashErasePage 40 static
|
||||
../Core/Src/eeprom.c:127:17:EE_FindFreeAddress 32 static
|
||||
../Core/Src/eeprom.c:149:18:EE_FindInPage 40 static
|
||||
../Core/Src/eeprom.c:189:18:EE_Format 8 static
|
||||
../Core/Src/eeprom.c:207:17:EE_GetOtherPageBase 16 static
|
||||
../Core/Src/eeprom.c:213:18:EE_PageTransfer 40 static
|
||||
../Core/Src/eeprom.c:286:10:EE_Init 16 static
|
||||
../Core/Src/eeprom.c:317:10:EE_ReadVariable 24 static
|
||||
../Core/Src/eeprom.c:334:10:EE_WriteVariable 24 static
|
||||
../Core/Src/eeprom.c:357:6:loadEE 8 static
|
||||
../Core/Src/eeprom.h:103:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.c:93:17:EE_GetPageStatus 16 static
|
||||
../Core/Src/eeprom.c:98:26:EE_FlashProgramHalfWord 32 static
|
||||
../Core/Src/eeprom.c:109:26:EE_FlashErasePage 40 static
|
||||
../Core/Src/eeprom.c:128:17:EE_FindFreeAddress 32 static
|
||||
../Core/Src/eeprom.c:150:18:EE_FindInPage 40 static
|
||||
../Core/Src/eeprom.c:190:18:EE_Format 8 static
|
||||
../Core/Src/eeprom.c:208:17:EE_GetOtherPageBase 16 static
|
||||
../Core/Src/eeprom.c:214:18:EE_PageTransfer 40 static
|
||||
../Core/Src/eeprom.c:287:10:EE_Init 16 static
|
||||
../Core/Src/eeprom.c:318:10:EE_ReadVariable 24 static
|
||||
../Core/Src/eeprom.c:335:10:EE_WriteVariable 24 static
|
||||
../Core/Src/eeprom.c:358:6:loadEE 8 static
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
../Core/Src/main.c:122:6:HAL_SYSTICK_Callback 13
|
||||
../Core/Src/main.c:165:6:managePulsanti 9
|
||||
../Core/Src/main.c:184:6:manageCiclo 90
|
||||
../Core/Src/main.c:414:5:main 2
|
||||
../Core/Src/main.c:497:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:545:13:MX_ADC1_Init 7
|
||||
../Core/Src/main.c:628:13:MX_TIM2_Init 9
|
||||
../Core/Src/main.c:704:13:MX_TIM4_Init 9
|
||||
../Core/Src/main.c:778:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:809:13:MX_DMA_Init 1
|
||||
../Core/Src/main.c:827:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:903:6:Error_Handler 1
|
||||
../Core/Src/main.c:123:6:HAL_SYSTICK_Callback 13
|
||||
../Core/Src/main.c:166:6:managePulsanti 9
|
||||
../Core/Src/main.c:185:6:manageCiclo 96
|
||||
../Core/Src/main.c:429:5:main 2
|
||||
../Core/Src/main.c:512:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:560:13:MX_ADC1_Init 7
|
||||
../Core/Src/main.c:643:13:MX_TIM2_Init 9
|
||||
../Core/Src/main.c:719:13:MX_TIM4_Init 9
|
||||
../Core/Src/main.c:793:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:824:13:MX_DMA_Init 1
|
||||
../Core/Src/main.c:842:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:918:6:Error_Handler 1
|
||||
|
||||
Binary file not shown.
@@ -1,12 +1,12 @@
|
||||
../Core/Src/main.c:122:6:HAL_SYSTICK_Callback 16 static
|
||||
../Core/Src/main.c:165:6:managePulsanti 4 static
|
||||
../Core/Src/main.c:184:6:manageCiclo 16 static
|
||||
../Core/Src/main.c:414:5:main 8 static
|
||||
../Core/Src/main.c:497:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:545:13:MX_ADC1_Init 24 static
|
||||
../Core/Src/main.c:628:13:MX_TIM2_Init 64 static
|
||||
../Core/Src/main.c:704:13:MX_TIM4_Init 64 static
|
||||
../Core/Src/main.c:778:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:809:13:MX_DMA_Init 16 static
|
||||
../Core/Src/main.c:827:13:MX_GPIO_Init 40 static
|
||||
../Core/Src/main.c:903:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:123:6:HAL_SYSTICK_Callback 16 static
|
||||
../Core/Src/main.c:166:6:managePulsanti 4 static
|
||||
../Core/Src/main.c:185:6:manageCiclo 16 static
|
||||
../Core/Src/main.c:429:5:main 8 static
|
||||
../Core/Src/main.c:512:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:560:13:MX_ADC1_Init 24 static
|
||||
../Core/Src/main.c:643:13:MX_TIM2_Init 64 static
|
||||
../Core/Src/main.c:719:13:MX_TIM4_Init 64 static
|
||||
../Core/Src/main.c:793:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:824:13:MX_DMA_Init 16 static
|
||||
../Core/Src/main.c:842:13:MX_GPIO_Init 40 static
|
||||
../Core/Src/main.c:918:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user