www.pudn.com > KEA_Driver_Lib_V1.zip > assert.c, change:2014-03-13,size:1945b


/****************************************************************************** 
* 
* Freescale Semiconductor Inc. 
* (c) Copyright 2013 Freescale Semiconductor, Inc. 
* ALL RIGHTS RESERVED. 
* 
*************************************************************************** 
* 
* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR 
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE. 
* 
***************************************************************************//*! 
* 
* @file assert.c 
* 
* @author Freescale 
* 
* @version 0.0.1 
* 
* @date Jun. 25, 2013 
* 
* @brief provide macro for software assertions.  
* 
*       ASSERT macro defined in assert.h calls assert_failed(). 
*******************************************************************************/ 
 
#include "common.h" 
 
const char ASSERT_FAILED_STR[] = "Assertion failed in %s at line %d\n"; 
 
/********************************************************************/ 
void 
assert_failed(char *file, int line) 
{ 
    int i; 
     
    printf(ASSERT_FAILED_STR, file, line); 
 
    while (1) 
    { 
//        platform_led_display(0xFF); 
        for (i = 100000; i; i--) ; 
//        platform_led_display(0x00); 
        for (i = 100000; i; i--) ; 
    } 
} 
/********************************************************************/