Rev 2972 Rev 2975
Line 31... Line 31...
31 #define GPS_BUFFER 500 31 #define GPS_BUFFER 500
32 #define PWM_PERIODA_NORMAL 20000 32 #define PWM_PERIODA_NORMAL 20000
33 #define PWM_SIRKA_NORMAL PWM_PERIODA_NORMAL/2 33 #define PWM_SIRKA_NORMAL PWM_PERIODA_NORMAL/2
34   34  
35 /*Pocet opakovani pro jednotlive faze odpalu (pocet = cas[s]*8) pro kompenzaci 8xrychlejsiho casovace na desce STM32F10xRxT01A */ 35 /*Pocet opakovani pro jednotlive faze odpalu (pocet = cas[s]*8) pro kompenzaci 8xrychlejsiho casovace na desce STM32F10xRxT01A */
-   36 #define TIMER_COMPENSATION 16
36 #define POCET_VENTIL (5*8) 37 #define POCET_VENTIL (5*TIMER_COMPENSATION)
37 #define POCET_LIS (1*8) 38 #define POCET_LIS (1*TIMER_COMPENSATION)
38 #define POCET_ZATAVENI (2*8) 39 #define POCET_ZATAVENI (10*TIMER_COMPENSATION)
39 #define POCET_STRECHA (5*8) 40 #define POCET_STRECHA (5*TIMER_COMPENSATION)
40 #define CEKANI_NA_STRECHU (10*8) 41 #define CEKANI_NA_STRECHU (10*TIMER_COMPENSATION)
41 #define CEKANI_NA_LIS (10*8) 42 #define CEKANI_NA_LIS (10*TIMER_COMPENSATION)
42   43  
43 /*makra pro cteni switch sensoru*/ 44 /*makra pro cteni switch sensoru*/
44 #define CTI_STRECHU palReadPad(STRECHA_SENS_PORT, STRECHA_SENS_STATE) 45 #define CTI_STRECHU palReadPad(STRECHA_SENS_PORT, STRECHA_SENS_STATE)
45 #define CTI_LIS palReadPad(LIS_SENS_PORT, LIS_SENS_STATE) 46 #define CTI_LIS palReadPad(LIS_SENS_PORT, LIS_SENS_STATE)
46   47  
Line 99... Line 100...
99 /* 100 /*
100 *Konfigurace casovace 2 101 *Konfigurace casovace 2
101 */ 102 */
102 static const GPTConfig gpt2cfg = 103 static const GPTConfig gpt2cfg =
103 { 104 {
104 500, /*500 Hz ? (puvodne 1000Hz) f*/ 105 1000, /* 1000Hz f*/
105 gpt2cb /*callback fce*/ 106 gpt2cb /*callback fce*/
106 }; 107 };
107   108  
108 /* 109 /*
109 * Vlakno pro blikani diodou 110 * Vlakno pro blikani diodou
Line 433... Line 434...
433 } 434 }
434 else if (strcmp(prikaz,"help") == 0) 435 else if (strcmp(prikaz,"help") == 0)
435 { 436 {
436 sdWrite(&SD1, uvitaci_zprava, sizeof(uvitaci_zprava)/sizeof(uint8_t)); 437 sdWrite(&SD1, uvitaci_zprava, sizeof(uvitaci_zprava)/sizeof(uint8_t));
437 } 438 }
-   439 else if(strcmp(prikaz,"check") == 0)
-   440 {
-   441 chprintf((BaseSequentialStream *)&SD1,"\r\nStav strechy: ");
-   442 if(CTI_STRECHU)
-   443 chprintf((BaseSequentialStream *)&SD1,"Otevrena\r\n");
-   444 else
-   445 chprintf((BaseSequentialStream *)&SD1,"Zavrena\r\n");
-   446 chprintf((BaseSequentialStream *)&SD1,"Stav lisu: ");
-   447 if(CTI_LIS)
-   448 chprintf((BaseSequentialStream *)&SD1,"Aktivni\r\n");
-   449 else
-   450 chprintf((BaseSequentialStream *)&SD1,"Rozepnuty\r\n");
-   451 }
438 else 452 else
439 { 453 {
440 uint8_t zp_neplatny[] = "Neplatny prikaz!\r\n\t<odpal> pro zahajeni sekvence\n\r\t<zrus> pro zruseni vypousteni\n\r"; 454 uint8_t zp_neplatny[] = "Neplatny prikaz!\r\n\t<odpal> pro zahajeni sekvence\n\r\t<zrus> pro zruseni vypousteni\n\r";
441 sdWrite(&SD1,zp_neplatny,sizeof(zp_neplatny)/sizeof(uint8_t)); 455 sdWrite(&SD1,zp_neplatny,sizeof(zp_neplatny)/sizeof(uint8_t));
442 palTogglePad(GPIOB, GPIOB_LED3); 456 palTogglePad(GPIOB, GPIOB_LED3);