Subversion Repositories DashDisplay

Rev

Rev 37 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37 Rev 38
Line 445... Line 445...
445
        if (cc == 0)
445
        if (cc == 0)
446
        {
446
        {
447
                timeout++;
447
                timeout++;
448
                if (timeout % 1000 == 0)
448
                if (timeout % 1000 == 0)
449
                {
449
                {
-
 
450
                        const char msg[] = "No data\r\n";
-
 
451
                        char * p = msg;
-
 
452
                        while(*p)
-
 
453
                        {
450
                        PutCharSerial(&uc3, '+');
454
                                PutCharSerial(&uc2,*p++);
-
 
455
                        }
-
 
456
 
451
                }
457
                }
-
 
458
 
452
                if (timeout > 60000)
459
                if (timeout > 60000)
453
                {
460
                {
454
                        // do turn off screen
461
                        // do turn off screen
455
                }
462
                }
456
 
463
 
Line 489... Line 496...
489
                                                        reading);
496
                                                        reading);
490
                                        int ck=0;
497
                                        int ck=0;
491
                                        while(outbuff[ck] && ck < 100)
498
                                        while(outbuff[ck] && ck < 100)
492
 
499
 
493
                                        {
500
                                        {
494
                                                PutCharSerial(&uc3, outbuff[ck++]);
501
                                                PutCharSerial(&uc2, outbuff[ck++]);
495
                                        }
502
                                        }
496
                                        DataVal = ConvPLX(Data.Sensor[i].ReadingH,
503
                                        DataVal = ConvPLX(Data.Sensor[i].ReadingH,
497
                                                        Data.Sensor[i].ReadingL);
504
                                                        Data.Sensor[i].ReadingL);
498
                                        if (DataVal > Max[i])
505
                                        if (DataVal > Max[i])
499
                                        {
506
                                        {
Line 604... Line 611...
604
{
611
{
605
 
612
 
606
  huart1.Instance = USART1;
613
  huart1.Instance = USART1;
607
  huart1.Init.BaudRate = 19200;
614
  huart1.Init.BaudRate = 19200;
608
  huart1.Init.WordLength = UART_WORDLENGTH_8B;
615
  huart1.Init.WordLength = UART_WORDLENGTH_8B;
609
  huart1.Init.StopBits = UART_STOPBITS_1;
616
  huart1.Init.StopBits = UART_STOPBITS_2;
610
  huart1.Init.Parity = UART_PARITY_NONE;
617
  huart1.Init.Parity = UART_PARITY_NONE;
611
  huart1.Init.Mode = UART_MODE_TX_RX;
618
  huart1.Init.Mode = UART_MODE_TX_RX;
612
  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
619
  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
613
  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
620
  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
614
  if (HAL_UART_Init(&huart1) != HAL_OK)
621
  if (HAL_UART_Init(&huart1) != HAL_OK)
Line 643... Line 650...
643
 
650
 
644
  huart3.Instance = USART3;
651
  huart3.Instance = USART3;
645
  huart3.Init.BaudRate = 19200;
652
  huart3.Init.BaudRate = 19200;
646
  huart3.Init.WordLength = UART_WORDLENGTH_8B;
653
  huart3.Init.WordLength = UART_WORDLENGTH_8B;
647
  huart3.Init.StopBits = UART_STOPBITS_1;
654
  huart3.Init.StopBits = UART_STOPBITS_1;
648
  huart3.Init.Parity = UART_PARITY_NONE;
655
  huart3.Init.Parity = UART_PARITY_ODD;
649
  huart3.Init.Mode = UART_MODE_TX_RX;
656
  huart3.Init.Mode = UART_MODE_TX_RX;
650
  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
657
  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
651
  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
658
  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
652
  if (HAL_UART_Init(&huart3) != HAL_OK)
659
  if (HAL_UART_Init(&huart3) != HAL_OK)
653
  {
660
  {