Index: firmware/App/Drivers/ConductivityTeensy.c =================================================================== diff -u -r3fde11b3e67db8690667c7d96696b25e5108a395 -r31a1037056fb4d4c4705211302594e015036c86f --- firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 3fde11b3e67db8690667c7d96696b25e5108a395) +++ firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 31a1037056fb4d4c4705211302594e015036c86f) @@ -81,7 +81,6 @@ static U08 queueRearIndex; ///< Queue rear index. static U08 queueFrontIndex; ///< Queue front index. static TEENSY_CMD_INDEX_T currentCmd; -static CONDUCTIVITY_MST_PARAM_IDX_T currentSettingParam = CONDUCTIVITY_MST_PARAM_IDX_SINFREQ; // Conductivity DMA control records static g_dmaCTRL condDMAWriteControlRecord; ///< DMA record for controlling a DMA write command transmission from buffer. @@ -91,7 +90,7 @@ static CONDUCTIVITY_INIT_STATUS_T conductivityInitStatus; static CONDUCTIVITY_UPDATE_EEPROM_STATUS_T condUpdateEEPROMstatus; -static CONDUCTIVITY_UPDATE_MST_STATUS_T condUpdateSettingStatus[MAX_CONDUCTIVITY_MST_PARAM_IDX]; +static CONDUCTIVITY_UPDATE_MST_STATUS_T condUpdateSettingStatus[MAX_COND_MST_PARAM_IDX]; static CONDUCTIVITY_SENSOR_DATA_T rawConductivityValues[ MAX_TEENSY_SENSOR ]; static CONDUCTIVITY_CALCULATED_MEASUREMENTS_T calculatedMeasurement[ MAX_TEENSY_SENSOR ]; static CONDUCTIVITY_COEFFICIENTS_T conductivityCoeff[MAX_TEENSY_SENSOR]; @@ -111,16 +110,6 @@ { TEENSY_CMD_GET_SINGLE_MEASUREMENT , (U08*)"h" , RX_SIZE_GET_SINGLE_MEASUREMENT }, }; -static const U08* condSettingsParam = { - "sinfreq", - "dacpp", - "bias", - "rtia", - "pga", - "dftnum", - "avgnum" - }; - // Conductivity cmd data structs TEENSY_SENSOR_INDEX_T currentSelectedSensor; CONDUCTIVITY_EEPROM_DATA_T eePromDataTX; @@ -918,7 +907,7 @@ { // Read the sensor data temporarily CONDUCTIVITY_SENSOR_DATA_T tempSensor; - memcpy( &tempSensor, ( buffer + ( sensorIdx * expectedDataLength ) ), expectedDataLength ); + memcpy( &tempSensor, buffer, expectedDataLength ); // Check if the received sensor number is valid if ( ( tempSensor.sensorNum < 1 ) || ( tempSensor.sensorNum > MAX_TEENSY_SENSOR ) ) @@ -983,6 +972,9 @@ if ( written > 0 ) { + // Clear the DMA write comand buffer + memcpy( &condWriteCmdBuffer, 0, COND_WRITE_CMD_BUFFER_LEN ); + // Load the DMA write command buffer with contents of TX buffer. memcpy( &condWriteCmdBuffer, &condTxBuffer, written ); success = TRUE; }