Why in the Ucos to stm32f103 Transplant said OS_CPU_C.C three functions such as os_cpu_systickinit () need to comment out

Source: Internet
Author: User

I am looking at the OS_CPU_C.C code when the following paragraph puzzled over a long time always in Baidu's help to find the answer

/* Declare a few functions, here to note that the last three functions need to be commented out, why?
Os_cpu_systickhandler () is defined in OS_CPU_C.C, which is the interrupt handler for the Systick interrupt.
and STM32F10X_IT.C, which already has the definition of the interrupt function Systick_handler (), here Also
No, it's strange that the official transplant version will do so, and I'll explain later.
Os_cpu_systickinit () is defined in OS_CPU_C.C and is used to initialize the Systick timer, which
Depends on Os_cpu_systickclkfreq (), and this function we will implement, so comment out.
Os_cpu_systickclkfreq () is defined in Bsp.c (micrium\software\evalboards),
The BSP.C is not used in this transplant, we will implement it ourselves, so we can comment it out.

*/

Functions such as os_cpu_systickinit () are not used because they are upgraded after stm32f their firmware library

A more convenient function systick_config (uint32_t ticks) is provided in the CMSs core_cm3.h file.

Used to set Systick.

Add the following function to replace Os_cpu_systickinit () and its related functions in BSP.C

void Systick_init (void)
{
/* systemfrequency/1000 1ms interrupts the maximum value
* systemfrequency/100 10ms Interrupt Once
* SYSTEMFREQUENCY/10 100ms Interrupt once minimum value
*/
st3.0 with Systemfrequency and st3.5 with Systemcoreclock
Systick_config (SYSTEMCORECLOCK/OS_TICKS_PER_SEC);


}

Why in the Ucos to stm32f103 Transplant said OS_CPU_C.C three functions such as os_cpu_systickinit () need to comment out

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.