[SX126x] Fixed narrowing conversion warning

This commit is contained in:
jgromes 2019-12-30 20:07:04 +01:00
parent 02ac97b07e
commit e745fe2988

View file

@ -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);