Mercurial > public > ostc4
comparison Small_CPU/Src/scheduler.c @ 786:19ab6f3ed52a
Cleanup sensor data interface:
In a very early implementation of the multiplexer the address of the mux was 0 followed by the sensors. As a resul the ID of the channels was shifted by one. To avoid confusion and because the mux address is meanwhile changed to the last address, it makes sense to return to the indexing where only the three visible sensor slots are used as reference (0,1,2).
author | Ideenmodellierer |
---|---|
date | Sun, 04 Jun 2023 21:54:24 +0200 |
parents | e40790a67165 |
children | bb37d4f3e50e |
comparison
equal
deleted
inserted
replaced
785:3c0b16473af4 | 786:19ab6f3ed52a |
---|---|
1733 for(channel = 0; channel < MAX_ADC_CHANNEL; channel++) | 1733 for(channel = 0; channel < MAX_ADC_CHANNEL; channel++) |
1734 { | 1734 { |
1735 value = getExternalInterfaceChannel(channel); | 1735 value = getExternalInterfaceChannel(channel); |
1736 global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].extADC_voltage[channel] = value; | 1736 global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].extADC_voltage[channel] = value; |
1737 } | 1737 } |
1738 global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].externalInterface_SensorID = externalInterface_GetSensorData(0, (uint8_t*)&global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].sensor_data); | 1738 global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].externalInterface_SensorID = externalInterface_GetSensorData(0xFF, (uint8_t*)&global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].sensor_data); |
1739 memcpy(global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].sensor_map,externalInterface_GetSensorMapPointer(1),EXT_INTERFACE_SENSOR_CNT); | 1739 memcpy(global.dataSendToMaster.data[boolADCBuffer && DATA_BUFFER_ADC].sensor_map,externalInterface_GetSensorMapPointer(1),EXT_INTERFACE_SENSOR_CNT); |
1740 global.dataSendToMaster.boolADCO2Data |= boolADCBuffer; | 1740 global.dataSendToMaster.boolADCO2Data |= boolADCBuffer; |
1741 } | 1741 } |
1742 | 1742 |
1743 void copyExtCO2data() | 1743 void copyExtCO2data() |