- /** Macro for testing condition "x" and breaking via \ref JTAG_DEBUG_BREAK() if the condition is false.
- *
- * \param[in] Condition Condition that will be evaluated,
- *
- * \ingroup Group_Debugging
- */
- #define JTAG_DEBUG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE
+ /** Defines an explicit JTAG break point in the resulting binary via the assembly \c BREAK statement. When
+ * a JTAG is used, this causes the program execution to halt when reached until manually resumed.
+ *
+ * \ingroup Group_Debugging
+ */
+ #define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("BREAK" ::)
+
+ #if !defined(pgm_read_ptr) || defined(__DOXYGEN__)
+ /** Reads a pointer out of PROGMEM space. This is currently a wrapper for the avr-libc \c pgm_read_ptr()
+ * macro with a \c void* cast, so that its value can be assigned directly to a pointer variable or used
+ * in pointer arithmetic without further casting in C. In a future avr-libc distribution this will be
+ * part of the standard API and will be implemented in a more formal manner.
+ *
+ * \param[in] Addr Address of the pointer to read.
+ *
+ * \return Pointer retrieved from PROGMEM space.
+ */
+ #define pgm_read_ptr(Addr) (void*)pgm_read_word(Addr)
+ #endif
+
+ /** Macro for testing condition "x" and breaking via \ref JTAG_DEBUG_BREAK() if the condition is false.
+ *
+ * \param[in] Condition Condition that will be evaluated,
+ *
+ * \ingroup Group_Debugging
+ */
+ #define JTAG_DEBUG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE