Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Jun 26, 2024
1 parent d53451b commit b67b0bd
Show file tree
Hide file tree
Showing 7 changed files with 285 additions and 312 deletions.
44 changes: 15 additions & 29 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#include "sl_event_handler.h"

#include "system_si91x.h"
#include "rsi_nvic_priorities_config.h"
#include "sli_siwx917_soc.h"
#include "rsi_board.h"
#include "rsi_debug.h"
#include "rsi_nvic_priorities_config.h"
#include "sli_siwx917_soc.h"
#include "system_si91x.h"
#if SL_ICD_ENABLED
#include "sl_si91x_power_manager.h"
#include "rsi_wisemcu_hardware_setup.h"
#include "sl_si91x_power_manager.h"
#include "sl_si91x_power_manager_init.h"
#endif // SL_ICD_ENABLED
#include "SEGGER_RTT.h"
#include "sl_sleeptimer.h"
#include "cmsis_os2.h"
#include "sl_iostream_init_instances.h"
#include "sl_iostream_rtt.h"
#include "sl_si91x_button_instances.h"
#include "sl_si91x_led_instances.h"
#include "sl_sleeptimer.h"
#include "sl_ulp_timer_instances.h"
#include "sl_iostream_rtt.h"
#include "cmsis_os2.h"
#include "sl_iostream_init_instances.h"

void sl_platform_init(void)
{
void sl_platform_init(void) {
SystemCoreClockUpdate();
sl_si91x_device_init_nvic();
sli_si91x_platform_init();
Expand All @@ -32,19 +31,14 @@ void sl_platform_init(void)
osKernelInitialize();
}

void sl_kernel_start(void)
{
osKernelStart();
}
void sl_kernel_start(void) { osKernelStart(); }

void sl_driver_init(void)
{
void sl_driver_init(void) {
button_init_instances();
led_init_instances();
}

void sl_service_init(void)
{
void sl_service_init(void) {
#if SL_ICD_ENABLED
sl_si91x_power_manager_init();
sli_si91x_power_manager_configure_ram_and_peripheral();
Expand All @@ -55,16 +49,8 @@ void sl_service_init(void)
sl_iostream_init_instances();
}

void sl_stack_init(void)
{
}
void sl_stack_init(void) {}

void sl_internal_app_init(void)
{
}

void sl_iostream_init_instances(void)
{
sl_iostream_rtt_init();
}
void sl_internal_app_init(void) {}

void sl_iostream_init_instances(void) { sl_iostream_rtt_init(); }
138 changes: 66 additions & 72 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c
Original file line number Diff line number Diff line change
@@ -1,85 +1,79 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_handler.c.jinja
* @brief Power Manager Service Handler
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
/***************************************************************************/ /**
* @file sl_si91x_power_manager_handler.c.jinja
* @brief Power Manager Service Handler
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/

#include "sl_si91x_power_manager.h"

/***************************************************************************//**
* Check if the MCU can sleep at that time. This function is called when the system
* is about to go sleeping, with the interrupts disabled. It allows the software to
* cancel going to sleep in case of a last-minute event occurred (window between the
* function call and interrupt disable).
*
* @return True, if the system can go to sleep.
* False, otherwise.
*
* @note This function is called with the interrupt disabled and it MUST NOT be
* re-enabled.
******************************************************************************/
__WEAK boolean_t app_is_ok_to_sleep(void)
{
return true;
}
/***************************************************************************/ /**
* Check if the MCU can sleep at that time. This function is called when the system
* is about to go sleeping, with the interrupts disabled. It allows the software to
* cancel going to sleep in case of a last-minute event occurred (window between the
* function call and interrupt disable).
*
* @return True, if the system can go to sleep.
* False, otherwise.
*
* @note This function is called with the interrupt disabled and it MUST NOT be
* re-enabled.
******************************************************************************/
__WEAK boolean_t app_is_ok_to_sleep(void) { return true; }

/***************************************************************************//**
* Check if the MCU can sleep after an interrupt. This function is called after an
* interrupt occured and was processed. It allows the power manger to know if it must
* go back to sleep or wakeup.
*
* @return SL_SI91X_POWER_MANAGER_IGNORE, if the module did not trigger an ISR and it
* won't to contribute to the decision.
*
* SL_SI91X_POWER_MANAGER_SLEEP, The module was the one that caused the system
* wakeup and the system SHOULD go back to sleep.
*
* SL_SI91X_POWER_MANAGER_WAKEUP, The module was the one that caused the system
* wakeup and the system MUST NOT go back to sleep.
*
* @note This function must not have any side effects. It is not guaranteed to be
* called for every ISR. If a prior hook function requires to wakeup, such
* as a wireless stack, the application hook function won't be called.
******************************************************************************/
__WEAK sl_si91x_power_manager_on_isr_exit_t app_sleep_on_isr_exit(void)
{
/***************************************************************************/ /**
* Check if the MCU can sleep after an interrupt. This function is called after an
* interrupt occured and was processed. It allows the power manger to know if it must
* go back to sleep or wakeup.
*
* @return SL_SI91X_POWER_MANAGER_IGNORE, if the module did not trigger an ISR and it
* won't to contribute to the decision.
*
* SL_SI91X_POWER_MANAGER_SLEEP, The module was the one that caused the system
* wakeup and the system SHOULD go back to sleep.
*
* SL_SI91X_POWER_MANAGER_WAKEUP, The module was the one that caused the system
* wakeup and the system MUST NOT go back to sleep.
*
* @note This function must not have any side effects. It is not guaranteed to be
* called for every ISR. If a prior hook function requires to wakeup, such
* as a wireless stack, the application hook function won't be called.
******************************************************************************/
__WEAK sl_si91x_power_manager_on_isr_exit_t app_sleep_on_isr_exit(void) {
return SL_SI91X_POWER_MANAGER_ISR_IGNORE;
}
/***************************************************************************//**
* Mandatory callback that must validate if the MCU can sleep after having
* processed an interrupt when the system was sleeping.
******************************************************************************/
boolean_t sl_si91x_power_manager_sleep_on_isr_exit(void)
{
/***************************************************************************/ /**
* Mandatory callback that must validate if the MCU can sleep after having
* processed an interrupt when the system was sleeping.
******************************************************************************/
boolean_t sl_si91x_power_manager_sleep_on_isr_exit(void) {
sl_si91x_power_manager_on_isr_exit_t answer;
boolean_t sleep = false;
boolean_t force_wakeup = false;


// Application hook
answer = app_sleep_on_isr_exit();
if (answer == SL_SI91X_POWER_MANAGER_ISR_WAKEUP) {
Expand Down
63 changes: 31 additions & 32 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_init.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_init.h.jinja
* @brief Power Manager Service Initialization
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
/***************************************************************************/ /**
* @file sl_si91x_power_manager_init.h.jinja
* @brief Power Manager Service Initialization
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/

#ifndef SL_SI91X_POWER_MANAGER_INIT_H
#define SL_SI91X_POWER_MANAGER_INIT_H
Expand All @@ -37,9 +37,8 @@ extern "C" {

#include "sl_si91x_power_manager_config_3.h"


__STATIC_INLINE void sli_si91x_power_manager_configure_ram_and_peripheral(void)
{
__STATIC_INLINE void
sli_si91x_power_manager_configure_ram_and_peripheral(void) {
sl_si91x_power_manager_remove_peripheral_requirement(&peripheral_config);
sl_si91x_power_manager_configure_ram_retention(&ram_configuration);
}
Expand Down
Loading

0 comments on commit b67b0bd

Please sign in to comment.