1.2.5.4.11 SYS_DEBUG_BreakPoint Macro

C

#if defined(__DEBUG)
    // For PIC32M based Devices
    #define SYS_DEBUG_BreakPoint()  __asm__ volatile (" sdbbp 0")

    // For ARM based Devices
    #define SYS_DEBUG_BreakPoint()  __asm__ __volatile__ ("bkpt #0");
#else
    #define SYS_DEBUG_BreakPoint()
#endif

Summary

Inserts a software breakpoint instruction when building in Debug mode.

Description

This macro inserts a software breakpoint instruction when building in Debug mode.

Precondition

None.

Parameters

None.

Returns

None.

Example

if (myDebugTestFailed)
{
    SYS_DEBUG_BreakPoint();
}

Remarks

Compiles out if not built for debugging.