From e745fe29887de08f9c2643952ad04572f0b29997 Mon Sep 17 00:00:00 2001 From: jgromes Date: Mon, 30 Dec 2019 20:07:04 +0100 Subject: [PATCH] [SX126x] Fixed narrowing conversion warning --- src/modules/SX126x/SX126x.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 33d7fcb7..00102db5 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -371,12 +371,11 @@ int16_t SX126x::scanChannel() { } int16_t SX126x::sleep(bool retainConfig) { - uint8_t sleepMode = SX126X_SLEEP_START_WARM; + uint8_t sleepMode = SX126X_SLEEP_START_WARM | SX126X_SLEEP_RTC_OFF; if(!retainConfig) { - sleepMode = SX126X_SLEEP_START_COLD; + sleepMode = SX126X_SLEEP_START_COLD | SX126X_SLEEP_RTC_OFF; } - uint8_t data[] = {sleepMode | SX126X_SLEEP_RTC_OFF}; - int16_t state = SPIwriteCommand(SX126X_CMD_SET_SLEEP, data, 1, false); + int16_t state = SPIwriteCommand(SX126X_CMD_SET_SLEEP, &sleepMode, 1, false); // wait for SX126x to safely enter sleep mode delayMicroseconds(500);