mirror of
https://github.com/kidoman/embd
synced 2024-12-22 04:40:04 +01:00
l3gd20: added a stop method
This commit is contained in:
parent
f6ed134486
commit
b96018021e
@ -370,12 +370,20 @@ func (d *L3GD20) Start() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Close.
|
||||
func (d *L3GD20) Close() (err error) {
|
||||
func (d *L3GD20) Stop() (err error) {
|
||||
if d.closing != nil {
|
||||
waitc := make(chan struct{})
|
||||
d.closing <- waitc
|
||||
<-waitc
|
||||
}
|
||||
return d.Bus.WriteByteToReg(address, ctrlReg1, ctrlReg1Finished)
|
||||
if err = d.Bus.WriteByteToReg(address, ctrlReg1, ctrlReg1Finished); err != nil {
|
||||
return
|
||||
}
|
||||
d.initialized = false
|
||||
return
|
||||
}
|
||||
|
||||
// Close.
|
||||
func (d *L3GD20) Close() (err error) {
|
||||
return d.Stop()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user