Mercurial > public > ostc4
comparison Discovery/Src/data_exchange_main.c @ 780:e40790a67165
Discovery<=>SmallCPU inferface update:
The sensor data struct is extended to store the data of up to three (three visible O2 sensors). To avoid unnecessary payload on the SPI only the last update sensor data item is transfered. The sender receiver uses the sensor ID which is provided in parallel to identify the correct storage location.
author | Ideenmodellierer |
---|---|
date | Tue, 23 May 2023 21:50:19 +0200 |
parents | 45b8f3c2acce |
children | 19ab6f3ed52a |
comparison
equal
deleted
inserted
replaced
779:0b5f45448eb6 | 780:e40790a67165 |
---|---|
992 | 992 |
993 if(pStateReal->data_old__lost_connection_to_slave == 0) | 993 if(pStateReal->data_old__lost_connection_to_slave == 0) |
994 { | 994 { |
995 | 995 |
996 pStateReal->lifeData.extIf_sensor_Id = dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].externalInterface_SensorID; | 996 pStateReal->lifeData.extIf_sensor_Id = dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].externalInterface_SensorID; |
997 if(pStateReal->lifeData.extIf_sensor_Id != 0) | 997 if((pStateReal->lifeData.extIf_sensor_Id != 0) && (pStateReal->lifeData.extIf_sensor_Id <= 3)) |
998 { | 998 { |
999 memcpy(pStateReal->lifeData.extIf_sensor_data, dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_data, 32); | 999 |
1000 memcpy(pStateReal->lifeData.extIf_sensor_data[pStateReal->lifeData.extIf_sensor_Id-1], dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_data, 32); | |
1000 } | 1001 } |
1001 memcpy(pStateReal->lifeData.extIf_sensor_map, dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_map, EXT_INTERFACE_SENSOR_CNT); | 1002 memcpy(pStateReal->lifeData.extIf_sensor_map, dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_map, EXT_INTERFACE_SENSOR_CNT); |
1002 | 1003 |
1003 | 1004 |
1004 meter = getSampleDepth(&dataIn, pStateReal); | 1005 meter = getSampleDepth(&dataIn, pStateReal); |