<div dir="ltr">>How does this debugging get turned on/off?<div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>-DRTEMS_CAN_DEBUG as a Compiler Flag will enable the debug prints.</div></blockquote><div><div class="gmail-adm" style="margin:5px 0px"><div id="gmail-q_206" class="gmail-ajR gmail-h4" style="background-color:rgb(232,234,237);border:none;clear:both;line-height:6px;outline:none;width:24px;color:rgb(80,0,80);font-size:11px;border-radius:5.5px"><div class="gmail-ajT" style="background:url("https://www.gstatic.com/images/icons/material/system_gm/1x/more_horiz_black_20dp.png") 50% 50%/20px no-repeat;height:11px;opacity:0.71;width:24px">></div></div></div></div>>maybe use CAN_ERROR? unless there's a reason not to.</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">The debug #defines helps us to have control over the debug prints based on the entity (isr, locks, rx, tx).<br>This helps the BSP CAN driver development to have debug prints based on the entity (isr, locks, rx, tx).<br>Can we have this feature?</blockquote><div><span class="gmail-im" style=""><font color="#500050">></font><br><font color="#500050">>> #define CAN_MSG_LEN(msg) ((char *)(&((struct can_msg *)msg)->data[(uint16_t)((struc</font><font color="#500050">t can_msg *)msg)->len]) - (char *)(msg))</font></span><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 15 Dec 2022 at 02:55, Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">How does this debugging get turned on/off?<br>
<br>
<br>
On Sat, Dec 3, 2022 at 2:00 AM Prashanth S <<a href="mailto:fishesprashanth@gmail.com" target="_blank">fishesprashanth@gmail.com</a>> wrote:<br>
><br>
> ---<br>
> cpukit/include/dev/can/can.h | 27 +++++++++++++++++++++------<br>
> 1 file changed, 21 insertions(+), 6 deletions(-)<br>
><br>
> diff --git a/cpukit/include/dev/can/can.h b/cpukit/include/dev/can/can.h<br>
> index 9e55395039..4ee51ebc9d 100644<br>
> --- a/cpukit/include/dev/can/can.h<br>
> +++ b/cpukit/include/dev/can/can.h<br>
> @@ -53,13 +53,28 @@<br>
> printf(str, ##__VA_ARGS__); \<br>
> } while (false);<br>
><br>
> +#ifdef RTEMS_CAN_DEBUG<br>
> +<br>
> #define CAN_DEBUG(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_BUF(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_ISR(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_LOCK(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_RX(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_TX(str, ...) CAN_DEBUG(str, ##__VA_ARGS__)<br>
> -#define CAN_DEBUG_REG(str, ...) //CAN_DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_BUF(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_ISR(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_LOCK(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_RX(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_TX(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
> +#define CAN_DEBUG_REG(str, ...) /* CAN_DEBUG(str, ##__VA_ARGS__) */<br>
> +<br>
> +#else /* RTEMS_CAN_DEBUG */<br>
> +<br>
> +#define CAN_DEBUG(str, ...)<br>
> +#define CAN_DEBUG_BUF(str, ...)<br>
> +#define CAN_DEBUG_ISR(str, ...)<br>
> +#define CAN_DEBUG_LOCK(str, ...)<br>
> +#define CAN_DEBUG_RX(str, ...)<br>
> +#define CAN_DEBUG_TX(str, ...)<br>
> +#define CAN_DEBUG_REG(str, ...)<br>
> +<br>
> +#endif /* RTEMS_CAN_DEBUG */<br>
> +<br>
> #define CAN_ERR(str, ...) DEBUG(str, ##__VA_ARGS__)<br>
><br>
maybe use CAN_ERROR? unless there's a reason not to.<br>
<br>
> #define CAN_MSG_LEN(msg) ((char *)(&((struct can_msg *)msg)->data[(uint16_t)((struct can_msg *)msg)->len]) - (char *)(msg))<br>
> --<br>
> 2.25.1<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>