wip
This commit is contained in:
@@ -55,6 +55,7 @@ typedef enum{
|
||||
omM4bw1,
|
||||
omM4bw2,
|
||||
omStopMan,
|
||||
omapertura0,
|
||||
omapertura1,
|
||||
omapertura2,
|
||||
omapertura3,
|
||||
|
||||
@@ -29,6 +29,7 @@ extern uint16_t t2ch;
|
||||
extern uint16_t t3ch;
|
||||
extern uint16_t t4ch;
|
||||
extern uint16_t twch;
|
||||
extern uint16_t tramp1;
|
||||
extern uint16_t trampman;
|
||||
extern uint16_t m1pwmMan;
|
||||
extern uint16_t m2pwmMan;
|
||||
@@ -53,7 +54,7 @@ const uint8_t deftab[32]={
|
||||
10, //t3ap
|
||||
40, //t4ap
|
||||
1, //twap
|
||||
20, //t1ch
|
||||
27, //t1ch
|
||||
10, //t2ch
|
||||
30, //t3ch
|
||||
1, //t4ch
|
||||
@@ -61,7 +62,7 @@ const uint8_t deftab[32]={
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
100, //tramp1
|
||||
60, //m1pwmMan
|
||||
70, //m2pwmMan
|
||||
40, //m3pwmMan
|
||||
@@ -379,6 +380,7 @@ void loadEE(void){
|
||||
EEW_Read(T3CH, &t3ch);
|
||||
EEW_Read(T4CH, &t4ch);
|
||||
EEW_Read(TWCH, &twch);
|
||||
EEW_Read(TRAMP1, &tramp1);
|
||||
EEW_Read(M1PWMMAN, &m1pwmMan);
|
||||
EEW_Read(M2PWMMAN, &m2pwmMan);
|
||||
EEW_Read(M3PWMMAN, &m3pwmMan);
|
||||
|
||||
@@ -89,6 +89,7 @@ typedef enum
|
||||
#define T4CH 20 //t4ch
|
||||
#define TWCH 21 //twch
|
||||
|
||||
#define TRAMP1 25 //tramp1
|
||||
#define M1PWMMAN 26 //m1pwmMan
|
||||
#define M2PWMMAN 27 //m2pwmMan
|
||||
#define M3PWMMAN 28 //m3pwmMan
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
typedef enum{
|
||||
bzoff,
|
||||
bzmoving,
|
||||
bzwarning,
|
||||
}stBuz_st;
|
||||
/* USER CODE END PTD */
|
||||
|
||||
@@ -109,6 +110,7 @@ uint16_t t3ch;
|
||||
uint16_t t4ch;
|
||||
uint16_t twch;
|
||||
uint16_t tramp;
|
||||
uint16_t tramp1;
|
||||
uint16_t trampman;
|
||||
uint16_t m1pwmMan;
|
||||
uint16_t m2pwmMan;
|
||||
@@ -171,6 +173,8 @@ void HAL_SYSTICK_Callback(void){
|
||||
//**** gestione buzzer *****************************************************************************
|
||||
if(stBuz==bzmoving){
|
||||
if(c1s>=5)HAL_GPIO_WritePin(GPIOA, BUZ_Pin, GPIO_PIN_RESET);else HAL_GPIO_WritePin(GPIOA, BUZ_Pin, GPIO_PIN_SET);
|
||||
}else if(stBuz==bzwarning){
|
||||
if(c1s&2)HAL_GPIO_WritePin(GPIOA, BUZ_Pin, GPIO_PIN_RESET);else HAL_GPIO_WritePin(GPIOA, BUZ_Pin, GPIO_PIN_SET);
|
||||
}else{//bzoff
|
||||
HAL_GPIO_WritePin(GPIOA, BUZ_Pin, GPIO_PIN_RESET);
|
||||
}
|
||||
@@ -201,7 +205,7 @@ void managePulsanti(void){
|
||||
else if(rtP2<=190)stPulsanti|=P2STOP;
|
||||
rtP2=200;
|
||||
}
|
||||
stPulsanti&=(!(M1FW|M1BW|M3FW|M3BW|M4FW|M4BW));
|
||||
stPulsanti&=(P1START|P1STOP|P2START|P2STOP);
|
||||
if(stPulsanti==0){
|
||||
switch(pulsanti&0x3c){
|
||||
case 0x00:
|
||||
@@ -239,43 +243,43 @@ void manageCiclo(void){
|
||||
switch(stCiclo){
|
||||
case omchiuso:
|
||||
if(stPulsanti&P1START){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M2,BW,mrampstart[M2-1],m2pwmap,tramp,RAMPINIT);
|
||||
stCiclo=omapertura1;
|
||||
stBuz=bzwarning;
|
||||
rtCiclo=3;
|
||||
stCiclo=omapertura0;
|
||||
}else if(stPulsanti&P1STOP)stCiclo=omstopapertura;
|
||||
else if(stPulsanti&M1FW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M1,FW,mrampstart[M1-1],m1pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM1fw1;
|
||||
}else if(stPulsanti&M1BW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M1,BW,mrampstart[M1-1],m1pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM1bw1;
|
||||
}else if(stPulsanti&M2FW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M2,FW,mrampstart[M2-1],m2pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM2fw1;
|
||||
}else if(stPulsanti&M2BW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M2,BW,mrampstart[M2-1],m2pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM2bw1;
|
||||
}else if(stPulsanti&M3FW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M3,FW,mrampstart[M3-1],m3pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM3fw1;
|
||||
}else if(stPulsanti&M3BW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M3,BW,mrampstart[M3-1],m3pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM3bw1;
|
||||
}else if(stPulsanti&M4FW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M4,FW,mrampstart[M4-1],m3pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM4fw1;
|
||||
}else if(stPulsanti&M4BW){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M4,BW,mrampstart[M4-1],m3pwmMan,trampman,RAMPINIT);
|
||||
stCiclo=omM4bw1;
|
||||
}
|
||||
// else if(stPulsanti&M1FW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M1,FW,mrampstart[M1-1],m1pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM1fw1;
|
||||
// }else if(stPulsanti&M1BW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M1,BW,mrampstart[M1-1],m1pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM1bw1;
|
||||
// }else if(stPulsanti&M2FW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M2,FW,mrampstart[M2-1],m2pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM2fw1;
|
||||
// }else if(stPulsanti&M2BW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M2,BW,mrampstart[M2-1],m2pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM2bw1;
|
||||
// }else if(stPulsanti&M3FW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M3,FW,mrampstart[M3-1],m3pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM3fw1;
|
||||
// }else if(stPulsanti&M3BW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M3,BW,mrampstart[M3-1],m3pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM3bw1;
|
||||
// }else if(stPulsanti&M4FW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M4,FW,mrampstart[M4-1],m3pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM4fw1;
|
||||
// }else if(stPulsanti&M4BW){
|
||||
// stBuz=bzmoving;
|
||||
// (void)ramp(M4,BW,mrampstart[M4-1],m3pwmMan,trampman,RAMPINIT);
|
||||
// stCiclo=omM4bw1;
|
||||
// }
|
||||
break;
|
||||
case omM1fw1:
|
||||
(void)ramp(M1,FW,mrampstart[M1-1],m1pwmMan,trampman,RAMPRUN);
|
||||
@@ -355,6 +359,13 @@ void manageCiclo(void){
|
||||
stCiclo=omaperto;
|
||||
}
|
||||
break;
|
||||
case omapertura0:
|
||||
if(rtCiclo==0){
|
||||
stBuz=bzmoving;
|
||||
(void)ramp(M2,BW,mrampstart[M2-1],m2pwmap,tramp,RAMPINIT);
|
||||
stCiclo=omapertura1;
|
||||
}
|
||||
break;
|
||||
case omapertura1:
|
||||
if(ramp(M2,BW,mrampstart[M2-1],m2pwmap,tramp,RAMPRUN)==DONE){
|
||||
rtCiclo=t1ap;
|
||||
|
||||
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:109:24:EEW_Read 1
|
||||
../Core/Src/eeprom.h:114:24:EEW_Write 1
|
||||
../Core/Src/eeprom.h:110:24:EEW_Read 1
|
||||
../Core/Src/eeprom.h:115: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:109:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.h:114:24:EEW_Write 16 static
|
||||
../Core/Src/eeprom.h:110:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.h:115: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
|
||||
|
||||
Binary file not shown.
@@ -1,13 +1,13 @@
|
||||
../Core/Src/eeprom.h:109:24:EEW_Read 1
|
||||
../Core/Src/eeprom.c:98:17:EE_GetPageStatus 1
|
||||
../Core/Src/eeprom.c:103:26:EE_FlashProgramHalfWord 1
|
||||
../Core/Src/eeprom.c:114:26:EE_FlashErasePage 1
|
||||
../Core/Src/eeprom.c:133:17:EE_FindFreeAddress 3
|
||||
../Core/Src/eeprom.c:155:18:EE_FindInPage 6
|
||||
../Core/Src/eeprom.c:195:18:EE_Format 4
|
||||
../Core/Src/eeprom.c:213:17:EE_GetOtherPageBase 2
|
||||
../Core/Src/eeprom.c:219:18:EE_PageTransfer 11
|
||||
../Core/Src/eeprom.c:292:10:EE_Init 7
|
||||
../Core/Src/eeprom.c:323:10:EE_ReadVariable 2
|
||||
../Core/Src/eeprom.c:340:10:EE_WriteVariable 4
|
||||
../Core/Src/eeprom.c:363:6:loadEE 1
|
||||
../Core/Src/eeprom.h:110:24:EEW_Read 1
|
||||
../Core/Src/eeprom.c:99:17:EE_GetPageStatus 1
|
||||
../Core/Src/eeprom.c:104:26:EE_FlashProgramHalfWord 1
|
||||
../Core/Src/eeprom.c:115:26:EE_FlashErasePage 1
|
||||
../Core/Src/eeprom.c:134:17:EE_FindFreeAddress 3
|
||||
../Core/Src/eeprom.c:156:18:EE_FindInPage 6
|
||||
../Core/Src/eeprom.c:196:18:EE_Format 4
|
||||
../Core/Src/eeprom.c:214:17:EE_GetOtherPageBase 2
|
||||
../Core/Src/eeprom.c:220:18:EE_PageTransfer 11
|
||||
../Core/Src/eeprom.c:293:10:EE_Init 7
|
||||
../Core/Src/eeprom.c:324:10:EE_ReadVariable 2
|
||||
../Core/Src/eeprom.c:341:10:EE_WriteVariable 4
|
||||
../Core/Src/eeprom.c:364:6:loadEE 1
|
||||
|
||||
Binary file not shown.
@@ -1,13 +1,13 @@
|
||||
../Core/Src/eeprom.h:109:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.c:98:17:EE_GetPageStatus 16 static
|
||||
../Core/Src/eeprom.c:103:26:EE_FlashProgramHalfWord 32 static
|
||||
../Core/Src/eeprom.c:114:26:EE_FlashErasePage 40 static
|
||||
../Core/Src/eeprom.c:133:17:EE_FindFreeAddress 32 static
|
||||
../Core/Src/eeprom.c:155:18:EE_FindInPage 40 static
|
||||
../Core/Src/eeprom.c:195:18:EE_Format 8 static
|
||||
../Core/Src/eeprom.c:213:17:EE_GetOtherPageBase 16 static
|
||||
../Core/Src/eeprom.c:219:18:EE_PageTransfer 40 static
|
||||
../Core/Src/eeprom.c:292:10:EE_Init 16 static
|
||||
../Core/Src/eeprom.c:323:10:EE_ReadVariable 24 static
|
||||
../Core/Src/eeprom.c:340:10:EE_WriteVariable 24 static
|
||||
../Core/Src/eeprom.c:363:6:loadEE 8 static
|
||||
../Core/Src/eeprom.h:110:24:EEW_Read 16 static
|
||||
../Core/Src/eeprom.c:99:17:EE_GetPageStatus 16 static
|
||||
../Core/Src/eeprom.c:104:26:EE_FlashProgramHalfWord 32 static
|
||||
../Core/Src/eeprom.c:115:26:EE_FlashErasePage 40 static
|
||||
../Core/Src/eeprom.c:134:17:EE_FindFreeAddress 32 static
|
||||
../Core/Src/eeprom.c:156:18:EE_FindInPage 40 static
|
||||
../Core/Src/eeprom.c:196:18:EE_Format 8 static
|
||||
../Core/Src/eeprom.c:214:17:EE_GetOtherPageBase 16 static
|
||||
../Core/Src/eeprom.c:220:18:EE_PageTransfer 40 static
|
||||
../Core/Src/eeprom.c:293:10:EE_Init 16 static
|
||||
../Core/Src/eeprom.c:324:10:EE_ReadVariable 24 static
|
||||
../Core/Src/eeprom.c:341:10:EE_WriteVariable 24 static
|
||||
../Core/Src/eeprom.c:364:6:loadEE 8 static
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
../Core/Src/main.c:139:6:HAL_SYSTICK_Callback 18
|
||||
../Core/Src/main.c:187:6:managePulsanti 23
|
||||
../Core/Src/main.c:237:6:manageCiclo 150
|
||||
../Core/Src/main.c:629:5:main 2
|
||||
../Core/Src/main.c:713:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:761:13:MX_ADC1_Init 7
|
||||
../Core/Src/main.c:844:13:MX_TIM2_Init 9
|
||||
../Core/Src/main.c:920:13:MX_TIM4_Init 9
|
||||
../Core/Src/main.c:994:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:1025:13:MX_DMA_Init 1
|
||||
../Core/Src/main.c:1043:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:1119:6:Error_Handler 1
|
||||
../Core/Src/main.c:141:6:HAL_SYSTICK_Callback 20
|
||||
../Core/Src/main.c:191:6:managePulsanti 23
|
||||
../Core/Src/main.c:241:6:manageCiclo 144
|
||||
../Core/Src/main.c:640:5:main 2
|
||||
../Core/Src/main.c:724:6:SystemClock_Config 4
|
||||
../Core/Src/main.c:772:13:MX_ADC1_Init 7
|
||||
../Core/Src/main.c:855:13:MX_TIM2_Init 9
|
||||
../Core/Src/main.c:931:13:MX_TIM4_Init 9
|
||||
../Core/Src/main.c:1005:13:MX_USART1_UART_Init 2
|
||||
../Core/Src/main.c:1036:13:MX_DMA_Init 1
|
||||
../Core/Src/main.c:1054:13:MX_GPIO_Init 1
|
||||
../Core/Src/main.c:1130:6:Error_Handler 1
|
||||
|
||||
Binary file not shown.
@@ -1,12 +1,12 @@
|
||||
../Core/Src/main.c:139:6:HAL_SYSTICK_Callback 16 static
|
||||
../Core/Src/main.c:187:6:managePulsanti 4 static
|
||||
../Core/Src/main.c:237:6:manageCiclo 16 static
|
||||
../Core/Src/main.c:629:5:main 8 static
|
||||
../Core/Src/main.c:713:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:761:13:MX_ADC1_Init 24 static
|
||||
../Core/Src/main.c:844:13:MX_TIM2_Init 64 static
|
||||
../Core/Src/main.c:920:13:MX_TIM4_Init 64 static
|
||||
../Core/Src/main.c:994:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:1025:13:MX_DMA_Init 16 static
|
||||
../Core/Src/main.c:1043:13:MX_GPIO_Init 40 static
|
||||
../Core/Src/main.c:1119:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
../Core/Src/main.c:141:6:HAL_SYSTICK_Callback 16 static
|
||||
../Core/Src/main.c:191:6:managePulsanti 4 static
|
||||
../Core/Src/main.c:241:6:manageCiclo 16 static
|
||||
../Core/Src/main.c:640:5:main 8 static
|
||||
../Core/Src/main.c:724:6:SystemClock_Config 88 static
|
||||
../Core/Src/main.c:772:13:MX_ADC1_Init 24 static
|
||||
../Core/Src/main.c:855:13:MX_TIM2_Init 64 static
|
||||
../Core/Src/main.c:931:13:MX_TIM4_Init 64 static
|
||||
../Core/Src/main.c:1005:13:MX_USART1_UART_Init 8 static
|
||||
../Core/Src/main.c:1036:13:MX_DMA_Init 16 static
|
||||
../Core/Src/main.c:1054:13:MX_GPIO_Init 40 static
|
||||
../Core/Src/main.c:1130: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