SYS/BIOS  7.00
Assert.h File Reference

Detailed Description

Runtime assertion manager.

The Assert module provides configurable diagnostics to the program. Similar to the standard C assert() macro, Assert methods are interspersed with other code to add diagnostics to a program. Unlike the standard C assert support, the Assert module provides greater flexibility in managing the messages displayed, the message string space overhead, and the runtime handling of failures. In addition, because the Assert methods build atop the Diags module, you can precisely control which asserts remain in the final application, if any.

Assert statements are added to the code using the Assert_isTrue macro.

The following C code adds an assert to application code

#define BIOS_assertsEnabled_D 1
Assert_isTrue(count > 0, NULL);

The Assert calls can also be completely removed by defining the symbol BIOS_assertsEnabled_D to 0. This can be done on the compile line, e.g. -DBIOS_assertsEnabled_D=0. This will completely remove the Assert statements from any code compiled with this flag, regardless of the application's configuration or your compiler's optimization settings.

#include <ti/sysbios/runtime/Error.h>
Include dependency graph for Assert.h:

Go to the source code of this file.

© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale