[SX126x] Fixed narrowing conversion warning
This commit is contained in:
parent
02ac97b07e
commit
e745fe2988
1 changed files with 3 additions and 4 deletions
|
@ -371,12 +371,11 @@ int16_t SX126x::scanChannel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t SX126x::sleep(bool retainConfig) {
|
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) {
|
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, &sleepMode, 1, false);
|
||||||
int16_t state = SPIwriteCommand(SX126X_CMD_SET_SLEEP, data, 1, false);
|
|
||||||
|
|
||||||
// wait for SX126x to safely enter sleep mode
|
// wait for SX126x to safely enter sleep mode
|
||||||
delayMicroseconds(500);
|
delayMicroseconds(500);
|
||||||
|
|
Loading…
Add table
Reference in a new issue