Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
mzwhhwj committed Jul 15, 2015
1 parent a38fb07 commit 24cef68
Show file tree
Hide file tree
Showing 10,849 changed files with 2,656,728 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
46 changes: 46 additions & 0 deletions Application/EraseDeployment/EraseDeployment.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation. All rights reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include "tinyhal.h"

HAL_DECLARE_NULL_HEAP();

void ApplicationEntryPoint()
{
int nSects = 0;
const FLASH_SECTOR *sects;

CPU_InitializeCommunication();

Flash_EnumerateSectors( nSects, sects );

//--//

hal_printf( "Erasing deployment...........\r\n" );

Flash_ChipReadOnly( FALSE );
for(int i = 0; i < nSects; i++)
{
if((sects[ i ].Usage & MEMORY_USAGE_MASK) == MEMORY_USAGE_DEPLOYMENT)
{
hal_printf( "Erasing sector %d (0x%08x)\r\n", i, (UINT32)sects[ i ].Start );
if(!Flash_IsSectorErased( &sects[ i ] ))
{
Flash_EraseSector( &sects[ i ] );
}
}
}
Flash_ChipReadOnly( TRUE );

hal_printf( "Erasing deployment finished!\r\n" );

// allowing extra wait so that we can see the print statement!
Events_WaitForEvents( 0, (UINT32)10000 );
CPU_Reset();
}
29 changes: 29 additions & 0 deletions Application/EraseDeployment/dotNetMF.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

<PropertyGroup>
<Directory>Application\EraseDeployment</Directory>
</PropertyGroup>

<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Settings" />

<PropertyGroup>
<OutputType>Executable</OutputType>
<ADD_LOAD_IMAGE_CRC>false</ADD_LOAD_IMAGE_CRC>
<AssemblyName>EraseDeployment</AssemblyName>
<ExtraTargets>BuildSigFiles</ExtraTargets>
<EXEScatterFileDefinition>$(SRC_DIR)\scatterfile_definition.xml</EXEScatterFileDefinition>
</PropertyGroup>

<Import Project="$(SPOCLIENT)\DeviceCode\Targets\$(TARGETCODEBASETYPE)\$(TARGETCODEBASE)\$(PLATFORM)\Drivers_$(PLATFORM).proj" Condition="Exists('$(SPOCLIENT)\DeviceCode\Targets\$(TARGETCODEBASETYPE)\$(TARGETCODEBASE)\$(PLATFORM)\Drivers_$(PLATFORM).proj')" />

<ItemGroup>
<Compile Include="EraseDeployment.cpp" />

<InputLibs Include="$(PLATFORM_INDEPENDENT_LIB_DIR)\CRC.$(LIB_EXT)"/>

<ScatterFileReferences Include="$(SPOCLIENT)\DeviceCode\Targets\$(TARGETCODEBASETYPE)\$(TARGETCODEBASE)\$(PLATFORM)\scatterfile_tools.xml"/>
</ItemGroup>

<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Targets" />

</Project>
6 changes: 6 additions & 0 deletions Application/EraseDeployment/scatterfile_definition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<ScatterFile>

<Include File="%SPOCLIENT%\DeviceCode\Targets\%TARGETCODEBASETYPE%\%TARGETCODEBASE%\%PLATFORM%\scatterfile_tools.xml"/>

</ScatterFile>
Loading

0 comments on commit 24cef68

Please sign in to comment.