Skip to content
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

STM32WL: fix MBED_CONF_STM32WL_LORA_DRIVER_SLEEP_MODE option #15322

Merged
merged 1 commit into from
Aug 24, 2022
Merged
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
11 changes: 6 additions & 5 deletions connectivity/drivers/lora/TARGET_STM32WL/STM32WL_LoRaRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SPDX-License-Identifier: BSD-3-Clause
#include "ThisThread.h"
#include "Timer.h"
#include "STM32WL_LoRaRadio.h"
#include "mbed_wait_api.h"

#ifndef DEBUG_STDIO
#define DEBUG_STDIO 0
Expand Down Expand Up @@ -728,18 +729,18 @@ void STM32WL_LoRaRadio::wakeup()
void STM32WL_LoRaRadio::sleep(void)
{
DEBUG_PRINTF("STM32WL_LoRaRadio::sleep\n");
#if MBED_CONF_STM32WL_LORA_DRIVER_SLEEP_MODE == 1
// cold start, power consumption 160 nA
sleep_state = 0x00;
#endif

/* switch the antenna OFF by SW */
set_antenna_switch(RBI_SWITCH_OFF);
Radio_SMPS_Set(SMPS_DRIVE_SETTING_DEFAULT);


#if MBED_CONF_STM32WL_LORA_DRIVER_SLEEP_MODE == 1
// cold start, power consumption 160 nA
uint8_t sleep_state = 0x00;
#else
// warm start set , power consumption 600 nA
uint8_t sleep_state = 0x04;
#endif
write_opmode_command(RADIO_SET_SLEEP, &sleep_state, 1);

_operating_mode = MODE_SLEEP;
Expand Down