Skip to content

Commit

Permalink
lib: stm32wba: Minimize dependencies
Browse files Browse the repository at this point in the history
Add some minor tweaks to files extracted from STM32Cube package
in order to minimize number of files to include.

Signed-off-by: Erwan Gouriou <[email protected]>
  • Loading branch information
erwango authored and carlescufi committed Dec 18, 2023
1 parent 57bcb4f commit 6ab3e14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/stm32wba/hci/app_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw_if.h"
#include "utilities_conf.h"
#include "log_module.h"
/* #include "log_module.h" */

/* USER CODE BEGIN Includes */

Expand Down
4 changes: 2 additions & 2 deletions lib/stm32wba/hci/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ extern "C" {
/* Includes ------------------------------------------------------------------*/
#include "stm32wbaxx_hal.h"
#include "app_conf.h"
#include "app_entry.h"
/* #include "app_entry.h" */
#include "app_common.h"
#include "app_debug.h"
/* #include "app_debug.h" */

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
Expand Down
21 changes: 15 additions & 6 deletions lib/stm32wba/hci/scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

/* Includes ------------------------------------------------------------------*/
#include "scm.h"
#if (RT_DEBUG_GPIO_MODULE==1)
#include "RTDebug.h"
#endif

#if (CFG_SCM_SUPPORTED == 1)
#if (CFG_SCM_SUPPORTED==1)

__weak void SCM_HSI_CLK_ON(void)
{
Expand Down Expand Up @@ -89,8 +91,9 @@ static scm_clockconfig_t scm_getmaxfreq(void)

static void scm_systemclockconfig(void)
{
#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_SET(SCM_SYSTEM_CLOCK_CONFIG);

#endif
switch (scm_system_clock_config.targeted_clock_freq)
{
case HSE_16MHZ:
Expand Down Expand Up @@ -165,8 +168,9 @@ static void scm_systemclockconfig(void)
default:
break;
}

#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_RESET(SCM_SYSTEM_CLOCK_CONFIG);
#endif
}

static void SwitchHsePre(scm_hse_hsepre_t hse_pre)
Expand Down Expand Up @@ -424,8 +428,9 @@ void scm_init()
*/
void scm_setup(void)
{
#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_SET(SCM_SETUP);

#endif
/* System clock is now on HSI 16Mhz, as it exits from stop mode */

/* Start HSE */
Expand Down Expand Up @@ -479,7 +484,9 @@ void scm_setup(void)
__HAL_RCC_ENABLE_IT(RCC_IT_HSERDY);
}
}
#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_RESET(SCM_SETUP);
#endif
}

/**
Expand Down Expand Up @@ -710,8 +717,9 @@ void scm_setwaitstates(const scm_ws_lp_t ws_lp_config)
*/
void scm_hserdy_isr(void)
{
#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_SET(SCM_HSERDY_ISR);

#endif
if(LL_RCC_GetSysClkSource() == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
{
/* Wait until VOS has changed */
Expand Down Expand Up @@ -764,8 +772,9 @@ void scm_hserdy_isr(void)
/* Ensure time base clock coherency */
SystemCoreClockUpdate();
}

#if (RT_DEBUG_GPIO_MODULE==1)
SYSTEM_DEBUG_SIGNAL_RESET(SCM_HSERDY_ISR);
#endif
}

/**
Expand Down

0 comments on commit 6ab3e14

Please sign in to comment.