• 大小: 1.15MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-13
  • 语言: 其他
  • 标签: 小灯  液晶  

资源简介

小灯, 液晶,例程,在IAR环境下的例程

资源截图

代码片段和文件信息

//-------------------------------------------------------------------------*
// 文件名:start.c                                                          
// 说  明: CPU启动后进行系统配置                                           
//-------------------------------------------------------------------------*

//头文件
#include “common.h“
#include “wdog.h“
#include “sysinit.h“

//内部函数声明
//-------------------------------------------------------------------------*
//函数名: common_startup                                                   
//功  能: 复制中断向量表到RAM中                                             
//参  数: 无    
//说  明: 将ROM中的初始化数据拷贝到RAM中                                   
//-------------------------------------------------------------------------*
void common_startup(void);

//-------------------------------------------------------------------------*
//函数名: start                                                            
//功  能: 系统启动                                                         
//参  数: 无    
//说  明: 无                                                               
//-------------------------------------------------------------------------*
void start(void)
{
//关闭看门狗
wdog_disable();
//复制中断向量表到RAM中
common_startup();
//系统设置
sysinit();
//进入主函数
main();
}

//-------------------------------------------------------------------------*
//函数名: common_startup                                                   
//功  能: 复制中断向量表到RAM中                                             
//参  数: 无    
//说  明: 将ROM中的初始化数据拷贝到RAM中                                   
//-------------------------------------------------------------------------*
void common_startup(void)
{

    extern char __START_BSS[];
    extern char __END_BSS[];
    extern uint32 __DATA_ROM[];
    extern uint32 __DATA_RAM[];
    extern char __DATA_END[];
    extern uint32 __VECTOR_TABLE[];
    extern uint32 __VECTOR_RAM[];
    
    uint32 n;
    uint8 * data_ram * data_rom * data_rom_end;
    uint8 * bss_start * bss_end;

    //拷贝中断向量表
    if (__VECTOR_RAM != __VECTOR_TABLE)
    {
        for (n = 0; n < 0x410; n++)
            __VECTOR_RAM[n] = __VECTOR_TABLE[n];
    }
    /* Point the VTOR to the new copy of the vector table */
    write_vtor((uint32)__VECTOR_RAM);

    //得到.data section段的地址
data_ram = (uint8 *)__DATA_RAM;
data_rom = (uint8 *)__DATA_ROM;
data_rom_end  = (uint8 *)__DATA_END; /* This is actually a RAM address in CodeWarrior */
n = data_rom_end - data_ram;

//从ROM拷贝数据到RAM
while (n--)
*data_ram++ = *data_rom++;

//得到.bss section段的数据
bss_start = (uint8 *)__START_BSS;
bss_end = (uint8 *)__END_BSS;
    //将.bss section段的数据初始化为0
    n = bss_end - bss_start;
    while(n--)
      *bss_start++ = 0;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      50828  2011-11-28 10:26  Ch05-PRG(KB-LCD-LED)\K60-B\KB\.cproject

     文件        417  2011-04-12 15:54  Ch05-PRG(KB-LCD-LED)\K60-B\KB\.cwGeneratedFileSetLog

     文件       2143  2011-11-28 10:26  Ch05-PRG(KB-LCD-LED)\K60-B\KB\.project

     文件        120  2011-04-12 15:54  Ch05-PRG(KB-LCD-LED)\K60-B\KB\.settings\com.freescale.core.ide.newprojectwizard.prefs

     文件        137  2011-11-28 10:25  Ch05-PRG(KB-LCD-LED)\K60-B\KB\.settings\org.eclipse.ltk.core.refactoring.prefs

     文件      31972  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\KB.afx

     文件      10124  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\KB.afx.hex

     文件       9452  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\KB.afx.S19

     文件       5665  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\KB.afx.xMAP

     文件        749  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\KB.args

     文件       2384  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\makefile

     文件        690  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\makefile.local

     文件        258  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\objects.mk

     文件        651  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\linker_Files\subdir.mk

     文件         58  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\crt0.args

     文件       1920  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\crt0.obj

     文件        686  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\start.args

     文件       1383  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\start.d

     文件       6128  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\start.obj

     文件       1833  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Project_Settings\Startup_Code\subdir.mk

     文件        957  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\KB\kb.args

     文件       1459  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\KB\kb.d

     文件      11752  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\KB\kb.obj

     文件       1189  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\KB\subdir.mk

     文件        957  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\Light\light.args

     文件       1397  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\Light\light.d

     文件       4928  2011-12-22 10:01  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\Light\light.obj

     文件       1255  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\GPIOapplication\Light\subdir.mk

     文件        957  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\hwComponent\GPIO\hw_gpio.args

     文件       1308  2011-12-22 10:00  Ch05-PRG(KB-LCD-LED)\K60-B\KB\MK60N512VMD100_INTERNAL_FLASH\Sources\hwComponent\GPIO\hw_gpio.d

............此处省略820个文件信息

评论

共有 条评论