Rev 2971 Rev 2972
Line 32... Line 32...
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 POCET_VENTIL (5*8) 36 #define POCET_VENTIL (5*8)
37 #define POCET_LIS (15*8) 37 #define POCET_LIS (1*8)
38 #define POCET_ZATAVENI (5*8) 38 #define POCET_ZATAVENI (2*8)
39 #define POCET_STRECHA (8*8) 39 #define POCET_STRECHA (5*8)
40 #define CEKANI_NA_STRECHU (10*8) 40 #define CEKANI_NA_STRECHU (10*8)
41 #define CEKANI_NA_LIS (10*8) 41 #define CEKANI_NA_LIS (10*8)
42   42  
43 /*makra pro cteni switch sensoru*/ 43 /*makra pro cteni switch sensoru*/
44 #define CTI_STRECHU palReadPad(STRECHA_SENS_PORT, STRECHA_SENS_STATE) 44 #define CTI_STRECHU palReadPad(STRECHA_SENS_PORT, STRECHA_SENS_STATE)
45 #define CTI_LIS palReadPad(LIS_SENS_PORT, LIS_SENS_STATE) 45 #define CTI_LIS palReadPad(LIS_SENS_PORT, LIS_SENS_STATE)
46   46  
47 extern NMEA_GPGGA GPGGA_informace; 47 extern NMEA_GPGGA GPGGA_informace;
48 Thread *tp_odpal = NULL; 48 Thread *tp_odpal = NULL;
49 uint8_t uvitaci_zprava[] = "\r\n\r\n* * * * * * * * * * * * * * * * * * * * * * * * * *\r\nVita vas Automaticky Vypoustec Meteobalonu 1.1\r\nZapojeni vyvodu:\r\n\tGPIOB10 - ventil\r\n\tGPIOB11 - lis\r\n\tGPIOB12 - zataveni balonu\r\n\tGPIOB13 - otevreni krytu\r\nPrikazy:\r\n\t<odpal> zahajeni sekvence vypousteni\n\r\t<zrus> zruseni vypousteni\n\r\t<help> napoveda\r\n* * * * * * * * * * * * * * * * * * * * * * * * * *\r\n\r\n"; 49 uint8_t uvitaci_zprava[] = "\r\n\r\n* * * * * * * * * * * * * * * * * * * * * * * * * *\r\nVita vas Automaticky Vypoustec Meteobalonu 1.1\r\nZapojeni vyvodu:\r\n\tGPIOB10 - strecha\r\n\tGPIOB11 - ventil\r\n\tGPIOB12 - lis\r\n\tGPIOB13 - zataveni/odpojeni\r\nPrikazy:\r\n\t<odpal> zahajeni sekvence vypousteni\n\r\t<zrus> zruseni vypousteni\n\r\t<help> napoveda\r\n* * * * * * * * * * * * * * * * * * * * * * * * * *\r\n\r\n";
50   50  
51 //static PWMConfig pwmcfg = { 51 //static PWMConfig pwmcfg = {
52 //10000, /* 10kHz PWM clock frequency. */ 52 //10000, /* 10kHz PWM clock frequency. */
53 //PWM_PERIODA_NORMAL, /* PWM period 1S (in ticks). */ 53 //PWM_PERIODA_NORMAL, /* PWM period 1S (in ticks). */
54 /*NULL, 54 /*NULL,
Line 475... Line 475...
475 * Activates the serial driver 2 using the driver default configuration. 475 * Activates the serial driver 2 using the driver default configuration.
476 * PA2 and PA3 are routed to USART2. 476 * PA2 and PA3 are routed to USART2.
477 *GPS 477 *GPS
478 */ 478 */
479 sdStart(&SD2, &USART2_config); 479 sdStart(&SD2, &USART2_config);
480 palSetPadMode(GPIOA, 2, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); //TX 480 palSetPadMode(GPIOA, 2, PAL_MODE_STM32_ALTERNATE_PUSHPULL); //TX
481 palSetPadMode(GPIOA, 3, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); //RX - overrides board.h PadValues 481 //palSetPadMode(GPIOA, 3, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); //RX - overrides board.h PadValues
482 482
483 /* 483 /*
484 * LED na vyvojove desce 484 * LED na vyvojove desce
485 */ 485 */
486 palSetPadMode(GPIOB, GPIOB_LED3, PAL_MODE_OUTPUT_PUSHPULL); 486 palSetPadMode(GPIOB, GPIOB_LED3, PAL_MODE_OUTPUT_PUSHPULL);
Line 544... Line 544...
544 pocet_znaku = 0; 544 pocet_znaku = 0;
545 dekodujPrikaz(prikaz); 545 dekodujPrikaz(prikaz);
546 prikaz[0] = 0; 546 prikaz[0] = 0;
547 } 547 }
548 /*Uklada prikaz*/ 548 /*Uklada prikaz*/
-   549 else if (znaky[0] == 's') // ukonci odpalovani
-   550 {
-   551 chSysLockFromIsr();
-   552 if (tp_odpal != NULL) {
-   553 tp_odpal->p_u.rdymsg = (msg_t)2; /* zakazano pokracovat v odpalovaci sekvenci*/
-   554 chSchReadyI(tp_odpal);
-   555 tp_odpal = NULL;
-   556 }
-   557 chSysUnlockFromIsr();
-   558 }
549 else 559 else
550 { 560 {
551 prikaz[pocet_znaku + 1] = 0; 561 prikaz[pocet_znaku + 1] = 0;
552 prikaz[pocet_znaku++] = znaky[0]; 562 prikaz[pocet_znaku++] = znaky[0];
553 } 563 }