From c1da4fe8444a9a343232c5098a713d75f6a33c5e Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 13 Aug 2021 10:42:17 +0800 Subject: [PATCH] Device: update device template files Signed-off-by: Huaqi Fang <578567190@qq.com> --- Device/Nuclei/NUCLEI_N/Source/system_NUCLEI_N.c | 5 ++++- Device/Nuclei/NUCLEI_NX/Source/system_NUCLEI_NX.c | 5 ++++- Device/_Template_Vendor/Vendor/Device/Source/system_Device.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Device/Nuclei/NUCLEI_N/Source/system_NUCLEI_N.c b/Device/Nuclei/NUCLEI_N/Source/system_NUCLEI_N.c index 01be7ee7c..47ae17cf3 100644 --- a/Device/Nuclei/NUCLEI_N/Source/system_NUCLEI_N.c +++ b/Device/Nuclei/NUCLEI_N/Source/system_NUCLEI_N.c @@ -44,7 +44,7 @@ * - A device-specific system configuration function, \ref SystemInit. * - A global variable that contains the system frequency, \ref SystemCoreClock. * - A global eclic configuration initialization, \ref ECLIC_Init. - * - Global c library \ref _init and \ref _fini functions called right before calling main function. + * - Global \ref _premain_init and \ref _postmain_fini functions called right before calling main function. * - Vendor customized interrupt, exception and nmi handling code, see \ref NMSIS_Core_IntExcNMI_Handling * * The file configures the device and, typically, initializes the oscillator (PLL) that is part @@ -58,6 +58,9 @@ * used throughout the whole system initialization and runtime to calculate frequency/time related values. * Thus one must assure that the variable always reflects the actual system clock speed. * + * \note \ref _init function and \ref _fini function are now deprecated, but still need to provide a empty implementation + * here, due to newlibc still need it. Please put your pre- and post- main steps in \ref _premain_init and \ref _postmain_fini + * * \attention * Be aware that a value stored to \c SystemCoreClock during low level initialization (i.e. \c SystemInit()) might get * overwritten by C libray startup code and/or .bss section initialization. diff --git a/Device/Nuclei/NUCLEI_NX/Source/system_NUCLEI_NX.c b/Device/Nuclei/NUCLEI_NX/Source/system_NUCLEI_NX.c index e49dfdab2..cb7e3702b 100644 --- a/Device/Nuclei/NUCLEI_NX/Source/system_NUCLEI_NX.c +++ b/Device/Nuclei/NUCLEI_NX/Source/system_NUCLEI_NX.c @@ -44,7 +44,7 @@ * - A device-specific system configuration function, \ref SystemInit. * - A global variable that contains the system frequency, \ref SystemCoreClock. * - A global eclic configuration initialization, \ref ECLIC_Init. - * - Global c library \ref _init and \ref _fini functions called right before calling main function. + * - Global \ref _premain_init and \ref _postmain_fini functions called right before calling main function. * - Vendor customized interrupt, exception and nmi handling code, see \ref NMSIS_Core_IntExcNMI_Handling * * The file configures the device and, typically, initializes the oscillator (PLL) that is part @@ -58,6 +58,9 @@ * used throughout the whole system initialization and runtime to calculate frequency/time related values. * Thus one must assure that the variable always reflects the actual system clock speed. * + * \note \ref _init function and \ref _fini function are now deprecated, but still need to provide a empty implementation + * here, due to newlibc still need it. Please put your pre- and post- main steps in \ref _premain_init and \ref _postmain_fini + * * \attention * Be aware that a value stored to \c SystemCoreClock during low level initialization (i.e. \c SystemInit()) might get * overwritten by C libray startup code and/or .bss section initialization. diff --git a/Device/_Template_Vendor/Vendor/Device/Source/system_Device.c b/Device/_Template_Vendor/Vendor/Device/Source/system_Device.c index cd29ed50a..e4442b969 100644 --- a/Device/_Template_Vendor/Vendor/Device/Source/system_Device.c +++ b/Device/_Template_Vendor/Vendor/Device/Source/system_Device.c @@ -46,7 +46,7 @@ * - A device-specific system configuration function, \ref SystemInit. * - A global variable that contains the system frequency, \ref SystemCoreClock. * - A global eclic configuration initialization, \ref ECLIC_Init. - * - Global c library \ref _init and \ref _fini functions called right before calling main function. + * - Global \ref _premain_init and \ref _postmain_fini functions called right before calling main function. * - Vendor customized interrupt, exception and nmi handling code, see \ref NMSIS_Core_IntExcNMI_Handling * * The file configures the device and, typically, initializes the oscillator (PLL) that is part @@ -60,6 +60,9 @@ * used throughout the whole system initialization and runtime to calculate frequency/time related values. * Thus one must assure that the variable always reflects the actual system clock speed. * + * \note \ref _init function and \ref _fini function are now deprecated, but still need to provide a empty implementation + * here, due to newlibc still need it. Please put your pre- and post- main steps in \ref _premain_init and \ref _postmain_fini + * * \attention * Be aware that a value stored to \c SystemCoreClock during low level initialization (i.e. \c SystemInit()) might get * overwritten by C libray startup code and/or .bss section initialization.