RT-thread系统的main函数位于startup.c文件中。

/**
* This function will startup RT-Thread RTOS.
*/
void rtthread_startup(void)
{
/* init board */
rt_hw_board_init();//NVIC_config, SysTick_config, serial_device register, set CONSOLE for output(rt_kprintf(...)) in board.c /* show version */
rt_show_version(); //show the version of rtthread by serial device(set to be console-device in board.c) in kservice.c /* init tick */
rt_system_tick_init(); //empty fucntion(since 1.1.0) in clock.c /* init kernel object */
rt_system_object_init();//empty fucntion(since 0.3.0) in object.c /* init timer system */
rt_system_timer_init(); //init rt_timer_list[0].next=rt_timer_list[0].prev=rt_timer_list[0](means rt_timer_list is empty) in timer.c rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END);//init system heap in mem.c /* init scheduler system */
rt_system_scheduler_init();//init the system scheduler, and init rt_thread_defunct(dead thread list) to be empty in scheduler.c /* init application */
rt_application_init(); //init all defined thread in application.c //#ifdef RT_USING_FINSH //replace finsh_set_device() after the function of rt_components_init() in rt_init_thread_entry() of application.c
/* init finsh */
//finsh_system_init(); //INIT_COMPONENT_EXPORT(finsh_system_init) in shell.c, so it needn't finsh_system_init here
//finsh_set_device( FINSH_DEVICE_NAME );//sets the input device of finsh shell(rt_device_open(dev, RT_DEVICE_OFLAG_RDWR |
RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM) in shell.c
//#endif /* init timer thread */
rt_system_timer_thread_init();//init system software timer thread(opened by #define RT_USING_TIMER_SOFT in rtconfig.h) in timer.c /* init idle thread */
rt_thread_idle_init(); //init idle thread(cleanup all dead thread), then start to be ready in idle.c /* start scheduler */
rt_system_scheduler_start(); //startup scheduler(first swith to the highest priority thread and enable interrupt )in scheduler.c /* never reach here */
return ;
}
int main(void)
{
/* disable interrupt first */
//enable interrupt(CPSIE I) when the first thread switch(rt_hw_context_switch_to) in lipcpu/cortex-m4/context_rvds.S
rt_hw_interrupt_disable(); /* startup RT-Thread RTOS */
rtthread_startup(); return ;
}

RT-thread main函数分析的更多相关文章

  1. Go Revel - main函数分析

    运行revel命令时,首先会编译整个项目,在编译时,会根据`app.conf`配置文件生成两个源码文件`tmp/main.go`.`routes/routes.go`,其中`main.go`是整个项目 ...

  2. Tomcat启动分析(一)-从脚本到main函数分析

    当我们在Linux下启动tomcat的时候,通过ps查看其进程信息为,接下来的内容我们就以此进行分析: [tomcat@fdd ~]$ ps -ef |grep java tomcat : tty1 ...

  3. SequoiaDB 系列之五 :源码分析之main函数

    好久好久没有写博客了,因为一直要做各种事,工作上的,生活上的,这一下就是半年. 时光如梭. 这两天回头看了看写的博客,感觉都是贻笑大方. 但是还是想坚持把SequoiaDB系列写完. 初步的打算已经确 ...

  4. Atitit main函数的ast分析  数组参数调用的ast astview解析

    Atitit main函数的ast分析  数组参数调用的ast astview解析 1.1. Xxcls.main(new String[]{"","bb"}) ...

  5. 性能测试分享: Jmeter的源码分析main函数参数

    性能测试分享: Jmeter的源码分析main函数参数   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大 ...

  6. 外显子分析弹错解决方案:Exception in thread "main" picard.PicardException: New reference sequence does not contain a matching contig for NC_007605

    最近从公共数据库下载了一堆bam文件和reference 基因组文件,重新分析外显子流程时,跑出了“Exception in thread "main" picard.Picard ...

  7. 大数据学习之Scala中main函数的分析以及基本规则(2)

    一.main函数的分析 首先来看我们在上一节最后看到的这个程序,我们先来简单的分析一下.有助于后面的学习 object HelloScala { def main(args: Array[String ...

  8. Keil开发的ARM程序main函数之前的汇编分析

    Keil开发的ARM程序main函数之前的汇编分析 ——BIN文件中RW段的数据移动 系统平台: STM32系列STM32F103ZE,512KB内部FLASH,64KB片内存储; FLASH地址范围 ...

  9. 魔兽世界服务器Trinitycore分析二:auth server的main函数

    TrinityCore由生成两个运行文件authserver和world server以及一堆DLL(或so)文件的子项目组成(先忽略map_extractor等几个工具项目). authserver ...

随机推荐

  1. 6月29-7月5日成都uber优步司机第一/二/三组奖励政策明细

    成都优步司机第一/二/三组奖励更新了,在写下文之前,我先吐槽一下:靠优步uber发财致富已成往事. 滴滴快车单单2.5倍,注册地址:http://www.udache.com/如何注册Uber司机(全 ...

  2. 成都Uber优步司机奖励政策(1月29日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  3. VINS(三)IMU预积分

    IMU的数据频率一般远高于视觉,在视觉两帧k,k+1之间通常会有>10组IMU数据.IMU的数据通过积分,可以获取当前位姿(p位置,q四元数表达的姿态).瞬时速度等参数. 在VIO中,如果参考世 ...

  4. c++ 重载运算与类型转换

    1. 基础概念 重载的运算符是具有特殊名字的函数:(重载运算符函数,运算符函数.重载运算符) 依次包含返回类型,函数名(operator=),参数列表,函数体. 只有重载的函数调用运算符operato ...

  5. SpspringBoot日志logback-spring.xml分环境

    SpspringBoot日志logback-spring.xml分环境 2017年08月02日 03:05:13 cqqianyi1 阅读数:30563 标签: logback slf4j sprin ...

  6. Redis系列一 Redis安装

    Redis系列一    Redis安装 1.安装所使用的操作系统为Ubuntu16.04 Redis版本为3.2.9 软件一般下载存放目录为/opt,以下命令操作目录均为/opt root@ubunt ...

  7. 关于 NPOI 导出的 Excel 出现“部分内容有问题” 的解决方法

    近期发现使用 NPOI 导出的 Excel 文件,有部分用户反映在打开时报错,测试了一下,发现在低版本的 Office 中(2003版,配合2007格式兼容包)打开正常,但在高版本 Office 中, ...

  8. Qt-事件处理-鼠标事件

    根据书中的内容,简单的实现鼠标相关的内容 源代码如下 .h #ifndef MOUSEEVENT_H #define MOUSEEVENT_H #include <QMainWindow> ...

  9. 180615-精度计算BigDecimal

    文章链接:https://liuyueyi.github.io/hexblog/2018/06/15/180615-精度计算BigDecimal/ 180615-精度计算BigDecimal 目前接触 ...

  10. Allure--自动化测试报告生成

    之前尝试使用过testNG自带的测试报告.优化过reportNG的测试报告,对这两个报告都不能满意.后经查找资料,发现有个神器: Allure(已经有allure2了,笔者使用的就是allure2), ...