diff --git a/lwmem/src/include/system/lwmem_sys.h b/lwmem/src/include/system/lwmem_sys.h index 8e17767..2c229b8 100644 --- a/lwmem/src/include/system/lwmem_sys.h +++ b/lwmem/src/include/system/lwmem_sys.h @@ -47,10 +47,33 @@ extern "C" { * \brief System functions when used with operating system * \{ */ - + +/** + * \brief Create a new mutex and assign value to handle + * \param[out] m: Output variable to save mutex handle + * \return `1` on success, `0` otherwise + */ uint8_t lwmem_sys_mutex_create(LWMEM_CFG_OS_MUTEX_HANDLE* m); + +/** + * \brief Check if mutex handle is valid + * \param[in] m: Mutex handle to check if valid + * \return `1` on success, `0` otherwise + */ uint8_t lwmem_sys_mutex_isvalid(LWMEM_CFG_OS_MUTEX_HANDLE* m); + +/** + * \brief Wait for a mutex until ready (unlimited time) + * \param[in] m: Mutex handle to wait for + * \return `1` on success, `0` otherwise + */ uint8_t lwmem_sys_mutex_wait(LWMEM_CFG_OS_MUTEX_HANDLE* m); + +/** + * \brief Release already locked mutex + * \param[in] m: Mutex handle to release + * \return `1` on success, `0` otherwise + */ uint8_t lwmem_sys_mutex_release(LWMEM_CFG_OS_MUTEX_HANDLE* m); /** diff --git a/lwmem/src/system/lwmem_sys_template.c b/lwmem/src/system/lwmem_sys_template.c deleted file mode 100644 index 317f704..0000000 --- a/lwmem/src/system/lwmem_sys_template.c +++ /dev/null @@ -1,80 +0,0 @@ -/** - * \file lwmem_sys_template.c - * \brief System functions template file - */ - -/* - * Copyright (c) 2020 Tilen MAJERLE - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * This file is part of LwMEM - Lightweight dynamic memory manager library. - * - * Author: Tilen MAJERLE - * Version: v1.5.3 - */ -#include "system/lwmem_sys.h" - -#if LWMEM_CFG_OS || __DOXYGEN__ - -#include "cmsis_os.h" - -/** - * \brief Create a new mutex and assign value to handle - * \param[out] m: Output variable to save mutex handle - * \return `1` on success, `0` otherwise - */ -uint8_t -lwmem_sys_mutex_create(LWMEM_CFG_OS_MUTEX_HANDLE* m) { - return 1; -} - -/** - * \brief Check if mutex handle is valid - * \param[in] m: Mutex handle to check if valid - * \return `1` on success, `0` otherwise - */ -uint8_t -lwmem_sys_mutex_isvalid(LWMEM_CFG_OS_MUTEX_HANDLE* m) { - return 1; -} - -/** - * \brief Wait for a mutex until ready (unlimited time) - * \param[in] m: Mutex handle to wait for - * \return `1` on success, `0` otherwise - */ -uint8_t -lwmem_sys_mutex_wait(LWMEM_CFG_OS_MUTEX_HANDLE* m) { - return 1; -} - -/** - * \brief Release already locked mutex - * \param[in] m: Mutex handle to release - * \return `1` on success, `0` otherwise - */ -uint8_t -lwmem_sys_mutex_release(LWMEM_CFG_OS_MUTEX_HANDLE* m) { - return 1; -} - -#endif /* LWMEM_CFG_OS || __DOXYGEN__ */