Index: firmware/App/Controllers/LoadCell.c =================================================================== diff -u -r30bf93016955d5eb5c4053645d5b2065f20be911 -r3839f1c5cad3fe04a969622bb621fc50f2182da9 --- firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 30bf93016955d5eb5c4053645d5b2065f20be911) +++ firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 3839f1c5cad3fe04a969622bb621fc50f2182da9) @@ -675,4 +675,47 @@ return result; } +/*********************************************************************//** + * @brief + * The getLoadCellsTareValues function gets the load cells tare values + * @details Inputs: loadcells[] + * @details Outputs: none + * @param bufferAddress address to the buffer provided to get the load cells + * tare values + * @return none + *************************************************************************/ +void getLoadCellsTareValues( U08* bufferAddress ) +{ + LOAD_CELL_ID_T id; + + for ( id = LOAD_CELL_FIRST; id < NUM_OF_LOAD_CELLS; ++id ) + { + memcpy( bufferAddress, &loadcells[ id ].autoCalOffset, sizeof( F32 ) ); + bufferAddress += sizeof( F32 ); + } +} + +/*********************************************************************//** + * @brief + * The setLoadCellsTareValues function sets the load cells tare values + * @details Inputs: none + * @details Outputs: loadcells[] + * @param bufferAddress address to the buffer provided to set the load cells + * tare values + * @return none + *************************************************************************/ +void setLoadCellsTareValues( U08* bufferAddress ) +{ + LOAD_CELL_ID_T id; + + for ( id = LOAD_CELL_FIRST; id < NUM_OF_LOAD_CELLS; ++id ) + { + memcpy( &loadcells[ id ].autoCalOffset, bufferAddress, sizeof( F32 ) ); + bufferAddress += sizeof( F32 ); + + // Set the load cells have been tared already. + hasLoadCellBeenTared[ id ] = TRUE; + } +} + /**@}*/