中断控制器移植
//=====================================================================
//TITLE:
// 中断控制器移植
//AUTHOR:
// norains
//DATE:
// Friday 29-October-2010
//Environment:
// KEIL MDK 4.0
// .NET Micro Framework Porting 4.1
// RedCow Board
//=====================================================================
1. 复制文件
将$(SPOCLIENT)/DeviceCode/drivers/stubs/processor下的stubs_INTC文件夹拷贝到$(SPOCLIENT)/ Solutions/STM32F103ZE_RedCow/DeviceCode,并且更名为INTC_HAL。
2. INTC_Hal/dotNetMF.proj
打开INTC_Hal/dotNetMF.proj文件,并做如下更改:
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>CPU_HAL_STM32F103ZE_RedCow</AssemblyName>
<ProjectGuid>{e9b7181a-070d-4902-bc4c-9b7a81ef9a02}</ProjectGuid>
<Size>
</Size>
<Description>Interrupt controller stub library</Description>
<Level>HAL</Level>
<LibraryFile>CPU_HAL_STM32F103ZE_RedCow.$(LIB_EXT)</LibraryFile>
<ProjectPath>$(SPOCLIENT)/Solutions/STM32F103ZE_RedCow/DeviceCode/INTC_HAL/dotNetMF.proj</ProjectPath>
<ManifestFile>CPU_HAL_STM32F103ZE_RedCow.$(LIB_EXT).manifest</ManifestFile>
<Groups>Processor/stubs</Groups>
<LibraryCategory>
<MFComponent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="InterruptController_HAL" Guid="{08148BEE-6B1F-4050-AA21-510CA7F2FF98}" ProjectPath="" Conditional="" xmlns="">
<VersionDependency xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">
<Major>4</Major>
<Minor>0</Minor>
<Revision>0</Revision>
<Build>0</Build>
<Extra />
<Date>2009-04-30</Date>
</VersionDependency>
<ComponentType xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">LibraryCategory</ComponentType>
</MFComponent>
</LibraryCategory>
<Documentation>
</Documentation>
<PlatformIndependent>False</PlatformIndependent>
<CustomFilter>
</CustomFilter>
<Required>False</Required>
<IgnoreDefaultLibPath>False</IgnoreDefaultLibPath>
<IsStub>True</IsStub>
<Directory>Solutions/STM32F103ZE_RedCow/DeviceCode/INTC_HAL</Directory>
<OutputType>Library</OutputType>
<PlatformIndependentBuild>false</PlatformIndependentBuild>
<Version>4.0.0.0</Version>
</PropertyGroup>
<Import Project="$(SPOCLIENT)/tools/targets/Microsoft.SPOT.System.Settings" />
<PropertyGroup />
<ItemGroup>
<Compile Include="stubs_functions_INTC.cpp" />
<Compile Include="INTC_Adapter.cpp" />
</ItemGroup>
<ItemGroup>
<IncludePaths Include="Solutions/STM32F103ZE_RedCow/DeviceCode/Libraries/Configure" />
<IncludePaths Include="Solutions/STM32F103ZE_RedCow/DeviceCode/Libraries/STM32F10x_StdPeriph_Driver/inc" />
<IncludePaths Include="Solutions/STM32F103ZE_RedCow/DeviceCode/Libraries/CMSIS/Core/CM3/" />
</ItemGroup>
<ItemGroup />
<Import Project="$(SPOCLIENT)/tools/targets/Microsoft.SPOT.System.Targets" />
</Project>
3. INTC_Adapter
增加INTC_Adapter.h和INTC_Adapter.cpp两个文件,分别输入如下内容:
INTC_Adapter.h
INTC_Adapter.cpp
4. NativeSample.proj
打开$(SPOCLIENT)/Solutions/STM32F103ZE_RedCow/NativeSample/NativeSample.proj文件,重新定义INTC工程目录。
原语句:
<ItemGroup>
<DriverLibs Include="cpu_intc_stubs.$(LIB_EXT)" />
<RequiredProjects Include="$(SPOCLIENT)/DeviceCode/drivers/stubs/processor/stubs_INTC/dotNetMF.proj" />
</ItemGroup
更改为:
<ItemGroup>
<DriverLibs Include="CPU_HAL_STM32F103ZE_RedCow.$(LIB_EXT)" />
<RequiredProjects Include="$(SPOCLIENT)/Solutions/STM32F103ZE_RedCow/DeviceCode/INTC_HAL/dotNetMF.proj" />
</ItemGroup>
5. stubs_functions_INTC.cpp
打开$(SPOCLIENT)/Solutions/STM32F103ZE_RedCow/DeviceCode/INTC_HAL/ stubs_functions_INTC.cpp,将代码更改为: