📄 debug.tex
字号:
Since debugging on every device is completely different, a DBG macro is implemented. On Linux for example, this macro will print the string givento the screen (using printf). On AVR, it will send debug strings through theUART. For compatibility with other devices, it is necessary that you always usethe DBG-macro instead of a device-specific debugging commands.\newline\newlineBecause AVR-GCC puts strings in sram memory by default, every string should besurrounded by the TXT-macro. On AVR, this macro will put the string in programmemory (flash), on any other device, this macro will be ignored.\newline\newlineExample of a debug string:\\ \code{DBG((TXT("This is test nr \%d of \%d.$\backslash$n"),id,total));}\subsubsection{Debugging on Linux}On linux, debugging strings are sent to stdout using printf.\newline\newlineTo enable debugging, set DEBUG in \filename{config.h}.\subsubsection{Debugging on AVR}On AVR, debugging strings are sent through the UART and can be read usinga terminal like minicom (linux) or hyperterminal (windows). Standard, thefirst UART is used, but this can be changed in \filename{debug.c} to thesecond UART.\newline\newlineTo enable debugging:\begin{itemize} \item{Set DEBUG in \filename{config.h}} \item{Set CLK to the clock speed of your AVR in \filename{config.h}} \item{Set BAUDRATE to the baudrate you want in \filename{config.h}} \item{Initialize debugging in your program by calling \code{debug\_init()}}\end{itemize}Remark: when you use the serial port in your main program, make sure youuse a different UART than the one efsl is using when sending debug string.\subsubsection{Debugging on DSP}On DSP, debugging strings are sent to Code Composer using the printf function.\newline\newlineTo enable debugging, set DEBUG in \filename{config.h}.\newline\newlineRemark: this will only work when using a DSK-kit.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -