navienginebsp/tools/testreference/lauterbach/flasherase.cmm
changeset 0 5de814552237
equal deleted inserted replaced
-1:000000000000 0:5de814552237
       
     1 //
       
     2 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:  
       
    15 //
       
    16 //////////////////////////////////////////////////////////////////////////////
       
    17 //
       
    18 // Generic NOR Flash erasing script.
       
    19 //
       
    20 // Change History:
       
    21 //
       
    22 // 01/01/2008 1.0 : Initial version
       
    23 // 08/05/2009 1.1 : Updated to fit in with new platform specific flashing mechanism
       
    24 //
       
    25 //////////////////////////////////////////////////////////////////////////////
       
    26 
       
    27 &scriptversion=1.1
       
    28 
       
    29 print "======================================================================="
       
    30 print "Generic NOR flash erasing script version &scriptversion"
       
    31 
       
    32 ; Declare the global variables used by the system and read the current config into them
       
    33 do globals.cmm
       
    34 
       
    35 ; Make sure that flashing is supported on the target platform
       
    36 if os.file("&PlatformsDir\&Platform\flash.cmm")
       
    37 	(
       
    38 	; Get some generic global settings before doing anything
       
    39 	do init.cmm
       
    40 
       
    41 	local &result
       
    42 
       
    43 	; Make sure the user really does want to wipe out their NOR flash!
       
    44 	if "&FlashEraseProtect"!="OFF"
       
    45 	(
       
    46 		dialog.yesno "Are you *sure* you want to erase NOR flash?"
       
    47 		entry &result
       
    48 	)
       
    49 	else
       
    50 	(
       
    51 		&result=(0==0)
       
    52 	)
       
    53 
       
    54 	if &result
       
    55 		(
       
    56 		; Now do the platform specific operations
       
    57 		do &PlatformsDir\&Platform\flasherase.cmm
       
    58 		)
       
    59 	)
       
    60 else
       
    61 	(
       
    62 	dialog.ok "NOR flashing not supported for platform &Platform"
       
    63 	)
       
    64 
       
    65 enddo