Index: firmware/App/Controllers/LoadCell.c =================================================================== diff -u -r0774a37971585dacdc8398362393920c13d48426 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 0774a37971585dacdc8398362393920c13d48426) +++ firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -19,189 +19,202 @@ #include "FPGA.h" #include "TaskPriority.h" -DATA_DECL( U32, MeasuredLoadCellA1, loadCellA1raw, 0, 0 ); -DATA_DECL( U32, MeasuredLoadCellA2, loadCellA2raw, 0, 0 ); -DATA_DECL( U32, MeasuredLoadCellB1, loadCellB1raw, 0, 0 ); -DATA_DECL( U32, MeasuredLoadCellB2, loadCellB2raw, 0, 0 ); -static F32 Load_cell_a1_ave; -static F32 Load_cell_a2_ave; -static F32 Load_cell_b1_ave; -static F32 Load_cell_b2_ave; +/** + * @addtogroup LoadCells + * @{ + */ +// ********** private definitions ********** +#define LOAD_CELL_REPORT_PERIOD (100 / TASK_PRIORITY_INTERVAL) ///< Broadcast load cell values message every 100 ms. +#define LOAD_CELL_SAMPLES_TO_AVERAGE LOAD_CELL_REPORT_PERIOD ///< Averaging load cell data over the reporting interval. +//#define ADC2GRAM (0.0894 / LOAD_CELL_SAMPLES_TO_AVERAGE) ///< Conversion factor from ADC counts to grams. Division for averaging is folded into this value. +#define ADC2GRAM (0.01183 / LOAD_CELL_SAMPLES_TO_AVERAGE) ///< Conversion factor from ADC counts to grams. Division for averaging is folded into this value. + +// ********** private data ********** + +static OVERRIDE_U32_T measuredLoadCellReadingsRaw[ NUM_OF_LOAD_CELLS ]; ///< Latest measured raw load cell readings. +static U32 measuredLoadCellReadingsSum[ NUM_OF_LOAD_CELLS ]; ///< Raw load cell sums for averaging. +static F32 filteredLoadCellWeights[ NUM_OF_LOAD_CELLS ]; ///< Latest filtered load cell weights. +static U32 loadCellDataPublicationTimerCounter = 0; ///< used to schedule load cell data publication to CAN bus. + +// ********** private function prototypes ********** + /*********************************************************************//** * @brief - * The execLoadCell function gets load cell data from FPGA and advertises them over CAN. + * The initLoadCell function initializes the LoadCell module. * @details * Inputs : none - * Outputs : Advertising load call data. + * Outputs : LoadCell module initialized. * @return none *************************************************************************/ -void execLoadCell(void) +void initLoadCell( void ) { -#ifdef DEBUG_ENABLED - char debugStr[ 256 ]; -#endif - static U32 Counter = 0; - static U32 Load_cell_a1 = 0; - static U32 Load_cell_a2 = 0; - static U32 Load_cell_b1 = 0; - static U32 Load_cell_b2 = 0; - BOOL result; + U32 i; - loadCellA1raw.data = getFPGALoadCellA1() & 0x7FFFFFFF; // Temporary fix while FPGA code is being fixed - loadCellA2raw.data = getFPGALoadCellA2(); - loadCellB1raw.data = getFPGALoadCellB1(); - loadCellB2raw.data = getFPGALoadCellB2(); + for ( i = 0; i < NUM_OF_LOAD_CELLS; i++ ) + { + measuredLoadCellReadingsRaw[ i ].data = 0; + measuredLoadCellReadingsRaw[ i ].ovData = 0; + measuredLoadCellReadingsRaw[ i ].ovInitData = 0; + measuredLoadCellReadingsRaw[ i ].override = OVERRIDE_RESET; - Load_cell_a1 += getLoadCellA1raw(); - Load_cell_a2 += getLoadCellA2raw(); - Load_cell_b1 += getLoadCellB1raw(); - Load_cell_b2 += getLoadCellB2raw(); + measuredLoadCellReadingsSum[ i ] = 0; - Counter++; - if (Counter == LOAD_CELL_REPORT_PERIOD) - { - Counter = 0; - - Load_cell_a1_ave = (F32)(Load_cell_a1)*ADC2GRAM; // division for averaging folded into ADC2GRAM - Load_cell_a2_ave = (F32)(Load_cell_a2)*ADC2GRAM; - Load_cell_b1_ave = (F32)(Load_cell_b1)*ADC2GRAM; - Load_cell_b2_ave = (F32)(Load_cell_b2)*ADC2GRAM; - result = broadcastLoadCellData( Load_cell_a1_ave, Load_cell_a2_ave, Load_cell_b1_ave, Load_cell_b2_ave ); -#ifdef DEBUG_ENABLED - if (result == FALSE) - sprintf( debugStr, "Adding load cell data to CAN buffer failed" ); -#else - (void)result; -#endif - Load_cell_a1 = 0; - Load_cell_a2 = 0; - Load_cell_b1 = 0; - Load_cell_b2 = 0; - } + filteredLoadCellWeights[ i ] = 0.0; + } } -F32 getLoadCellA1Ave(void) +/*********************************************************************//** + * @brief + * The execLoadCell function gets load cell data from FPGA and advertises them over CAN. + * @details + * Inputs : none + * Outputs : Advertising load call data. + * @return none + *************************************************************************/ +void execLoadCell(void) { - return Load_cell_a1_ave; + // get latest raw load cell readings + measuredLoadCellReadingsRaw[ LOAD_CELL_A1 ].data = getFPGALoadCellA1() & 0x7FFFFFFF; // Temporary neg sign removal fix while FPGA code is being fixed + measuredLoadCellReadingsRaw[ LOAD_CELL_A2 ].data = getFPGALoadCellA2() & 0x7FFFFFFF; + measuredLoadCellReadingsRaw[ LOAD_CELL_B1 ].data = getFPGALoadCellB1() & 0x7FFFFFFF; + measuredLoadCellReadingsRaw[ LOAD_CELL_B2 ].data = getFPGALoadCellB2() & 0x7FFFFFFF; + // update sums for load cell average calculations + measuredLoadCellReadingsSum[ LOAD_CELL_A1 ] += getMeasuredRawLoadCellReading( LOAD_CELL_A1 ); + measuredLoadCellReadingsSum[ LOAD_CELL_A2 ] += getMeasuredRawLoadCellReading( LOAD_CELL_A2 ); + measuredLoadCellReadingsSum[ LOAD_CELL_B1 ] += getMeasuredRawLoadCellReading( LOAD_CELL_B1 ); + measuredLoadCellReadingsSum[ LOAD_CELL_B2 ] += getMeasuredRawLoadCellReading( LOAD_CELL_B2 ); + // broadcast load cell data if we are at scheduled interval. + if ( ++loadCellDataPublicationTimerCounter == LOAD_CELL_REPORT_PERIOD ) + { + loadCellDataPublicationTimerCounter = 0; + // calculate load cell average weights + filteredLoadCellWeights[ LOAD_CELL_A1 ] = (F32)(measuredLoadCellReadingsSum[ LOAD_CELL_A1 ]) * ADC2GRAM; // division for averaging folded into ADC2GRAM + filteredLoadCellWeights[ LOAD_CELL_A2 ] = (F32)(measuredLoadCellReadingsSum[ LOAD_CELL_A2 ]) * ADC2GRAM; + filteredLoadCellWeights[ LOAD_CELL_B1 ] = (F32)(measuredLoadCellReadingsSum[ LOAD_CELL_B1 ]) * ADC2GRAM; + filteredLoadCellWeights[ LOAD_CELL_B2 ] = (F32)(measuredLoadCellReadingsSum[ LOAD_CELL_B2 ]) * ADC2GRAM; + // broadcast load cell data + broadcastLoadCellData( filteredLoadCellWeights[ LOAD_CELL_A1 ], filteredLoadCellWeights[ LOAD_CELL_A2 ], + filteredLoadCellWeights[ LOAD_CELL_B1 ], filteredLoadCellWeights[ LOAD_CELL_B2 ] ); + // reset sums for next averaging + measuredLoadCellReadingsSum[ LOAD_CELL_A1 ] = 0; + measuredLoadCellReadingsSum[ LOAD_CELL_A2 ] = 0; + measuredLoadCellReadingsSum[ LOAD_CELL_B1 ] = 0; + measuredLoadCellReadingsSum[ LOAD_CELL_B2 ] = 0; + } } -F32 getLoadCellA2Ave(void) +/************************************************************************* + * @brief + * The getMeasuredRawLoadCellReading function gets the measured raw load cell \n + * reading for a given load cell ID. + * @details + * Inputs : measuredLoadCellReadingsRaw + * Outputs : none + * @param loadCellID : ID of load cell to get raw reading for. + * @return the measured raw load cell reading for the given load cell ID. + *************************************************************************/ +U32 getMeasuredRawLoadCellReading( U32 loadCellID ) { - return Load_cell_a2_ave; -} + U32 result = 0; -F32 getLoadCellB1Ave(void) -{ - return Load_cell_b1_ave; -} + if ( loadCellID < NUM_OF_LOAD_CELLS ) + { + if ( OVERRIDE_KEY == measuredLoadCellReadingsRaw[ loadCellID ].override ) + { + result = measuredLoadCellReadingsRaw[ loadCellID ].ovData; + } + else + { + result = measuredLoadCellReadingsRaw[ loadCellID ].data; + } + } + else + { + activateAlarmNoData( ALARM_ID_SOFTWARE_FAULT ); + } -F32 getLoadCellB2Ave(void) -{ - return Load_cell_b2_ave; + return result; } /************************************************************************* - * @brief testSetLoadCellA1Override and testResetLoadCellA1Override - * The testSetLoadCellA1Override function overrides the measured \n - * load cell A1. \n - * The testResetLoadCellA1Override function resets the override of the \n - * load cell A1. \n + * @brief + * The getLoadCellFilteredWeight function gets the measured filtered load cell \n + * weight for a given load cell ID. * @details - * Inputs : none - * Outputs : loadCellA1raw - * @param value : override measured load cell A1 raw - * @return TRUE if override successful, FALSE if not + * Inputs : Load_cell_a1_ave[] + * Outputs : none + * @param loadCellID : ID of load cell to get filtered weight for. + * @return the measured filtered load cell weight for the given load cell ID. *************************************************************************/ -DATA_OVERRIDE_FUNC( U32, testSetLoadCellA1Override, testResetLoadCellA1Override, loadCellA1raw ) +F32 getLoadCellFilteredWeight( LOAD_CELL_ID_T loadCellID ) +{ + F32 result = 0; -/************************************************************************* - * @brief testSetLoadCellA2Override and testResetLoadCellA2Override - * The testSetLoadCellA2Override function overrides the measured \n - * load cell A2. \n - * The testResetLoadCellA1Override function resets the override of the \n - * load cell A2. \n - * @details - * Inputs : none - * Outputs : loadCellA2raw - * @param value : override measured load cell A2 raw - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -DATA_OVERRIDE_FUNC( U32, testSetLoadCellA2Override, testResetLoadCellA2Override, loadCellA2raw ) + if ( loadCellID < NUM_OF_LOAD_CELLS ) + { + result = filteredLoadCellWeights[ loadCellID ]; + } + else + { + activateAlarmNoData( ALARM_ID_SOFTWARE_FAULT ); + } + return result; +} + + /************************************************************************* - * @brief testSetLoadCellB1Override and testResetLoadCellB1Override - * The testSetLoadCellB1Override function overrides the measured \n - * load cell B1. \n - * The testResetLoadCellB1Override function resets the override of the \n - * load cell B1. \n - * @details - * Inputs : none - * Outputs : loadCellB1raw - * @param value : override measured load cell B1 raw - * @return TRUE if override successful, FALSE if not + * TEST SUPPORT FUNCTIONS *************************************************************************/ -DATA_OVERRIDE_FUNC( U32, testSetLoadCellB1Override, testResetLoadCellB1Override, loadCellB1raw ) + /************************************************************************* - * @brief testSetLoadCellB2Override and testResetLoadCellB2Override - * The testSetLoadCellB2Override function overrides the measured \n - * load cell B2. \n - * The testResetLoadCellB2Override function resets the override of the \n - * load cell B2. \n + * @brief + * The testSetLoadCellOverride function overrides the measured \n + * load cell A1. * @details * Inputs : none - * Outputs : loadCellB2raw - * @param value : override measured load cell B2 raw + * Outputs : measuredLoadCellReadingsRaw[] + * @param value : override measured raw load cell reading + * @param loadCellID : ID of the load cell to override. * @return TRUE if override successful, FALSE if not *************************************************************************/ -DATA_OVERRIDE_FUNC( U32, testSetLoadCellB2Override, testResetLoadCellB2Override, loadCellB2raw ) +BOOL testSetLoadCellOverride( U32 value, U32 loadCellID ) +{ + BOOL result = FALSE; -/************************************************************************* - * @brief getLoadCellA1raw - * The getLoadCellA1raw function gets the measured load cell A1 \n - * current. - * @details - * Inputs : loadCellA1raw - * Outputs : none - * @param none - * @return the load cell A1 raw value. - *************************************************************************/ -DATA_GET( U32, getLoadCellA1raw, loadCellA1raw ) + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + measuredLoadCellReadingsRaw[ loadCellID ].ovData = value; + measuredLoadCellReadingsRaw[ loadCellID ].override = OVERRIDE_KEY; + } -/************************************************************************* - * @brief getLoadCellA2raw - * The getLoadCellA2raw function gets the measured load cell A2 \n - * current. - * @details - * Inputs : loadCellA2raw - * Outputs : none - * @param none - * @return the load cell A2 raw value. - *************************************************************************/ -DATA_GET( U32, getLoadCellA2raw, loadCellA2raw ) + return result; +} /************************************************************************* - * @brief getLoadCellB1raw - * The getLoadCellB1raw function gets the measured load cell B1 \n - * current. + * @brief + * The testResetLoadCellOverride function resets the override of the \n + * load cell A1. * @details - * Inputs : loadCellB1raw - * Outputs : none - * @param none - * @return the load cell B1 raw value. + * Inputs : none + * Outputs : measuredLoadCellReadingsRaw[] + * @param loadCellID : ID of the load cell to override. + * @return TRUE if reset successful, FALSE if not *************************************************************************/ -DATA_GET( U32, getLoadCellB1raw, loadCellB1raw ) +BOOL testResetLoadCellOverride( U32 loadCellID ) +{ + BOOL result = FALSE; -/************************************************************************* - * @brief getLoadCellB2raw - * The getLoadCellB2raw function gets the measured load cell B2 \n - * current. - * @details - * Inputs : loadCellB2raw - * Outputs : none - * @param none - * @return the load cell B2 raw value. - *************************************************************************/ -DATA_GET( U32, getLoadCellB2raw, loadCellB2raw ) + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + measuredLoadCellReadingsRaw[ loadCellID ].override = OVERRIDE_RESET; + measuredLoadCellReadingsRaw[ loadCellID ].ovData = measuredLoadCellReadingsRaw[ loadCellID ].ovInitData; + } + + return result; +} Index: firmware/App/Controllers/LoadCell.h =================================================================== diff -u -r0774a37971585dacdc8398362393920c13d48426 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Controllers/LoadCell.h (.../LoadCell.h) (revision 0774a37971585dacdc8398362393920c13d48426) +++ firmware/App/Controllers/LoadCell.h (.../LoadCell.h) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -14,35 +14,43 @@ * **************************************************************************/ -#ifndef APP_CONTROLLERS_LOADCELL_H_ -#define APP_CONTROLLERS_LOADCELL_H_ +#ifndef __LOADCELL_H__ +#define __LOADCELL_H__ #include "DGCommon.h" -void execLoadCell(void); +/** + * @defgroup LoadCells LoadCells + * @brief LoadCells monitor module. + * Monitors and filters load cell sensor readings. + * + * @addtogroup LoadCells + * @{ + */ -#define LOAD_CELL_REPORT_PERIOD (100 / TASK_PRIORITY_INTERVAL) // Send a load cell value CAN message to HD every 100 ms -#define LOAD_CELL_SAMPLES_TO_AVERAGE LOAD_CELL_REPORT_PERIOD // Averaging load cell data over the reporting interval -//#define ADC2GRAM (0.0894 / LOAD_CELL_SAMPLES_TO_AVERAGE) // division for averaging is folded into this value -#define ADC2GRAM (0.01183 / LOAD_CELL_SAMPLES_TO_AVERAGE) // division for averaging is folded into this value +// ********** public definitions ********** -F32 getLoadCellA1Ave(void); -F32 getLoadCellA2Ave(void); -F32 getLoadCellB1Ave(void); -F32 getLoadCellB2Ave(void); +/// Enumeration of load cells. +typedef enum LoadCells +{ + LOAD_CELL_A1 = 0, ///< Load cell A1. + LOAD_CELL_A2, ///< Load cell A2. + LOAD_CELL_B1, ///< Load cell B1. + LOAD_CELL_B2, ///< Load cell B2. + NUM_OF_LOAD_CELLS ///< Number of reservoirs. +} LOAD_CELL_ID_T; -BOOL testSetLoadCellA1Override( U32 ); -BOOL testResetLoadCellA1Override( void ); -BOOL testSetLoadCellA2Override( U32 ); -BOOL testResetLoadCellA2Override( void ); -BOOL testSetLoadCellB1Override( U32 ); -BOOL testResetLoadCellB1Override( void ); -BOOL testSetLoadCellB2Override( U32 ); -BOOL testResetLoadCellB2Override( void ); +// ********** public function prototypes ********** -DATA_GET_PROTOTYPE( U32, getLoadCellA1raw ); -DATA_GET_PROTOTYPE( U32, getLoadCellA2raw ); -DATA_GET_PROTOTYPE( U32, getLoadCellB1raw ); -DATA_GET_PROTOTYPE( U32, getLoadCellB2raw ); +void initLoadCell( void ); // Initialize the LoadCell module. +void execLoadCell( void ); // Execute the LoadCell monitor. +DATA_ARRAY_GET_PROTOTYPE( U32, getMeasuredRawLoadCellReading, loadCellID ); +F32 getLoadCellFilteredWeight( LOAD_CELL_ID_T loadCellID ); + +BOOL testSetLoadCellOverride( U32 value, U32 loadCellID ); +BOOL testResetLoadCellOverride( U32 loadCellID ); + +/**@}*/ + #endif /* APP_CONTROLLERS_LOADCELL_H_ */ Fisheye: Tag 8b56b0c617ac49536b8d53852b9621be873bade6 refers to a dead (removed) revision in file `firmware/App/Controllers/SensorProcess.c'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b56b0c617ac49536b8d53852b9621be873bade6 refers to a dead (removed) revision in file `firmware/App/Controllers/SensorProcess.h'. Fisheye: No comparison available. Pass `N' to diff? Index: firmware/App/Drivers/InternalADC.c =================================================================== diff -u -rf068446fdb7889d320ddb6ffbd58f347ce0501e7 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision f068446fdb7889d320ddb6ffbd58f347ce0501e7) +++ firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * @@ -66,7 +66,7 @@ -/************************************************************************* +/*********************************************************************//** * @brief initInternalADC * The initInternalADC function initializes the InternalADC module. * @details @@ -98,7 +98,7 @@ adcEnableNotification( adcREG1, adcGROUP1 ); } -/************************************************************************* +/*********************************************************************//** * @brief adcNotification * The adcNotification function handles an ADC conversion complete interrupt. \n * All channel readings in the FIFO are retrieved. @@ -117,7 +117,7 @@ } } -/************************************************************************* +/*********************************************************************//** * @brief execInternalADC * The execInternalADC function processes the last set of raw ADC channel \n * readings and kicks off the next conversion of ADC channels. @@ -155,7 +155,7 @@ adcStartConversion( adcREG1, adcGROUP1 ); } -/************************************************************************* +/*********************************************************************//** * @brief getIntADCReading * The getIntADCReading function gets the latest average reading for a given \n * channel. Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -rb64c49fdcf2b6d95e61e63f8e258c4e600935bbd -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision b64c49fdcf2b6d95e61e63f8e258c4e600935bbd) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * @@ -23,7 +23,11 @@ #define INT_ADC_BITS_PER_CHANNEL 12 #define INT_ADC_FULL_SCALE_BITS 4096 -#define INT_ADC_REF_V 3.3 +#ifndef BREADBOARD_TARGET + #define INT_ADC_REF_V 3.0 +#else + #define INT_ADC_REF_V 3.3 +#endif typedef enum Int_ADC_Channels { Index: firmware/App/Services/Reservoirs.h =================================================================== diff -u -rf6413fefb94be1273323d4193bba3c522cf8ecb4 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision f6413fefb94be1273323d4193bba3c522cf8ecb4) +++ firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -30,7 +30,7 @@ // ********** public definitions ********** -/// Enumeration of reservoirs TODO - move to a Reservoirs.h in Services? +/// Enumeration of reservoirs. typedef enum Reservoirs { RESERVOIR_1 = 0, ///< Reservoir #1. Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rf43eb1e9e0803776ec7420b16e1db8760b020bd9 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision f43eb1e9e0803776ec7420b16e1db8760b020bd9) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -1010,22 +1010,10 @@ handleSetRTCTimestamp( message ); break; - case MSG_ID_LOAD_CELL_A1_OVERRIDE: - handleTestLoadCellA1OverrideRequest( message ); + case MSG_ID_LOAD_CELL_OVERRIDE: + handleTestLoadCellOverrideRequest( message ); break; - case MSG_ID_LOAD_CELL_A2_OVERRIDE: - handleTestLoadCellA2OverrideRequest( message ); - break; - - case MSG_ID_LOAD_CELL_B1_OVERRIDE: - handleTestLoadCellB1OverrideRequest( message ); - break; - - case MSG_ID_LOAD_CELL_B2_OVERRIDE: - handleTestLoadCellB2OverrideRequest( message ); - break; - default: // TODO - unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision f267c42c91fd6e22db80e19039b8993582de51e9) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -502,54 +502,18 @@ DATA_ARRAY_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestAlarmStateOverrideRequest, testSetAlarmStateOverride, testResetAlarmStateOverride ) /************************************************************************* - * @brief handleTestLoadCellA1OverrideRequest - * The handleTestLoadCellA1OverrideRequest function handles a request to \n - * override the value read from load cell A1 adc. + * @brief + * The handleTestLoadCellOverrideRequest function handles a request to \n + * override the value read from the given load cell. * @details * Inputs : none * Outputs : message handled * @param message : a pointer to the message to handle * @return none *************************************************************************/ -DATA_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestLoadCellA1OverrideRequest, testSetLoadCellA1Override, testResetLoadCellA1Override ) +DATA_ARRAY_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestLoadCellOverrideRequest, testSetLoadCellOverride, testResetLoadCellOverride ) /************************************************************************* - * @brief handleTestLoadCellA2OverrideRequest - * The handleTestLoadCellA2OverrideRequest function handles a request to \n - * override the value read from load cell A1 adc. - * @details - * Inputs : none - * Outputs : message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -DATA_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestLoadCellA2OverrideRequest, testSetLoadCellA2Override, testResetLoadCellA2Override ) - -/************************************************************************* - * @brief handleTestLoadCellB1OverrideRequest - * The handleTestLoadCellB1OverrideRequest function handles a request to \n - * override the value read from load cell A1 adc. - * @details - * Inputs : none - * Outputs : message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -DATA_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestLoadCellB1OverrideRequest, testSetLoadCellB1Override, testResetLoadCellB1Override ) - -/************************************************************************* - * @brief handleTestLoadCellB2OverrideRequest - * The handleTestLoadCellB2OverrideRequest function handles a request to \n - * override the value read from load cell A1 adc. - * @details - * Inputs : none - * Outputs : message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -DATA_OVERRIDE_HANDLER_FUNC_U32( BOOL, handleTestLoadCellB2OverrideRequest, testSetLoadCellB2Override, testResetLoadCellB2Override ) - -/************************************************************************* * @brief handleSetRTCTimestamp * The handleSetRTCTimestamp function handles a request to write time and * date to RTC Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rf267c42c91fd6e22db80e19039b8993582de51e9 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision f267c42c91fd6e22db80e19039b8993582de51e9) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -58,18 +58,9 @@ // MSG_ID_ALARM_STATE_OVERRIDE void handleTestAlarmStateOverrideRequest( MESSAGE_T *message ); -// MSG_ID_LOAD_CELL_A1_OVERRIDE -void handleTestLoadCellA1OverrideRequest( MESSAGE_T *message ); +// MSG_ID_LOAD_CELL_OVERRIDE +void handleTestLoadCellOverrideRequest( MESSAGE_T *message ); -// MSG_ID_LOAD_CELL_A2_OVERRIDE -void handleTestLoadCellA2OverrideRequest( MESSAGE_T *message ); - -// MSG_ID_LOAD_CELL_B1_OVERRIDE -void handleTestLoadCellB1OverrideRequest( MESSAGE_T *message ); - -// MSG_ID_LOAD_CELL_B2_OVERRIDE -void handleTestLoadCellB2OverrideRequest( MESSAGE_T *message ); - // MSG_ID_SET_RTC_TIMESTAMP void handleSetRTCTimestamp( MESSAGE_T *message ); Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -r4d1572f8226f06febef4a536cdd0946d0dd0fb02 -r8b56b0c617ac49536b8d53852b9621be873bade6 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 4d1572f8226f06febef4a536cdd0946d0dd0fb02) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 8b56b0c617ac49536b8d53852b9621be873bade6) @@ -17,7 +17,8 @@ #include "gio.h" #include "FPGA.h" -#include "SensorProcess.h" +#include "InternalADC.h" +#include "LoadCell.h" #include "WatchdogMgmt.h" #include "TaskPriority.h" @@ -34,9 +35,12 @@ // 1st pass for FPGA execFPGAIn(); - // Processing sensors data - execSensorProcess(); + // monitor internal ADC channels + execInternalADC(); + // load cells monitor + execLoadCell(); + // 2nd pass for FPGA execFPGAOut();