Power handling

master
Friedl Ulrich 10 years ago
parent 17f95aec5f
commit 280265c566

@ -196,17 +196,17 @@ func (r *Device) SetMode(newMode byte) error {
return nil
}
err := r.readWriteReg(REG_OPMODE, 0xE3, newMode)
if r.isRFM69HW && (newMode == RF_OPMODE_RECEIVER || newMode == RF_OPMODE_TRANSMITTER) {
err := r.setHighPowerRegs(newMode == RF_OPMODE_TRANSMITTER)
if err != nil {
return err
}
}
if r.isRFM69HW && (newMode == RF_OPMODE_RECEIVER || newMode == RF_OPMODE_TRANSMITTER) {
err = r.setHighPowerRegs(newMode == RF_OPMODE_TRANSMITTER)
err := r.readWriteReg(REG_OPMODE, 0xE3, newMode)
if err != nil {
return err
}
}
// we are using packet mode, so this check is not really needed
// but waiting for mode ready is necessary when going from sleep because the FIFO may not be immediately available from previous mode

Loading…
Cancel
Save