Updated GDB ini file to load binding symbols directly from SDK
[apps/agl-service-unicens.git] / ucs2-lib / src / ucs_misc.c
1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491                                                                            */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG.                              */
4 /*                                                                                                */
5 /* This program is free software: you can redistribute it and/or modify                           */
6 /* it under the terms of the GNU General Public License as published by                           */
7 /* the Free Software Foundation, either version 2 of the License, or                              */
8 /* (at your option) any later version.                                                            */
9 /*                                                                                                */
10 /* This program is distributed in the hope that it will be useful,                                */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of                                 */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                  */
13 /* GNU General Public License for more details.                                                   */
14 /*                                                                                                */
15 /* You should have received a copy of the GNU General Public License                              */
16 /* along with this program.  If not, see <http://www.gnu.org/licenses/>.                          */
17 /*                                                                                                */
18 /* You may also obtain this software under a propriety license from Microchip.                    */
19 /* Please contact Microchip for further information.                                              */
20 /*------------------------------------------------------------------------------------------------*/
21
22 /*!
23  * \file
24  * \brief Implementation of the library module which contains miscellaneous helper functions.
25  *
26  * \cond UCS_INTERNAL_DOC
27  * \addtogroup G_MISC
28  * @{
29  */
30
31 /*------------------------------------------------------------------------------------------------*/
32 /* Includes                                                                                       */
33 /*------------------------------------------------------------------------------------------------*/
34 #include "ucs_misc.h"
35
36 /*------------------------------------------------------------------------------------------------*/
37 /* Implementation                                                                                 */
38 /*------------------------------------------------------------------------------------------------*/
39 /*! \brief UNICENS internal memset-function.
40  *  \param dst_ptr Pointer to the block of memory to fill
41  *  \param value   Value to be set
42  *  \param size    Number of bytes to be set to the value
43  */
44 void Misc_MemSet(void *dst_ptr, int32_t value, uint32_t size)
45 {
46     uint8_t *dst_ptr_ = (uint8_t *)dst_ptr;
47     uint32_t i;
48
49     for(i=0U; i<size; i++)
50     {
51         dst_ptr_[i] = (uint8_t)value;   /* parasoft-suppress  MISRA2004-17_4 "void pointer required for memset-function signature (stdlib)" */
52     }
53 }
54
55 /*! \brief UNICENS internal memcpy-function.
56  *  \param dst_ptr Pointer to the destination array where the content is to be copied
57  *  \param src_ptr Pointer to the source of data to be copied
58  *  \param size    Number of bytes to copy
59  */
60 void Misc_MemCpy(void *dst_ptr, void *src_ptr, uint32_t size)
61 {
62     uint8_t *dst_ptr_ = (uint8_t *)dst_ptr;
63     uint8_t *src_ptr_ = (uint8_t *)src_ptr;
64     uint32_t i;
65
66     for(i=0U; i<size; i++)
67     {
68         dst_ptr_[i] = src_ptr_[i];  /* parasoft-suppress  MISRA2004-17_4 "void pointers required for memcpy-function signature (stdlib)" */
69     }
70 }
71
72 /*!
73  * @}
74  * \endcond
75  */
76
77 /*------------------------------------------------------------------------------------------------*/
78 /* End of file                                                                                    */
79 /*------------------------------------------------------------------------------------------------*/
80