Skip to content

mts targets: fix debug() usage #5032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
**/

#include "stm32f4xx.h"
#include "mbed_debug.h"

/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
Expand Down Expand Up @@ -240,8 +241,6 @@ uint8_t SetSysClock_PLL_HSI(void)
/******************************************************************************/
void HardFault_Handler(void)
{
#if !defined(NDEBUG) || NDEBUG == 0
printf("Hard Fault\n");
#endif
debug("Hard Fault\n");
NVIC_SystemReset();
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
**/

#include "stm32f4xx.h"

#include "mbed_debug.h"

/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
Expand Down Expand Up @@ -243,8 +243,6 @@ uint8_t SetSysClock_PLL_HSI(void)
/******************************************************************************/
void HardFault_Handler(void)
{
#if !defined(NDEBUG) || NDEBUG == 0
printf("Hard Fault\n");
#endif
debug("Hard Fault\n");
NVIC_SystemReset();
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "stm32l1xx.h"
#include "stdio.h"
#include "mbed_debug.h"

/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
Expand Down Expand Up @@ -253,9 +254,7 @@ uint8_t SetSysClock_PLL_HSI(void)
/******************************************************************************/
void HardFault_Handler(void)
{
#if !defined(NDEBUG) || NDEBUG == 0
printf("Hard Fault\n");
#endif
debug("Hard Fault\n");
NVIC_SystemReset();
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@

#include "xdot_low_power.h"
#include "stdio.h"

#if defined(NDEBUG) && NDEBUG == 1
#define xdot_lp_debug(...) do {} while(0)
#else
#define xdot_lp_debug(...) printf(__VA_ARGS__)
#endif
#include "mbed_debug.h"

static uint32_t portA[6];
static uint32_t portB[6];
Expand Down Expand Up @@ -236,7 +231,7 @@ void xdot_enter_stop_mode() {
HSERCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4;
HSERCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3;
if (HAL_RCC_OscConfig(&HSERCC_OscInitStruct) != HAL_OK) {
xdot_lp_debug("OSC initialization failed - initiating soft reset\r\n");
debug("OSC initialization failed - initiating soft reset\r\n");
NVIC_SystemReset();
}

Expand All @@ -247,7 +242,7 @@ void xdot_enter_stop_mode() {
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; // 32 MHz
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // 32 MHz
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
xdot_lp_debug("PLL initialization failed - initiating soft reset\r\n");
debug("PLL initialization failed - initiating soft reset\r\n");
NVIC_SystemReset();
}

Expand All @@ -260,7 +255,7 @@ void xdot_enter_stop_mode() {
HSIRCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
HAL_StatusTypeDef ret = HAL_RCC_OscConfig(&HSIRCC_OscInitStruct);
if ( ret != HAL_OK ) {
xdot_lp_debug("HSI initialization failed - ADC will not function properly\r\n");
debug("HSI initialization failed - ADC will not function properly\r\n");
}
}

Expand Down