annotate Small_CPU/Src/uart.c @ 722:47a9ba771119

Show saturation in large font (T3) view: In case the DecoTTS custom view is active then the saturation will be displayed if the diver is close to the surface (TTS < 1 minute).
author Ideenmodellierer
date Thu, 05 Jan 2023 18:25:47 +0100
parents fceae45b3a69
children 621265ec3d23
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file uart.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V0.0.1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 27-March-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief button control
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 @verbatim
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ==============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 ##### How to use #####
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ==============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 @endverbatim
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * <h2><center>&copy; COPYRIGHT(c) 2015 heinrichs weikamp</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 #include "uart.h"
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
23 #include "externalInterface.h"
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
24 #include "data_exchange.h"
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
25 #include <string.h> /* memset */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
29 #define CHUNK_SIZE (25u) /* the DMA will handle chunk size transfers */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
30 #define CHUNKS_PER_BUFFER (5u)
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
31 UART_HandleTypeDef huart1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
32
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
33 DMA_HandleTypeDef hdma_usart1_rx;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
35 uint8_t rxBuffer[CHUNK_SIZE * CHUNKS_PER_BUFFER]; /* The complete buffer has a X * chunk size to allow fariations in buffer read time */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
36 static uint8_t rxWriteIndex; /* Index of the data item which is analysed */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
37 static uint8_t rxReadIndex; /* Index at which new data is stared */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
38 static uint8_t lastCmdIndex; /* Index of last command which has not been completly received */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
39 static uint8_t dmaActive; /* Indicator if DMA receiption needs to be started */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
41 static SSensorDataDiveO2 sensorDataDiveO2; /* intermediate storage for additional sensor data */
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
42
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
43 char tmpRxBuf[30];
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
44 uint8_t tmpRxIdx = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
45
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
46 static uartO2Status_t Comstatus_O2 = UART_O2_INIT;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
47
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
48 float LED_Level = 0.0; /* Normalized LED value which may be used as indication for the health status of the sensor */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
49 float LED_ZeroOffset = 0.0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
50 float pCO2 = 0.0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
53 void MX_USART1_UART_Init(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
55 /* regular init */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
56
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
57 huart1.Instance = USART1;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
58
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
59 if(externalInterface_GetUARTProtocol() == 0x04)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
60 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
61 huart1.Init.BaudRate = 19200;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
62 Comstatus_O2 = UART_O2_INIT;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
63 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
64 else
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
65 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
66 huart1.Init.BaudRate = 9600;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
67 }
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
68 huart1.Init.WordLength = UART_WORDLENGTH_8B;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
69 huart1.Init.StopBits = UART_STOPBITS_1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
70 huart1.Init.Parity = UART_PARITY_NONE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
71 huart1.Init.Mode = UART_MODE_TX_RX;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
72 huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
73 huart1.Init.OverSampling = UART_OVERSAMPLING_16;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
74
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
75 HAL_UART_Init(&huart1);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
76
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
77 MX_USART1_DMA_Init();
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
78
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
79 rxReadIndex = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
80 lastCmdIndex = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
81 rxWriteIndex = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
82 dmaActive = 0;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
83 Comstatus_O2 = UART_O2_INIT;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
84 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
86 void MX_USART1_UART_DeInit(void)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
87 {
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
88 HAL_DMA_Abort(&hdma_usart1_rx);
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
89 HAL_DMA_DeInit(&hdma_usart1_rx);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
90 HAL_UART_DeInit(&huart1);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
91 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
92
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
93 void MX_USART1_DMA_Init()
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
94 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
95 /* DMA controller clock enable */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
96 __DMA2_CLK_ENABLE();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
97
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
98 /* Peripheral DMA init*/
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
99 hdma_usart1_rx.Instance = DMA2_Stream5;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
100 hdma_usart1_rx.Init.Channel = DMA_CHANNEL_4;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
101 hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; //DMA_MEMORY_TO_PERIPH;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
102 hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
103 hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
104 hdma_usart1_rx.Init.PeriphDataAlignment = DMA_MDATAALIGN_BYTE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
105 hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
106 hdma_usart1_rx.Init.Mode = DMA_NORMAL;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
107 hdma_usart1_rx.Init.Priority = DMA_PRIORITY_LOW;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
108 hdma_usart1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
109 HAL_DMA_Init(&hdma_usart1_rx);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
110
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
111 __HAL_LINKDMA(&huart1,hdmarx,hdma_usart1_rx);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
112
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
113 /* DMA interrupt init */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
114 HAL_NVIC_SetPriority(DMA2_Stream5_IRQn, 0, 0);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
115 HAL_NVIC_EnableIRQ(DMA2_Stream5_IRQn);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117
690
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
118 void ConvertByteToHexString(uint8_t byte, char* str)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
119 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
120 uint8_t worker = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
121 uint8_t digit = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
122 uint8_t digitCnt = 1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123
690
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
124 worker = byte;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
125 while((worker!=0) && (digitCnt != 255))
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
126 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
127 digit = worker % 16;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
128 if( digit < 10)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
129 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
130 digit += '0';
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
131 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
132 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
133 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
134 digit += 'A' - 10;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
135 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
136 str[digitCnt--]= digit;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
137 worker = worker / 16;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
138 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
139 }
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
140
690
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
141
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
142 #ifdef ENABLE_CO2_SUPPORT
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
143 void HandleUARTCO2Data(void)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
145 uint8_t localRX = rxReadIndex;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
146 uint8_t dataType = 0;
690
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
147 uint32_t dataValue = 0;
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
148 static receiveState_t rxState = RX_Ready;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
149 static uint32_t lastReceiveTick = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
150
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
151 while(localRX != rxWriteIndex)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
152 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
153 lastReceiveTick = HAL_GetTick();
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
154 if(rxState == RX_Ready) /* identify data content */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
155 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
156 switch(rxBuffer[localRX])
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
157 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
158 case 'l':
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
159 case 'D':
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
160 case 'Z':
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
161 dataType = rxBuffer[localRX];
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
162 rxState = RX_Data0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
163 dataValue = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
164 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
165
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
166 default: /* unknown or corrupted => ignore */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
167 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
168 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
169 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
170 else if((rxState >= RX_Data0) && (rxState <= RX_Data4))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
171 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
172 if((rxBuffer[localRX] >= '0') && (rxBuffer[localRX] <= '9'))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
173 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
174 dataValue = dataValue * 10 + (rxBuffer[localRX] - '0');
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
175 rxState++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
176 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
177 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
178 if((rxBuffer[localRX] == ' ') || (rxBuffer[localRX] == '\n')) /* Abort data detection */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
179 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
180 if(rxState == RX_DataComplete)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
181 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
182 if(externalInterface_GetCO2State() == 0)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
183 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
184 externalInterface_SetCO2State(EXT_INTERFACE_33V_ON);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
185 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
186 switch(dataType)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
187 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
188 case 'D': externalInterface_SetCO2SignalStrength(dataValue);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
189 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
190 case 'l': LED_ZeroOffset = dataValue;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
191 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
192 case 'Z': externalInterface_SetCO2Value(dataValue);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
193 break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
194 default: break;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
195 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
196 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
197 if(rxState != RX_Data0) /* reset state machine because message in wrong format */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
198 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
199 rxState = RX_Ready;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
200 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
201 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
202
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
203 localRX++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
204 rxReadIndex++;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
205 if(rxReadIndex >= CHUNK_SIZE * CHUNKS_PER_BUFFER)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
206 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
207 localRX = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
208 rxReadIndex = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
209 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
210 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
211
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
212 if(time_elapsed_ms(lastReceiveTick,HAL_GetTick()) > 2000) /* check for communication timeout */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
213 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
214 externalInterface_SetCO2State(0);
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
215 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
216
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
217 if((dmaActive == 0) && (externalInterface_isEnabledPower33())) /* Should never happen in normal operation => restart in case of communication error */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
218 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
219 if(HAL_OK == HAL_UART_Receive_DMA (&huart1, &rxBuffer[rxWriteIndex], CHUNK_SIZE))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
220 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
221 dmaActive = 1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
222 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
223 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 }
690
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
225 #endif
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
226
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
227 #ifdef ENABLE_SENTINEL_MODE
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
228 void HandleUARTSentinelData(void)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
229 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
230 uint8_t localRX = rxReadIndex;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
231 static uint8_t dataType = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
232 static uint32_t dataValue[3];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
233 static uint8_t dataValueIdx = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
234 static receiveState_t rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
235 static uint32_t lastReceiveTick = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
236 static uint8_t lastAlive = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
237 static uint8_t curAlive = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
238 static uint8_t checksum = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
239 char checksum_str[]="00";
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
240
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
241 while(localRX != rxWriteIndex)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
242 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
243 lastReceiveTick = HAL_GetTick();
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
244
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
245 switch(rxState)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
246 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
247 case RX_Ready: if((rxBuffer[localRX] >= 'a') && (rxBuffer[localRX] <= 'z'))
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
248 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
249 rxState = RX_DetectStart;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
250 curAlive = rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
251 checksum = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
252 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
253 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
254
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
255 case RX_DetectStart: checksum += rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
256 if(rxBuffer[localRX] == '1')
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
257 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
258 rxState = RX_SelectData;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
259 dataType = 0xFF;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
260
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
261 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
262 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
263 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
264 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
265 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
266 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
267
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
268 case RX_SelectData: checksum += rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
269 switch(rxBuffer[localRX])
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
270 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
271 case 'T': dataType = rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
272 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
273 case '0': if(dataType != 0xff)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
274 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
275 rxState = RX_Data0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
276 dataValueIdx = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
277 dataValue[0] = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
278
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
279 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
280 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
281 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
282 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
283 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
284 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
285 default: rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
286 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
287 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
288
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
289 case RX_Data0:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
290 case RX_Data1:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
291 case RX_Data2:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
292 case RX_Data4:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
293 case RX_Data5:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
294 case RX_Data6:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
295 case RX_Data8:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
296 case RX_Data9:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
297 case RX_Data10: checksum += rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
298 if((rxBuffer[localRX] >= '0') && (rxBuffer[localRX] <= '9'))
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
299 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
300 dataValue[dataValueIdx] = dataValue[dataValueIdx] * 10 + (rxBuffer[localRX] - '0');
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
301 rxState++;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
302 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
303 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
304 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
305 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
306 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
307 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
308
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
309 case RX_Data3:
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
310 case RX_Data7: checksum += rxBuffer[localRX];
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
311 if(rxBuffer[localRX] == '0')
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
312 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
313 rxState++;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
314 dataValueIdx++;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
315 dataValue[dataValueIdx] = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
316 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
317 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
318 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
319 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
320 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
321 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
322 case RX_Data11: rxState = RX_DataComplete;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
323 ConvertByteToHexString(checksum,checksum_str);
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
324 if(rxBuffer[localRX] == checksum_str[0])
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
325 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
326 rxState = RX_DataComplete;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
327 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
328 else
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
329 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
330 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
331 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
332
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
333 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
334
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
335 case RX_DataComplete: if(rxBuffer[localRX] == checksum_str[1])
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
336 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
337 setExternalInterfaceChannel(0,(float)(dataValue[0] / 10.0));
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
338 setExternalInterfaceChannel(1,(float)(dataValue[1] / 10.0));
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
339 setExternalInterfaceChannel(2,(float)(dataValue[2] / 10.0));
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
340 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
341 rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
342 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
343
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
344
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
345 default: rxState = RX_Ready;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
346 break;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
347
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
348 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
349
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
350 localRX++;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
351 rxReadIndex++;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
352 if(rxReadIndex >= CHUNK_SIZE * CHUNKS_PER_BUFFER)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
353 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
354 localRX = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
355 rxReadIndex = 0;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
356 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
357 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
358
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
359 if(time_elapsed_ms(lastReceiveTick,HAL_GetTick()) > 4000) /* check for communication timeout */
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
360 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
361 if(curAlive == lastAlive)
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
362 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
363 setExternalInterfaceChannel(0,0.0);
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
364 setExternalInterfaceChannel(1,0.0);
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
365 setExternalInterfaceChannel(2,0.0);
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
366 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
367 lastAlive = curAlive;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
368 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
369
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
370 if((dmaActive == 0) && (externalInterface_isEnabledPower33())) /* Should never happen in normal operation => restart in case of communication error */
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
371 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
372 if(HAL_OK == HAL_UART_Receive_DMA (&huart1, &rxBuffer[rxWriteIndex], CHUNK_SIZE))
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
373 {
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
374 dmaActive = 1;
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
375 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
376 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
377 }
fca2bd25e6e2 Added Sentinel protocoll support:
Ideenmodellierer
parents: 662
diff changeset
378 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
380 void DigitalO2_SetupCmd(uint8_t O2State, uint8_t *cmdString, uint8_t *cmdLength)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
381 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
382 switch (O2State)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
383 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
384 case UART_O2_CHECK: *cmdLength = snprintf((char*)cmdString, 10, "#LOGO");
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
385 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
386 case UART_O2_REQ_INFO: *cmdLength = snprintf((char*)cmdString, 10, "#VERS");
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
387 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
388 case UART_O2_REQ_ID: *cmdLength = snprintf((char*)cmdString, 10, "#IDNR");
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
389 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
390 case UART_O2_REQ_O2: *cmdLength = snprintf((char*)cmdString, 10, "#DOXY");
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
391 break;
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
392 case UART_O2_REQ_RAW: *cmdLength = snprintf((char*)cmdString, 10, "#DRAW");
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
393 break;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
394 default: *cmdLength = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
395 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
396 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
397 if(*cmdLength != 0)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
398 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
399 cmdString[*cmdLength] = 0x0D;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
400 *cmdLength = *cmdLength + 1;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
401 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
402 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
403
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
404 void StringToInt(char *pstr, uint32_t *puInt32)
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
405 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
406 uint8_t index = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
407 uint32_t result = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
408 while((pstr[index] >= '0') && (pstr[index] <= '9'))
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
409 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
410 result *=10;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
411 result += pstr[index] - '0';
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
412 index++;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
413 }
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
414 *puInt32 = result;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
415 }
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
416
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
417 void StringToUInt64(char *pstr, uint64_t *puint64)
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
418 {
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
419 uint8_t index = 0;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
420 uint64_t result = 0;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
421 while((pstr[index] >= '0') && (pstr[index] <= '9'))
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
422 {
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
423 result *=10;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
424 result += pstr[index] - '0';
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
425 index++;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
426 }
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
427 *puint64 = result;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
428 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
429
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
430 void HandleUARTDigitalO2(void)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
431 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
432 static uint32_t lastO2ReqTick = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
433
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
434 static uartO2RxState_t rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
435 static uint32_t lastReceiveTick = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
436 static uint8_t lastAlive = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
437 static uint8_t curAlive = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
438
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
439 static uint8_t cmdLength = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
440 static uint8_t cmdString[10];
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
441 static uint8_t cmdReadIndex = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
442
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
443 uint32_t tmpO2 = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
444 uint32_t tmpData = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
445 uint8_t localRX = rxReadIndex;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
446 uint32_t tick = HAL_GetTick();
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
447
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
448
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
449 if(Comstatus_O2 == UART_O2_INIT)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
450 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
451 memset((char*)&rxBuffer[rxWriteIndex],(int)0,CHUNK_SIZE);
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
452 memset((char*) &sensorDataDiveO2, 0, sizeof(sensorDataDiveO2));
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
453 externalInterface_SetSensorData(0,(uint8_t*)&sensorDataDiveO2);
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
454
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
455 lastAlive = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
456 curAlive = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
457
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
458 Comstatus_O2 = UART_O2_CHECK;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
459 DigitalO2_SetupCmd(Comstatus_O2,cmdString,&cmdLength);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
460 HAL_UART_Transmit(&huart1,cmdString,cmdLength,10);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
461
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
462 rxState = O2RX_CONFIRM;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
463 cmdReadIndex = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
464 lastO2ReqTick = tick;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
465
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
466 if(HAL_OK == HAL_UART_Receive_DMA (&huart1, &rxBuffer[rxWriteIndex], CHUNK_SIZE))
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
467 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
468 dmaActive = 1;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
469 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
470 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
471 if(time_elapsed_ms(lastO2ReqTick,tick) > 1000) /* repeat request once per second */
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
472 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
473 lastO2ReqTick = tick;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
474 if(Comstatus_O2 == UART_O2_IDLE) /* cyclic request of o2 value */
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
475 {
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
476 Comstatus_O2 = UART_O2_REQ_RAW;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
477 rxState = O2RX_CONFIRM;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
478 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
479 DigitalO2_SetupCmd(Comstatus_O2,cmdString,&cmdLength);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
480
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
481 HAL_UART_Transmit(&huart1,cmdString,cmdLength,10);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
482 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
483
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
484 while((rxBuffer[localRX]!=0))
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
485 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
486
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
487 lastReceiveTick = tick;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
488 switch(rxState)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
489 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
490 case O2RX_CONFIRM: if(rxBuffer[localRX] == '#')
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
491 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
492 cmdReadIndex = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
493 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
494 if(rxBuffer[localRX] == cmdString[cmdReadIndex])
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
495 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
496 cmdReadIndex++;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
497 if(cmdReadIndex == cmdLength - 1)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
498 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
499 tmpRxIdx = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
500 memset((char*) tmpRxBuf, 0, sizeof(tmpRxBuf));
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
501 switch (Comstatus_O2)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
502 {
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
503 case UART_O2_CHECK: Comstatus_O2 = UART_O2_REQ_ID;
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
504 rxState = O2RX_CONFIRM;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
505 DigitalO2_SetupCmd(Comstatus_O2,cmdString,&cmdLength);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
506 HAL_UART_Transmit(&huart1,cmdString,cmdLength,10);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
507 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
508 case UART_O2_REQ_ID: rxState = O2RX_GETNR;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
509 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
510 case UART_O2_REQ_INFO: rxState = O2RX_GETTYPE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
511 break;
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
512 case UART_O2_REQ_RAW:
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
513 case UART_O2_REQ_O2: rxState = O2RX_GETO2;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
514 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
515 default: Comstatus_O2 = UART_O2_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
516 rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
517 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
518 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
519 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
520 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
521 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
522
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
523 case O2RX_GETSTATUS:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
524 case O2RX_GETTEMP:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
525 case O2RX_GETTYPE:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
526 case O2RX_GETVERSION:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
527 case O2RX_GETCHANNEL:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
528 case O2RX_GETSUBSENSORS:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
529 case O2RX_GETO2:
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
530 case O2RX_GETNR:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
531 case O2RX_GETDPHI:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
532 case O2RX_INTENSITY:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
533 case O2RX_AMBIENTLIGHT:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
534 case O2RX_PRESSURE:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
535 case O2RX_HUMIDITY:
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
536 if(rxBuffer[localRX] != 0x0D)
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
537 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
538 if(rxBuffer[localRX] != ' ')
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
539 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
540 tmpRxBuf[tmpRxIdx++] = rxBuffer[localRX];
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
541 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
542 else
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
543 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
544 if(tmpRxIdx != 0)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
545 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
546 switch(rxState)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
547 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
548 case O2RX_GETCHANNEL: StringToInt(tmpRxBuf,&tmpData);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
549 rxState = O2RX_GETVERSION;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
550 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
551 case O2RX_GETVERSION: StringToInt(tmpRxBuf,&tmpData);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
552 rxState = O2RX_GETSUBSENSORS;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
553 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
554 case O2RX_GETTYPE: StringToInt(tmpRxBuf,&tmpData);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
555 rxState = O2RX_GETCHANNEL;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
556 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
557
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
558 case O2RX_GETO2: StringToInt(tmpRxBuf,&tmpO2);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
559 setExternalInterfaceChannel(0,(float)(tmpO2 / 10000.0));
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
560 rxState = O2RX_GETTEMP;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
561 break;
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
562 case O2RX_GETTEMP: StringToInt(tmpRxBuf,(uint32_t*)&sensorDataDiveO2.temperature);
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
563 rxState = O2RX_GETSTATUS;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
564 break;
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
565 case O2RX_GETSTATUS: StringToInt(tmpRxBuf,&sensorDataDiveO2.status); /* raw data cycle */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
566 rxState = O2RX_GETDPHI;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
567 break;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
568 case O2RX_GETDPHI: /* ignored to save memory and most likly irrelevant for diver */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
569 rxState = O2RX_INTENSITY;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
570 break;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
571 case O2RX_INTENSITY: StringToInt(tmpRxBuf,(uint32_t*)&sensorDataDiveO2.intensity); /* raw data cycle */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
572 rxState = O2RX_AMBIENTLIGHT;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
573 break;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
574 case O2RX_AMBIENTLIGHT: StringToInt(tmpRxBuf,(uint32_t*)&sensorDataDiveO2.ambient); /* raw data cycle */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
575 rxState = O2RX_PRESSURE;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
576 break;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
577 case O2RX_PRESSURE: StringToInt(tmpRxBuf,(uint32_t*)&sensorDataDiveO2.pressure); /* raw data cycle */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
578 rxState = O2RX_HUMIDITY;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
579 break;
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
580 default:
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
581 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
582 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
583 memset((char*) tmpRxBuf, 0, tmpRxIdx);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
584 tmpRxIdx = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
585 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
586 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
587 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
588 else
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
589 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
590 switch (rxState)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
591 {
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
592 case O2RX_GETSTATUS: StringToInt(tmpRxBuf,&sensorDataDiveO2.status);
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
593 externalInterface_SetSensorData(1,(uint8_t*)&sensorDataDiveO2);
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
594 Comstatus_O2 = UART_O2_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
595 rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
596 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
597 case O2RX_GETSUBSENSORS: StringToInt(tmpRxBuf,&tmpData);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
598 Comstatus_O2 = UART_O2_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
599 rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
600 break;
721
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
601 case O2RX_HUMIDITY: StringToInt(tmpRxBuf,(uint32_t*)&sensorDataDiveO2.humidity); /* raw data cycle */
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
602 externalInterface_SetSensorData(1,(uint8_t*)&sensorDataDiveO2);
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
603 Comstatus_O2 = UART_O2_IDLE;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
604 rxState = O2RX_IDLE;
fceae45b3a69 DigO2 added raw data request:
Ideenmodellierer
parents: 714
diff changeset
605 break;
714
045ff7800501 Added customizable data area for specific sensor data:
Ideenmodellierer
parents: 704
diff changeset
606 case O2RX_GETNR: StringToUInt64((char*)tmpRxBuf,&sensorDataDiveO2.sensorId);
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
607 /* no break */
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
608 default: Comstatus_O2 = UART_O2_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
609 rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
610 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
611 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
612 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
613 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
614 default: rxState = O2RX_IDLE;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
615 break;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
616
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
617 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
618
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
619 localRX++;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
620 rxReadIndex++;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
621 if(rxReadIndex >= CHUNK_SIZE * CHUNKS_PER_BUFFER)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
622 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
623 localRX = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
624 rxReadIndex = 0;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
625 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
626 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
627
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
628 if(time_elapsed_ms(lastReceiveTick,HAL_GetTick()) > 4000) /* check for communication timeout */
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
629 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
630 if(curAlive == lastAlive)
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
631 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
632 setExternalInterfaceChannel(0,0.0);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
633 setExternalInterfaceChannel(1,0.0);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
634 setExternalInterfaceChannel(2,0.0);
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
635 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
636 lastAlive = curAlive;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
637 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
638
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
639 if((dmaActive == 0) && (externalInterface_isEnabledPower33())) /* Should never happen in normal operation => restart in case of communication error */
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
640 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
641 if(HAL_OK == HAL_UART_Receive_DMA (&huart1, &rxBuffer[rxWriteIndex], CHUNK_SIZE))
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
642 {
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
643 dmaActive = 1;
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
644 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
645 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
646 }
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
647
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
648
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
649 void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 {
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
651 if(huart == &huart1)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
652 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
653 dmaActive = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
654 rxWriteIndex+=CHUNK_SIZE;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
655 if(rxWriteIndex >= CHUNK_SIZE * CHUNKS_PER_BUFFER)
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
656 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
657 rxWriteIndex = 0;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
658 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
659 if((rxWriteIndex / CHUNK_SIZE) != (rxReadIndex / CHUNK_SIZE)) /* start next transfer if we did not catch up with read index */
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
660 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
661 if(externalInterface_isEnabledPower33())
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
662 {
704
f1b40364b0af Added protocol functions for UART DiveO2 sensor:
Ideenmodellierer
parents: 690
diff changeset
663 memset((char*)&rxBuffer[rxWriteIndex],(int)0,CHUNK_SIZE);
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
664 if(HAL_OK == HAL_UART_Receive_DMA (&huart1, &rxBuffer[rxWriteIndex], CHUNK_SIZE))
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
665 {
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
666 dmaActive = 1;
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
667 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
668 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
669 }
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
670 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673
662
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
674
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
675
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
676
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
677
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
678
1b995079c045 PSCR Mode
heinrichs weikamp
parents: 38
diff changeset
679
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/