diff options
author | lundinc <lundinc@1d2547de-c912-0410-9cb9-b8ca96c0e9e2> | 2020-03-24 21:54:22 +0000 |
---|---|---|
committer | lundinc <lundinc@1d2547de-c912-0410-9cb9-b8ca96c0e9e2> | 2020-03-24 21:54:22 +0000 |
commit | f5221dff43de249079c2da081723cb7a456f981f (patch) | |
tree | 54c1428d3909aa7e3b2cf7bd2c8b67975886a60a /FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c | |
parent | bcf16bcbc0e3cb060d0c4fc2fc3bda5a38f3d745 (diff) | |
download | freertos-f5221dff43de249079c2da081723cb7a456f981f.tar.gz |
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
Author: David Vrabel <david.vrabel@cambridgeconsultants.com>
Date: Mon Mar 16 11:21:46 2020 +0000
Demo/Posix_GCC: add demo application for Posix port using GCC
This is largely a copy of the Windows demo application with a few key
changes:
- heap_3 (use malloc()/free()) so tools like valgrind "just work".
- printf() wrapped in a mutex to prevent deadlocks on the internal
pthread mutexes inside printf().
SCons (https://scons.org/) is used as the build system.
This will be built as a 64-bit application, but note that the memory
allocation trace points only record the lower 32-bits of the address.
commit f78f919b3e2f0d707531a301a8ca07cd02bc4778
Author: Markus Rinne <markus.ka.rinne@gmail.com>
Date: Thu Mar 19 21:00:24 2020 +0200
Fix function comments
commit 1cd2d38d960a3576addb224582c88489bade5141
Author: David Chalco <david@chalco.io>
Date: Fri Mar 20 10:29:05 2020 -0700
unix separators for path and remove .exe suffix from risc compiler (works on windows/mac)
commit 938b19419eded12817737ab0644e94ed2ba7e95d
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Thu Mar 19 18:23:09 2020 -0700
Removing ./FreeRTOS-Labs directory, since:
- IoT libraries are now in LTS branch.
- FAT/POSIX/Light-weight MQTT are in https://github.com/FreeRTOS/FreeRTOS-Labs.
commit 1a4abbc9e91b13fd6394464ade59d5e048320c7c
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Mar 17 19:30:02 2020 -0700
Maintenance -- clean up readme.txt and add url to GitHub. (#38)
* Removing readme.txt, as now we have README.md in place.
The only information missing from README.md is about FAQ.
* Adding FAQ information in README.md.
* Adding a .url to root to redict user to FreeRTOS github home page.
commit 47bb466aa19395b7785bcb830e2e4dd35f6bafc5
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Mar 17 13:07:44 2020 -0700
Update issue templates
Template maintenance.
- adding title prefix.
- adding examples to "additional context" section.
commit f506290041f56867765f8efa70ed2862125bdb7c
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Mar 17 10:15:07 2020 -0700
Create SECURITY.md
Apply the recommended SECURITY.md from AWS to our repo.
commit 8982a2f80a80a2a0a47cf82de07b52101bd9d606
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Fri Mar 13 12:50:10 2020 -0700
Add ./lib directory to make sure Zynq project compiles.
commit ecf0f12aa14ad6fdafe1ef37257cbb4e03e2abd5
Author: AniruddhaKanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Date: Wed Mar 11 10:19:48 2020 -0700
Sync up with Amazon-freertos repo (10th March 2020) (#34)
* Sync up with amazon-freertos
* Sync up with amazon-freertos
* Sync up with amazon-freertos
commit 0acffef047973e2e61c2201fd69cd9bbd317f674
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Mar 10 10:20:48 2020 -0700
GitHub PR template. (#29)
commit c40a6da2e4cb8042b56d1b174051cbbe9813781a
Author: AniruddhaKanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Date: Mon Mar 9 11:18:48 2020 -0700
pass payload length when calling UDP callback (#30)
* pass payload length when calling UDP callback
commit 12d580e93d4d9074b9a867632f0681a511b4ad12
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Fri Mar 6 18:16:51 2020 -0800
Update issue templates
Initial issue template. Created following https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser.
If change is needed, we could go another round.
commit 9debffb5e0e42ff716f58b2270b3af09652294af
Author: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Fri Mar 6 17:27:46 2020 -0800
Update README.md to remove dead link.
See the conversation https://github.com/FreeRTOS/FreeRTOS/commit/42c627b2b88cb3b487fea983d8b566a8bbae54fa#comments .
Linkage for both ```./FreeRTOS/Source``` and ```./FreeRTOS/Demo``` are removed, since it looks weird to only provide linkage to Demo.
commit 7e1a4bf563240501fc45167aee9d929c533939dd
Author: AniruddhaKanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Date: Fri Mar 6 15:18:09 2020 -0800
Fix DHCP option Client-identifier (#28)
commit 42c627b2b88cb3b487fea983d8b566a8bbae54fa
Author: Yuhui.Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Fri Mar 6 09:15:11 2020 -0800
Update readme and revert relative URL. (#27)
* Reordering: bumping cloning instruction up.
* Rewording readme.md to be clear kernel code is a submodule of this repository.
* Reverting relative URL, since user cannot click through on GitHub page.
(With URL, user could still download the correct version of the code. Reverting simply due to UI issue.)
commit 5751ae9b60e248ebd0b4dd7c58df54364d2bb9d5
Author: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Date: Fri Mar 6 09:11:42 2020 -0800
Update CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso project (#26)
This commit updates the project for LPC55S69 so that it works with the
latest version of MCUXpresso and SDK.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
commit a9ffffe1f01f45f79e127c15727784984077932f
Author: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Date: Thu Mar 5 17:16:13 2020 -0800
Using Relative URL For Submoduling. (#24)
commit 52c82076b38fe73d1dc46c97abf74ae9b803696c
Author: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Date: Thu Mar 5 09:16:31 2020 -0800
use relative path to point to bundled toolchain instead (#25)
commit b877e4ec478de2c24d07ab46241070d7c66f375c
Author: lundinc2 <53273776+lundinc2@users.noreply.github.com>
Date: Tue Feb 25 13:18:38 2020 -0800
Moved vulnerability reporting and code of conduct to top of CONTRIBUTING.md (#20)
commit bef165d46799fb8faa58aaa224f80c16b6538e69
Author: Yuhui.Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Feb 18 22:06:38 2020 -0800
Linking test source file from relative path. (#19)
commit 89e7bbe292afd3912d1f0b2402cc506878bad869
Author: Yuhui.Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Tue Feb 18 17:47:55 2020 -0800
A preliminary .gitignore file, to prevent us checking in files unnecessary. (#18)
https://github.com/github/gitignore.
commit c2a98127acb48c4562233230e66ca5c282688579
Author: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
Date: Sun Feb 16 13:19:53 2020 -0800
Minor wording changes in the 'previous releases' section of the readme.me file. (#17)
commit 24c772d1439e5c291c0a29fce0a46996ca8afaa9
Author: Yuhui.Zheng <10982575+yuhui-zheng@users.noreply.github.com>
Date: Fri Feb 14 12:47:01 2020 -0800
Submodule kernel directory. (#16)
* Removing FreeRTOS/Source in readiness for submoduling.
* Submoduling kernel.
* README.md update due to submoduling.
When releasing, please follow these steps:
1. in local directory, clean directory and check "git status" shows "nothing to commit, working tree clean" for ALL subdirectories.
2. copy source code and instructions only to an empty folder. Git related should not be in this folder -- this covers .git, .gitignore, .github, .gitmodules, gitmessages, ......
3. zip the folder from step 2. (create both .zip and .7z)
4. attach .zip and .7z to the release. (e.g. attach these two in new release -- https://github.com/FreeRTOS/FreeRTOS/releases/new)
5. PLEASE download both, unzip, diff with your local git repo. (should not see any difference other than git related.) And, sanity check a couple of projects.
commit c3f8b91652392dc55e0d7067b90a40de5f5f0837
Author: Rashed Talukder <9218468+rashedtalukder@users.noreply.github.com>
Date: Thu Feb 13 17:47:14 2020 -0800
Update readme. Fixed typos and cli commands (#14)
commit 4723b825f2989213c1cdb2ebf4d6793e0292e363
Author: Julian Poidevin <julian-poidevin@users.noreply.github.com>
Date: Fri Feb 14 02:43:36 2020 +0100
Fixed wrong git clone SSH command (#13)
Replaced bad https URL with proper SSH URL
commit fc819b821715c42602819e58499846147a6394f5
Author: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
Date: Thu Feb 13 17:42:22 2020 -0800
Correct the xTimerCreate() documentation which said NULL was returned if the timer period was passed into the function as 0, whereas that is not the case. (#15)
Add a note to the documentation for both the xTimerCreate() and xTimerCreateStatic() functions that the timer period must be greater than 0.
commit 1c711ab530b5f0dbd811d7d62e0a3763706ffff4
Author: Rashed Talukder <9218468+rashedtalukder@users.noreply.github.com>
Date: Wed Feb 12 23:00:18 2020 -0800
Updated contributions guidelines (#12)
commit 84fcc0d5317d96c6b086034093c8c1c83e050819
Author: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
Date: Wed Feb 12 15:05:06 2020 -0800
Updates to Markdown files and readme.txt (#11)
commit 4b53196b71e02708ef1010a639d90236fbbd4032
Author: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
Date: Tue Feb 11 18:23:08 2020 -0800
Adding Contributions.md (#8)
git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2825 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c')
-rw-r--r-- | FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c | 403 |
1 files changed, 218 insertions, 185 deletions
diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c index f6cdcce38..8224c8ef8 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/lists/generic_list.c @@ -1,5 +1,5 @@ /*
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
* All rights reserved.
*
*
@@ -14,81 +14,102 @@ #include "fsl_common.h"
#include "generic_list.h"
+static list_status_t LIST_Scan(list_handle_t list, list_element_handle_t newElement)
+{
+ list_element_handle_t element = list->head;
+
+ while (element != NULL)
+ {
+ if (element == newElement)
+ {
+ return kLIST_DuplicateError;
+ }
+ element = element->next;
+ }
+ return kLIST_Ok;
+}
+
/*! *********************************************************************************
*************************************************************************************
* Public functions
*************************************************************************************
********************************************************************************** */
/*! *********************************************************************************
-* \brief Initialises the list descriptor.
-*
-* \param[in] list - LIST_ handle to init.
-* max - Maximum number of elements in list. 0 for unlimited.
-*
-* \return void.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Initialises the list descriptor.
+ *
+ * \param[in] list - LIST_ handle to init.
+ * max - Maximum number of elements in list. 0 for unlimited.
+ *
+ * \return void.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
void LIST_Init(list_handle_t list, uint32_t max)
{
list->head = NULL;
list->tail = NULL;
- list->max = max;
+ list->max = (uint16_t)max;
list->size = 0;
}
/*! *********************************************************************************
-* \brief Gets the list that contains the given element.
-*
-* \param[in] element - Handle of the element.
-*
-* \return NULL if element is orphan.
-* Handle of the list the element is inserted into.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets the list that contains the given element.
+ *
+ * \param[in] element - Handle of the element.
+ *
+ * \return NULL if element is orphan.
+ * Handle of the list the element is inserted into.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_handle_t LIST_GetList(list_element_handle_t element)
{
return element->list;
}
/*! *********************************************************************************
-* \brief Links element to the tail of the list.
-*
-* \param[in] list - ID of list to insert into.
-* element - element to add
-*
-* \return kLIST_Full if list is full.
-* kLIST_Ok if insertion was successful.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Links element to the tail of the list.
+ *
+ * \param[in] list - ID of list to insert into.
+ * element - element to add
+ *
+ * \return kLIST_Full if list is full.
+ * kLIST_Ok if insertion was successful.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_status_t LIST_AddTail(list_handle_t list, list_element_handle_t element)
{
uint32_t regPrimask = DisableGlobalIRQ();
- if ((list->max != 0) && (list->max == list->size))
+ if ((list->max != 0U) && (list->max == list->size))
{
EnableGlobalIRQ(regPrimask);
return kLIST_Full;
}
- if (list->size == 0)
+ if (kLIST_DuplicateError == LIST_Scan(list, element))
+ {
+ EnableGlobalIRQ(regPrimask);
+ return kLIST_DuplicateError;
+ }
+
+ if (list->size == 0U)
{
list->head = element;
}
@@ -99,7 +120,7 @@ list_status_t LIST_AddTail(list_handle_t list, list_element_handle_t element) element->prev = list->tail;
element->next = NULL;
element->list = list;
- list->tail = element;
+ list->tail = element;
list->size++;
EnableGlobalIRQ(regPrimask);
@@ -107,32 +128,38 @@ list_status_t LIST_AddTail(list_handle_t list, list_element_handle_t element) }
/*! *********************************************************************************
-* \brief Links element to the head of the list.
-*
-* \param[in] list - ID of list to insert into.
-* element - element to add
-*
-* \return kLIST_Full if list is full.
-* kLIST_Ok if insertion was successful.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Links element to the head of the list.
+ *
+ * \param[in] list - ID of list to insert into.
+ * element - element to add
+ *
+ * \return kLIST_Full if list is full.
+ * kLIST_Ok if insertion was successful.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_status_t LIST_AddHead(list_handle_t list, list_element_handle_t element)
{
uint32_t regPrimask = DisableGlobalIRQ();
- if ((list->max != 0) && (list->max == list->size))
+ if ((list->max != 0U) && (list->max == list->size))
{
EnableGlobalIRQ(regPrimask);
return kLIST_Full;
}
- if (list->size == 0)
+ if (kLIST_DuplicateError == LIST_Scan(list, element))
+ {
+ EnableGlobalIRQ(regPrimask);
+ return kLIST_DuplicateError;
+ }
+
+ if (list->size == 0U)
{
list->tail = element;
}
@@ -143,7 +170,7 @@ list_status_t LIST_AddHead(list_handle_t list, list_element_handle_t element) element->next = list->head;
element->prev = NULL;
element->list = list;
- list->head = element;
+ list->head = element;
list->size++;
EnableGlobalIRQ(regPrimask);
@@ -151,27 +178,27 @@ list_status_t LIST_AddHead(list_handle_t list, list_element_handle_t element) }
/*! *********************************************************************************
-* \brief Unlinks element from the head of the list.
-*
-* \param[in] list - ID of list to remove from.
-*
-* \return NULL if list is empty.
-* ID of removed element(pointer) if removal was successful.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Unlinks element from the head of the list.
+ *
+ * \param[in] list - ID of list to remove from.
+ *
+ * \return NULL if list is empty.
+ * ID of removed element(pointer) if removal was successful.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_element_handle_t LIST_RemoveHead(list_handle_t list)
{
list_element_handle_t element;
uint32_t regPrimask = DisableGlobalIRQ();
- if ((NULL == list) || (list->size == 0))
+ if ((NULL == list) || (list->size == 0U))
{
EnableGlobalIRQ(regPrimask);
return NULL; /*LIST_ is empty*/
@@ -179,7 +206,7 @@ list_element_handle_t LIST_RemoveHead(list_handle_t list) element = list->head;
list->size--;
- if (list->size == 0)
+ if (list->size == 0U)
{
list->tail = NULL;
}
@@ -187,7 +214,7 @@ list_element_handle_t LIST_RemoveHead(list_handle_t list) {
element->next->prev = NULL;
}
- list->head = element->next; /*Is NULL if element is head*/
+ list->head = element->next; /*Is NULL if element is head*/
element->list = NULL;
EnableGlobalIRQ(regPrimask);
@@ -195,80 +222,80 @@ list_element_handle_t LIST_RemoveHead(list_handle_t list) }
/*! *********************************************************************************
-* \brief Gets head element ID.
-*
-* \param[in] list - ID of list.
-*
-* \return NULL if list is empty.
-* ID of head element if list is not empty.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets head element ID.
+ *
+ * \param[in] list - ID of list.
+ *
+ * \return NULL if list is empty.
+ * ID of head element if list is not empty.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_element_handle_t LIST_GetHead(list_handle_t list)
{
return list->head;
}
/*! *********************************************************************************
-* \brief Gets next element ID.
-*
-* \param[in] element - ID of the element.
-*
-* \return NULL if element is tail.
-* ID of next element if exists.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets next element ID.
+ *
+ * \param[in] element - ID of the element.
+ *
+ * \return NULL if element is tail.
+ * ID of next element if exists.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_element_handle_t LIST_GetNext(list_element_handle_t element)
{
return element->next;
}
/*! *********************************************************************************
-* \brief Gets previous element ID.
-*
-* \param[in] element - ID of the element.
-*
-* \return NULL if element is head.
-* ID of previous element if exists.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets previous element ID.
+ *
+ * \param[in] element - ID of the element.
+ *
+ * \return NULL if element is head.
+ * ID of previous element if exists.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_element_handle_t LIST_GetPrev(list_element_handle_t element)
{
return element->prev;
}
/*! *********************************************************************************
-* \brief Unlinks an element from its list.
-*
-* \param[in] element - ID of the element to remove.
-*
-* \return kLIST_OrphanElement if element is not part of any list.
-* kLIST_Ok if removal was successful.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Unlinks an element from its list.
+ *
+ * \param[in] element - ID of the element to remove.
+ *
+ * \return kLIST_OrphanElement if element is not part of any list.
+ * kLIST_Ok if removal was successful.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_status_t LIST_RemoveElement(list_element_handle_t element)
{
if (element->list == NULL)
@@ -302,23 +329,23 @@ list_status_t LIST_RemoveElement(list_element_handle_t element) }
/*! *********************************************************************************
-* \brief Links an element in the previous position relative to a given member
-* of a list.
-*
-* \param[in] element - ID of a member of a list.
-* newElement - new element to insert before the given member.
-*
-* \return kLIST_OrphanElement if element is not part of any list.
-* kLIST_Full if list is full.
-* kLIST_Ok if insertion was successful.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Links an element in the previous position relative to a given member
+ * of a list.
+ *
+ * \param[in] element - ID of a member of a list.
+ * newElement - new element to insert before the given member.
+ *
+ * \return kLIST_OrphanElement if element is not part of any list.
+ * kLIST_Full if list is full.
+ * kLIST_Ok if insertion was successful.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
list_status_t LIST_AddPrevElement(list_element_handle_t element, list_element_handle_t newElement)
{
if (element->list == NULL)
@@ -327,12 +354,18 @@ list_status_t LIST_AddPrevElement(list_element_handle_t element, list_element_ha }
uint32_t regPrimask = DisableGlobalIRQ();
- if ((element->list->max != 0) && (element->list->max == element->list->size))
+ if ((element->list->max != 0U) && (element->list->max == element->list->size))
{
EnableGlobalIRQ(regPrimask);
return kLIST_Full;
}
+ if (kLIST_DuplicateError == LIST_Scan(element->list, newElement))
+ {
+ EnableGlobalIRQ(regPrimask);
+ return kLIST_DuplicateError;
+ }
+
if (element->prev == NULL) /*Element is list head*/
{
element->list->head = newElement;
@@ -345,46 +378,46 @@ list_status_t LIST_AddPrevElement(list_element_handle_t element, list_element_ha element->list->size++;
newElement->next = element;
newElement->prev = element->prev;
- element->prev = newElement;
+ element->prev = newElement;
EnableGlobalIRQ(regPrimask);
return kLIST_Ok;
}
/*! *********************************************************************************
-* \brief Gets the current size of a list.
-*
-* \param[in] list - ID of the list.
-*
-* \return Current size of the list.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets the current size of a list.
+ *
+ * \param[in] list - ID of the list.
+ *
+ * \return Current size of the list.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
uint32_t LIST_GetSize(list_handle_t list)
{
return list->size;
}
/*! *********************************************************************************
-* \brief Gets the number of free places in the list.
-*
-* \param[in] list - ID of the list.
-*
-* \return Available size of the list.
-*
-* \pre
-*
-* \post
-*
-* \remarks
-*
-********************************************************************************** */
+ * \brief Gets the number of free places in the list.
+ *
+ * \param[in] list - ID of the list.
+ *
+ * \return Available size of the list.
+ *
+ * \pre
+ *
+ * \post
+ *
+ * \remarks
+ *
+ ********************************************************************************** */
uint32_t LIST_GetAvailableSize(list_handle_t list)
{
- return (list->max - list->size);
+ return ((uint32_t)list->max - (uint32_t)list->size);
}
|