foxBMS - Unit Tests  1.3.0
The foxBMS Unit Tests API Documentation
database.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file database.c
44  * @author foxBMS Team
45  * @date 2015-08-18 (date of creation)
46  * @updated 2022-05-30 (date of last update)
47  * @version v1.3.0
48  * @ingroup ENGINE
49  * @prefix DATA
50  *
51  * @brief Database module implementation
52  *
53  * @details The database read/write functions put references to the database
54  * entries to be read/written in the database queue. The function
55  * DATA_Task() reads the queue to get the database entries to be
56  * read/written. Up to DATA_MAX_ENTRIES_PER_ACCESS entries can be
57  * read/written with the same function call. To avoid code
58  * duplication, the functions to read/write 1 to
59  * DATA_MAX_ENTRIES_PER_ACCESS-1 entries call the function to
60  * read/write DATA_MAX_ENTRIES_PER_ACCESS entries and use NULL_PTR
61  * for the entries that are not to be read/written. DATA_Task()
62  * checks that the first entry is not a NULL_PTR and asserts if it
63  * is not the case. If subsequent entries are found in the database
64  * queue, they are simply ignored if they are NULL_PTR.
65  */
66 
67 /*========== Includes =======================================================*/
68 #include "database.h"
69 
70 #include "ftask.h"
71 #include "os.h"
72 
73 #include <string.h>
74 
75 /*========== Macros and Definitions =========================================*/
76 /** Maximum queue timeout time in milliseconds */
77 #define DATA_MAX_QUEUE_TIMEOUT_MS (10u)
78 
79 #define DATA_QUEUE_TIMEOUT_MS (DATA_MAX_QUEUE_TIMEOUT_MS / OS_TICK_RATE_MS)
80 
81 f_static_assert(DATA_QUEUE_TIMEOUT_MS > 0u, "invalid database queue timeout!");
82 
83 /** configuration struct of database device */
84 typedef struct {
85  uint8_t nrDatabaseEntries; /*!< number of database entries */
86  DATA_BASE_s *pDatabase; /*!< pointer to the array with the database entries */
88 
89 /*========== Static Constant and Variable Definitions =======================*/
90 
91 /**
92  * @brief device configuration of database
93  * @details all attributes of device configuration are listed here (pointer to
94  * channel list, number of channels)
95  */
97  .nrDatabaseEntries = sizeof(data_database) / sizeof(DATA_BASE_s), /**< number of blocks (and block headers) */
98  .pDatabase = &data_database[0],
99 };
100 
101 /**
102  * @brief uniqueId to respective database entry selector
103  * @details This array is the link between the uniqueId of a database entry and
104  * the actual position of the database entry in data_database[].
105  * The IDs are set to its final value, when Data_Initialize is called.
106  */
108 
109 /*========== Extern Constant and Variable Definitions =======================*/
110 
111 /*========== Static Function Prototypes =====================================*/
112 static void DATA_IterateOverDatabaseEntries(const DATA_QUEUE_MESSAGE_s *kpReceiveMessage);
113 
115  DATA_BLOCK_ACCESS_TYPE_e accessType,
116  void *pData0,
117  void *pData1,
118  void *pData2,
119  void *pData3);
120 
121 static void DATA_CopyData(
122  DATA_BLOCK_ACCESS_TYPE_e accessType,
123  uint32_t dataLength,
124  void *pDatabaseStruct,
125  void *pPassedDataStruct);
126 
127 /*========== Static Function Implementations ================================*/
129  DATA_BLOCK_ACCESS_TYPE_e accessType,
130  void *pData0,
131  void *pData1,
132  void *pData2,
133  void *pData3) {
134  FAS_ASSERT((accessType == DATA_WRITE_ACCESS) || (accessType == DATA_READ_ACCESS));
135  FAS_ASSERT(pData0 != NULL_PTR);
136  /* AXIVION Routine Generic-MissingParameterAssert: pData1: pointer might be NULL_PTR (i.e., if the caller
137  * is DATA_Read1DataBlock/DATA_Write1DataBlock). The DATA_Task function checks the pointer being not NULL_PTR prior
138  * to usage. */
139  /* AXIVION Routine Generic-MissingParameterAssert: pData2: pointer might be NULL_PTR (i.e., if the caller
140  * is DATA_Read1DataBlock/DATA_Write1DataBlock or DATA_Read2DataBlocks/DATA_Write2DataBlocks). The DATA_Task
141  * function checks the pointer being not NULL_PTR prior to usage. */
142  /* AXIVION Routine Generic-MissingParameterAssert: pData3: pointer might be NULL_PTR (i.e., if the caller
143  * is DATA_Read1DataBlock/DATA_Write1DataBlock, DATA_Read2DataBlocks/DATA_Write2DataBlocks or
144  * DATA_Read3DataBlocks/DATA_Write3DataBlocks). The DATA_Task function checks the pointer being not NULL_PTR prior
145  * to usage. */
146  STD_RETURN_TYPE_e retval = STD_NOT_OK;
147  /* prepare send message with attributes of data block */
148  DATA_QUEUE_MESSAGE_s data_sendMessage = {
149  .pDatabaseEntry[DATA_ENTRY_0] = pData0,
150  .pDatabaseEntry[DATA_ENTRY_1] = pData1,
151  .pDatabaseEntry[DATA_ENTRY_2] = pData2,
152  .pDatabaseEntry[DATA_ENTRY_3] = pData3,
153  .accessType = accessType,
154  };
155  /* Send a pointer to a message object and maximum block time: DATA_QUEUE_TIMEOUT_MS */
156  if (OS_SendToBackOfQueue(ftsk_databaseQueue, (void *)&data_sendMessage, DATA_QUEUE_TIMEOUT_MS) == OS_SUCCESS) {
157  retval = STD_OK;
158  }
159  return retval;
160 }
161 
162 static void DATA_CopyData(
163  DATA_BLOCK_ACCESS_TYPE_e accessType,
164  uint32_t dataLength,
165  void *pDatabaseStruct,
166  void *pPassedDataStruct) {
167  FAS_ASSERT((accessType == DATA_WRITE_ACCESS) || (accessType == DATA_READ_ACCESS));
168  /* AXIVION Routine Generic-MissingParameterAssert: dataLength: parameter accepts whole range */
169  /* Copy data either into database or passed database struct */
170  FAS_ASSERT(pDatabaseStruct != NULL_PTR);
171  FAS_ASSERT(pPassedDataStruct != NULL_PTR);
172 
173  if (accessType == DATA_WRITE_ACCESS) {
174  /* Pointer on data block header of passed struct */
175  /* AXIVION Next Line Style MisraC2012-11.5 this casted is required in order to have a generic interface
176  * for all database entries. */
177  DATA_BLOCK_HEADER_s *pHeader = (DATA_BLOCK_HEADER_s *)pPassedDataStruct;
178  /* Update timestamps in passed database struct and then copy this struct into database */
179  pHeader->previousTimestamp = pHeader->timestamp;
180  pHeader->timestamp = OS_GetTickCount();
181  /* Copy passed struct in database struct */
182  /* memcpy has no return value therefore there is nothing to check: casting to void */
183  /* AXIVION Next Line Style MisraC2012-21.18
184  * */
185  (void)memcpy(pDatabaseStruct, pPassedDataStruct, dataLength);
186  } else if (accessType == DATA_READ_ACCESS) {
187  /* Copy database entry in passed struct */
188  /* memcpy has no return value therefore there is nothing to check: casting to void */
189  (void)memcpy(pPassedDataStruct, pDatabaseStruct, dataLength);
190  } else {
191  /* invalid database operation */
193  }
194 }
195 
196 static void DATA_IterateOverDatabaseEntries(const DATA_QUEUE_MESSAGE_s *kpReceiveMessage) {
197  FAS_ASSERT(kpReceiveMessage != NULL_PTR);
198  for (uint8_t queueEntry = 0u; queueEntry < DATA_MAX_ENTRIES_PER_ACCESS; queueEntry++) {
199  /* Iterate over pointer array and handle all access operations if pointer != NULL_PTR
200  * All pointers in the array, expect the first one, might be NULL_PTR, which is valid.
201  * Again, to understand explanation see the comments in DATA_Read1DataBlock, DATA_Read2DataBlocks,
202  * DATA_Read3DataBlocks and DATA_Read4DataBlocks as well as DATA_Write1DataBlock,
203  * DATA_Write2DataBlocks, DATA_Write3DataBlocks and DATA_Write4DataBlocks */
204  if (kpReceiveMessage->pDatabaseEntry[queueEntry] != NULL_PTR) {
205  /* pointer to passed database struct */
206  void *pPassedDataStruct = kpReceiveMessage->pDatabaseEntry[queueEntry];
207  /* Get access type (read or write) of passed data struct */
208  DATA_BLOCK_ACCESS_TYPE_e accessType = kpReceiveMessage->accessType;
209 
210  /* Get pointer to database header entry */
211  const DATA_BLOCK_HEADER_s *kpHeader = (DATA_BLOCK_HEADER_s *)kpReceiveMessage->pDatabaseEntry[queueEntry];
212  uint8_t uniqueId = (uint8_t)(kpHeader->uniqueId);
213  FAS_ASSERT(uniqueId < (uint8_t)DATA_BLOCK_ID_MAX);
214  uint8_t entryIndex = data_uniqueIdToDatabaseEntry[uniqueId];
215  /* Pointer to database struct representation of passed struct */
216  void *pDatabaseStruct = (void *)data_baseHeader.pDatabase[entryIndex].pDatabaseEntry;
217  /* Get dataLength of database entry */
218  uint32_t dataLength = data_baseHeader.pDatabase[entryIndex].dataLength;
219 
220  DATA_CopyData(accessType, dataLength, pDatabaseStruct, pPassedDataStruct);
221  }
222  }
223 }
224 
225 /*========== Extern Function Implementations ================================*/
227  STD_RETURN_TYPE_e retval = STD_OK;
228  /* Check that database queue has been created */
229  const bool allQueuesCreatedCopyForAssert = ftsk_allQueuesCreated;
230  FAS_ASSERT(allQueuesCreatedCopyForAssert == true);
231 
232  f_static_assert((sizeof(data_database) != 0u), "No database defined");
233  /* make sure that no basic assumptions are broken -- since data_database is
234  declared with length DATA_BLOCK_ID_MAX, this assert should never fail */
236  ((sizeof(data_database) / sizeof(DATA_BASE_s)) == (uint8_t)(DATA_BLOCK_ID_MAX)), "Database array length error");
237 
238  /* Iterate over database and set respective read/write pointer for each database entry */
239  for (uint16_t i = 0u; i < data_baseHeader.nrDatabaseEntries; i++) {
240  /* Initialize database entry with 0, set write pointer to start of database entry */
241  uint8_t *pStartDatabaseEntryWR = (uint8_t *)data_baseHeader.pDatabase[i].pDatabaseEntry;
242 
243  /* Start after uniqueId entry. Set j'th byte to zero in database entry */
244  for (uint32_t j = 0u; j < (data_baseHeader.pDatabase + i)->dataLength; j++) {
245  if (j >= sizeof(DATA_BLOCK_ID_e)) {
246  *pStartDatabaseEntryWR = 0;
247  }
248  pStartDatabaseEntryWR++;
249  }
250  }
251 
252  /* Configure link between uniqueId and database entry array position */
253  for (uint8_t databaseEntry = 0u; databaseEntry < data_baseHeader.nrDatabaseEntries; databaseEntry++) {
254  /* Get pointer to database header entry */
256  /* make sure that the database entry is not a null pointer (which would happen if an entry is missing
257  despite the ID existing) */
258  FAS_ASSERT(pHeader != NULL_PTR);
259  /* Get uniqueId */
260  DATA_BLOCK_ID_e blockId = pHeader->uniqueId;
261  if ((blockId < DATA_BLOCK_ID_MAX) && (databaseEntry < DATA_BLOCK_ID_MAX)) {
262  /* e.g., data_uniqueIdToDatabaseEntry[<some id>] = configured database entry index */
263  data_uniqueIdToDatabaseEntry[blockId] = databaseEntry;
264  } else {
265  /* Configuration error -> set retval to #STD_NOT_OK */
266  retval = STD_NOT_OK;
267  }
268  }
269 
270  if (ftsk_databaseQueue == NULL_PTR) {
271  retval = STD_NOT_OK; /* Failed to create the queue */
272  }
273  return retval;
274 }
275 
276 void DATA_Task(void) {
277  if (ftsk_databaseQueue != NULL_PTR) {
278  DATA_QUEUE_MESSAGE_s receiveMessage = {
280  /* scan queue and wait for a message up to a maximum amount of 1ms (block time) */
281  if (OS_ReceiveFromQueue(ftsk_databaseQueue, (&receiveMessage), 1u) == OS_SUCCESS) {
282  /* plausibility check, error whether the first pointer is a NULL_PTR, as this must not happen.
283  * See the comments in DATA_Read1DataBlock, DATA_Read2DataBlocks, DATA_Read3DataBlocks and
284  * DATA_Read4DataBlocks as well as DATA_Write1DataBlock, DATA_Write2DataBlocks,
285  * DATA_Write3DataBlocks and DATA_Write4DataBlocks */
286  FAS_ASSERT(receiveMessage.pDatabaseEntry[0] != NULL_PTR);
287  /* ready to start reading/writing database entries */
288  DATA_IterateOverDatabaseEntries(&receiveMessage);
289  }
290  }
291 }
292 
293 void DATA_DummyFunction(void) {
294 }
295 
296 STD_RETURN_TYPE_e DATA_Read1DataBlock(void *pDataToReceiver0) {
297  FAS_ASSERT(pDataToReceiver0 != NULL_PTR);
299 }
300 
301 STD_RETURN_TYPE_e DATA_Read2DataBlocks(void *pDataToReceiver0, void *pDataToReceiver1) {
302  FAS_ASSERT(pDataToReceiver0 != NULL_PTR);
303  FAS_ASSERT(pDataToReceiver1 != NULL_PTR);
304  return DATA_AccessDatabaseEntries(DATA_READ_ACCESS, pDataToReceiver0, pDataToReceiver1, NULL_PTR, NULL_PTR);
305 }
306 
307 STD_RETURN_TYPE_e DATA_Read3DataBlocks(void *pDataToReceiver0, void *pDataToReceiver1, void *pDataToReceiver2) {
308  FAS_ASSERT(pDataToReceiver0 != NULL_PTR);
309  FAS_ASSERT(pDataToReceiver1 != NULL_PTR);
310  FAS_ASSERT(pDataToReceiver2 != NULL_PTR);
311  return DATA_AccessDatabaseEntries(DATA_READ_ACCESS, pDataToReceiver0, pDataToReceiver1, pDataToReceiver2, NULL_PTR);
312 }
313 
315  void *pDataToReceiver0,
316  void *pDataToReceiver1,
317  void *pDataToReceiver2,
318  void *pDataToReceiver3) {
319  FAS_ASSERT(pDataToReceiver0 != NULL_PTR);
320  FAS_ASSERT(pDataToReceiver1 != NULL_PTR);
321  FAS_ASSERT(pDataToReceiver2 != NULL_PTR);
322  FAS_ASSERT(pDataToReceiver3 != NULL_PTR);
324  DATA_READ_ACCESS, pDataToReceiver0, pDataToReceiver1, pDataToReceiver2, pDataToReceiver3);
325 }
326 
327 STD_RETURN_TYPE_e DATA_Write1DataBlock(void *pDataFromSender0) {
328  FAS_ASSERT(pDataFromSender0 != NULL_PTR);
330 }
331 
332 STD_RETURN_TYPE_e DATA_Write2DataBlocks(void *pDataFromSender0, void *pDataFromSender1) {
333  FAS_ASSERT(pDataFromSender0 != NULL_PTR);
334  FAS_ASSERT(pDataFromSender1 != NULL_PTR);
335  return DATA_AccessDatabaseEntries(DATA_WRITE_ACCESS, pDataFromSender0, pDataFromSender1, NULL_PTR, NULL_PTR);
336 }
337 
338 STD_RETURN_TYPE_e DATA_Write3DataBlocks(void *pDataFromSender0, void *pDataFromSender1, void *pDataFromSender2) {
339  FAS_ASSERT(pDataFromSender0 != NULL_PTR);
340  FAS_ASSERT(pDataFromSender1 != NULL_PTR);
341  FAS_ASSERT(pDataFromSender2 != NULL_PTR);
343  DATA_WRITE_ACCESS, pDataFromSender0, pDataFromSender1, pDataFromSender2, NULL_PTR);
344 }
345 
347  void *pDataFromSender0,
348  void *pDataFromSender1,
349  void *pDataFromSender2,
350  void *pDataFromSender3) {
351  FAS_ASSERT(pDataFromSender0 != NULL_PTR);
352  FAS_ASSERT(pDataFromSender1 != NULL_PTR);
353  FAS_ASSERT(pDataFromSender2 != NULL_PTR);
354  FAS_ASSERT(pDataFromSender3 != NULL_PTR);
356  DATA_WRITE_ACCESS, pDataFromSender0, pDataFromSender1, pDataFromSender2, pDataFromSender3);
357 }
358 
359 extern void DATA_ExecuteDataBist(void) {
360  /* compile database entry */
362  dummyWriteTable.member1 = UINT8_MAX;
364 
365  /* write entry */
366  STD_RETURN_TYPE_e writeReturnValue = DATA_WRITE_DATA(&dummyWriteTable);
367  FAS_ASSERT(writeReturnValue == STD_OK);
368 
370 
371  /* read entry into new variable */
372  STD_RETURN_TYPE_e readReturnValue = DATA_READ_DATA(&dummyReadTable);
373  FAS_ASSERT(readReturnValue == STD_OK);
374 
375  FAS_ASSERT(dummyReadTable.member1 == dummyWriteTable.member1);
376  FAS_ASSERT(dummyReadTable.member2 == dummyWriteTable.member2);
377 }
378 
379 /*========== Externalized Static Function Implementations (Unit Test) =======*/
STD_RETURN_TYPE_e DATA_Write4DataBlocks(void *pDataFromSender0, void *pDataFromSender1, void *pDataFromSender2, void *pDataFromSender3)
Stores four data blocks in database.
Definition: database.c:346
f_static_assert(DATA_QUEUE_TIMEOUT_MS > 0u, "invalid database queue timeout!")
void DATA_Task(void)
trigger of database manager
Definition: database.c:276
STD_RETURN_TYPE_e DATA_Read2DataBlocks(void *pDataToReceiver0, void *pDataToReceiver1)
Reads two data blocks in database by value.
Definition: database.c:301
static STD_RETURN_TYPE_e DATA_AccessDatabaseEntries(DATA_BLOCK_ACCESS_TYPE_e accessType, void *pData0, void *pData1, void *pData2, void *pData3)
Definition: database.c:128
static void DATA_IterateOverDatabaseEntries(const DATA_QUEUE_MESSAGE_s *kpReceiveMessage)
Definition: database.c:196
STD_RETURN_TYPE_e DATA_Read1DataBlock(void *pDataToReceiver0)
Reads one data block in database by value.
Definition: database.c:296
void DATA_DummyFunction(void)
Dummy void function of the database module.
Definition: database.c:293
STD_RETURN_TYPE_e DATA_Write1DataBlock(void *pDataFromSender0)
Stores one data block in database.
Definition: database.c:327
STD_RETURN_TYPE_e DATA_Read3DataBlocks(void *pDataToReceiver0, void *pDataToReceiver1, void *pDataToReceiver2)
Reads three data blocks in database by value.
Definition: database.c:307
STD_RETURN_TYPE_e DATA_Write3DataBlocks(void *pDataFromSender0, void *pDataFromSender1, void *pDataFromSender2)
Stores three data blocks in database.
Definition: database.c:338
void DATA_ExecuteDataBist(void)
Executes a built-in self-test for the database module.
Definition: database.c:359
static const DATA_BASE_HEADER_s data_baseHeader
device configuration of database
Definition: database.c:96
STD_RETURN_TYPE_e DATA_Read4DataBlocks(void *pDataToReceiver0, void *pDataToReceiver1, void *pDataToReceiver2, void *pDataToReceiver3)
Reads four data blocks in database by value.
Definition: database.c:314
static uint8_t data_uniqueIdToDatabaseEntry[DATA_BLOCK_ID_MAX]
uniqueId to respective database entry selector
Definition: database.c:107
STD_RETURN_TYPE_e DATA_Write2DataBlocks(void *pDataFromSender0, void *pDataFromSender1)
Stores two data blocks in database.
Definition: database.c:332
#define DATA_QUEUE_TIMEOUT_MS
Definition: database.c:79
STD_RETURN_TYPE_e DATA_Initialize(void)
Initialization of database manager.
Definition: database.c:226
static void DATA_CopyData(DATA_BLOCK_ACCESS_TYPE_e accessType, uint32_t dataLength, void *pDatabaseStruct, void *pPassedDataStruct)
Definition: database.c:162
Database module header.
DATA_BLOCK_ACCESS_TYPE_e
data block access types (read or write)
Definition: database.h:106
@ DATA_READ_ACCESS
Definition: database.h:108
@ DATA_WRITE_ACCESS
Definition: database.h:107
#define DATA_ENTRY_0
Definition: database.h:74
#define DATA_ENTRY_2
Definition: database.h:76
#define DATA_ENTRY_3
Definition: database.h:77
#define DATA_ENTRY_1
Definition: database.h:75
#define DATA_MAX_ENTRIES_PER_ACCESS
Definition: database.h:72
#define DATA_DUMMY_VALUE_UINT8_T_ALTERNATING_BIT_PATTERN
Definition: database.h:112
#define DATA_READ_DATA(...)
Definition: database.h:83
#define DATA_WRITE_DATA(...)
Definition: database.h:93
DATA_BASE_s data_database[]
channel configuration of database (data blocks)
Definition: database_cfg.c:177
DATA_BLOCK_ID_e
Definition: database_cfg.h:75
@ DATA_BLOCK_ID_DUMMY_FOR_SELF_TEST
Definition: database_cfg.h:108
@ DATA_BLOCK_ID_MAX
Definition: database_cfg.h:109
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
Definition: fassert.h:237
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
Definition: fassert.h:115
STD_RETURN_TYPE_e
Definition: fstd_types.h:81
@ STD_NOT_OK
Definition: fstd_types.h:83
@ STD_OK
Definition: fstd_types.h:82
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:76
Header of task driver implementation.
volatile bool ftsk_allQueuesCreated
QueueHandle_t ftsk_databaseQueue
#define STRIP(x)
Definition: general.h:261
#define REPEAT_U(x, n)
Macro that helps to generate a series of literals (for array initializers).
Definition: general.h:249
Declaration of the OS wrapper interface.
@ OS_SUCCESS
Definition: os.h:78
OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait)
Receive an item from a queue.
Definition: os_freertos.c:157
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait)
Post an item to the back the provided queue.
Definition: os_freertos.c:170
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.
Definition: os_freertos.c:139
uint8_t nrDatabaseEntries
Definition: database.c:85
DATA_BASE_s * pDatabase
Definition: database.c:86
uint32_t dataLength
Definition: database_cfg.h:71
void * pDatabaseEntry
Definition: database_cfg.h:70
uint32_t previousTimestamp
Definition: database_cfg.h:121
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:119
void * pDatabaseEntry[DATA_MAX_ENTRIES_PER_ACCESS]
Definition: database.h:119
DATA_BLOCK_ACCESS_TYPE_e accessType
Definition: database.h:118