application: minor, double ensure debug info is only show with DEBUG enabled

This commit is contained in:
King Kévin 2021-05-14 14:50:02 +02:00
parent a716cb10cf
commit 9c9893e1da
1 changed files with 8 additions and 8 deletions

View File

@ -384,26 +384,26 @@ void main(void)
#if DEBUG #if DEBUG
// show reset cause // show reset cause
if (RCC_CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF | RCC_CSR_PINRSTF)) { if (RCC_CSR & (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF | RCC_CSR_PINRSTF)) {
puts("reset cause(s):"); puts_debug("reset cause(s):");
if (RCC_CSR & RCC_CSR_LPWRRSTF) { if (RCC_CSR & RCC_CSR_LPWRRSTF) {
puts(" low-power"); puts_debug(" low-power");
} }
if (RCC_CSR & RCC_CSR_WWDGRSTF) { if (RCC_CSR & RCC_CSR_WWDGRSTF) {
puts(" window-watchdog"); puts_debug(" window-watchdog");
} }
if (RCC_CSR & RCC_CSR_IWDGRSTF) { if (RCC_CSR & RCC_CSR_IWDGRSTF) {
puts(" independent-watchdog"); puts_debug(" independent-watchdog");
} }
if (RCC_CSR & RCC_CSR_SFTRSTF) { if (RCC_CSR & RCC_CSR_SFTRSTF) {
puts(" software"); puts_debug(" software");
} }
if (RCC_CSR & RCC_CSR_PORRSTF) { if (RCC_CSR & RCC_CSR_PORRSTF) {
puts(" POR/PDR"); puts_debug(" POR/PDR");
} }
if (RCC_CSR & RCC_CSR_PINRSTF) { if (RCC_CSR & RCC_CSR_PINRSTF) {
puts(" pin"); puts_debug(" pin");
} }
putc('\n'); puts_debug("\n");
RCC_CSR |= RCC_CSR_RMVF; // clear reset flags RCC_CSR |= RCC_CSR_RMVF; // clear reset flags
} }
#endif #endif