/******************************************************************************
 *
 * Copyright 2017, Lattice Semiconductor, Inc. All rights reserved.
 * No part of this work may be reproduced, modified, distributed, transmitted,
 * transcribed, or translated into any language or computer format, in any form
 * or by any means without written permission of Lattice Semiconductor Inc.,
 * 111 SW 5th Ave, Suite 700, Portland, OR 97204.
 *
 *****************************************************************************/
/**
 * @file sii_sys_assert_api.h
 *
 * @brief Assertion check library API
 *
 *****************************************************************************/

#ifndef SII_SYS_ASSERT_API_H
#define SII_SYS_ASSERT_API_H

#include <sii_datatypes.h>

#ifdef SII_SYS_ASSERT_ON

#define SII_ASSERT(expr)	\
	((expr) ? (0) : (sii_sys_assert(SII_MODULE_NAME_GET(), __LINE__)))

#else

#ifndef SII_ASSERT
#define SII_ASSERT(expr)
#endif

#endif

extern bool_t b_assert_status;
extern uint32_t assert_line_no;
extern uint8_t assert_module_id;

void *sii_sys_assert(const char *module_str, uint32_t line_no);

#endif /*SII_SYS_ASSERT_API_H*/
