Rev 36 | Rev 38 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 36 | Rev 37 | ||
|---|---|---|---|
| Line 483... | Line 483... | ||
| 483 | uint8_t inst = Data.Sensor[i].Instance; |
483 | uint8_t inst = Data.Sensor[i].Instance; |
| 484 | uint16_t reading = ConvPLX(Data.Sensor[i].ReadingH, |
484 | uint16_t reading = ConvPLX(Data.Sensor[i].ReadingH, |
| 485 | Data.Sensor[i].ReadingL); |
485 | Data.Sensor[i].ReadingL); |
| 486 | 486 | ||
| 487 | char outbuff[100]; |
487 | char outbuff[100]; |
| 488 | int cnt = small_sprintf(outbuff, "%d,%d,%d\r\n", addr, inst, |
488 | int cnt = small_sprintf(outbuff, "%d,%d,%d\n\r", addr, inst, |
| 489 | reading); |
489 | reading); |
| 490 | int ck; |
490 | int ck=0; |
| 491 | for (ck = 0; ck < cnt; ck++) |
491 | while(outbuff[ck] && ck < 100) |
| 492 | 492 | ||
| 493 | { |
493 | { |
| 494 | PutCharSerial(&uc3, outbuff[ck]); |
494 | PutCharSerial(&uc3, outbuff[ck++]); |
| 495 | } |
495 | } |
| 496 | DataVal = ConvPLX(Data.Sensor[i].ReadingH, |
496 | DataVal = ConvPLX(Data.Sensor[i].ReadingH, |
| 497 | Data.Sensor[i].ReadingL); |
497 | Data.Sensor[i].ReadingL); |
| 498 | if (DataVal > Max[i]) |
498 | if (DataVal > Max[i]) |
| 499 | { |
499 | { |
| Line 678... | Line 678... | ||
| 678 | HAL_GPIO_WritePin(GPIOA, SPI_NSS1_Pin|SPI1CD_Pin|BT_BUTTON_Pin, GPIO_PIN_RESET); |
678 | HAL_GPIO_WritePin(GPIOA, SPI_NSS1_Pin|SPI1CD_Pin|BT_BUTTON_Pin, GPIO_PIN_RESET); |
| 679 | 679 | ||
| 680 | /*Configure GPIO pin Output Level */ |
680 | /*Configure GPIO pin Output Level */ |
| 681 | HAL_GPIO_WritePin(GPIOC, SPI_RESET_Pin|SPI_NSS2_Pin|POWER_LATCH_Pin|USB_PWR_Pin, GPIO_PIN_RESET); |
681 | HAL_GPIO_WritePin(GPIOC, SPI_RESET_Pin|SPI_NSS2_Pin|POWER_LATCH_Pin|USB_PWR_Pin, GPIO_PIN_RESET); |
| 682 | 682 | ||
| 683 | /*Configure GPIO pins : SPI_NSS1_Pin SPI1CD_Pin BT_BUTTON_Pin */ |
683 | /*Configure GPIO pins : SPI_NSS1_Pin SPI1CD_Pin */ |
| 684 | GPIO_InitStruct.Pin = SPI_NSS1_Pin|SPI1CD_Pin|BT_BUTTON_Pin; |
684 | GPIO_InitStruct.Pin = SPI_NSS1_Pin|SPI1CD_Pin; |
| 685 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
685 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
| 686 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
686 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
| 687 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
687 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
| 688 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
688 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
| 689 | 689 | ||
| Line 710... | Line 710... | ||
| 710 | GPIO_InitStruct.Pin = IGNITION_Pin; |
710 | GPIO_InitStruct.Pin = IGNITION_Pin; |
| 711 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT; |
711 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT; |
| 712 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
712 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
| 713 | HAL_GPIO_Init(IGNITION_GPIO_Port, &GPIO_InitStruct); |
713 | HAL_GPIO_Init(IGNITION_GPIO_Port, &GPIO_InitStruct); |
| 714 | 714 | ||
| - | 715 | /*Configure GPIO pin : BT_BUTTON_Pin */ |
|
| - | 716 | GPIO_InitStruct.Pin = BT_BUTTON_Pin; |
|
| - | 717 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; |
|
| - | 718 | GPIO_InitStruct.Pull = GPIO_NOPULL; |
|
| - | 719 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; |
|
| - | 720 | HAL_GPIO_Init(BT_BUTTON_GPIO_Port, &GPIO_InitStruct); |
|
| - | 721 | ||
| 715 | } |
722 | } |
| 716 | 723 | ||
| 717 | /* USER CODE BEGIN 4 */ |
724 | /* USER CODE BEGIN 4 */ |
| 718 | 725 | ||
| 719 | /* USER CODE END 4 */ |
726 | /* USER CODE END 4 */ |