Index: Utilities.c =================================================================== diff -u -r5ccc22443444a99309fa2a9099da2c61b04a4015 -r1a2123e2152f5290cae14add017ca258770b2ee2 --- Utilities.c (.../Utilities.c) (revision 5ccc22443444a99309fa2a9099da2c61b04a4015) +++ Utilities.c (.../Utilities.c) (revision 1a2123e2152f5290cae14add017ca258770b2ee2) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file Utilities.c +* @file Utilities.c * -* @author (last) Sean Nash -* @date (last) 24-Sep-2020 +* @author (last) Quang Nguyen +* @date (last) 20-May-2021 * -* @author (original) Sean -* @date (original) 17-Feb-2020 +* @author (original) Sean +* @date (original) 17-Feb-2020 * ***************************************************************************/ @@ -537,6 +537,30 @@ /*********************************************************************//** * @brief + * The isCriticalDataSet function checks if the critical data has been set. + * @details Inputs: none + * @details Outputs: None + * @param data Ptr to a critical data record + * @return TRUE if critical data has been set, FALSE if not + *************************************************************************/ +BOOL isCriticalDataSet( CRITICAL_DATA_T *data ) +{ + BOOL result = FALSE; + CRITICAL_DATA_T d; + + _disable_IRQ(); + d = *data; + _enable_IRQ(); + // verify data integrity + if (( d.set != FALSE ) ) + { + result = TRUE; + } + return result; +} + +/*********************************************************************//** + * @brief * The hexStrToDec function convert hex string to decimal value. * @details Inputs: none * @details Outputs: none