mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
refactor: use *SPI everywhere to make consistant for implementations.
Fixes #4663 "in reverse" by making SPI a pointer everywhere, as discussed in the comments. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -257,7 +257,7 @@ type SPI struct {
|
||||
}
|
||||
|
||||
// Configure is intended to setup the SPI interface.
|
||||
func (s SPI) Configure(config SPIConfig) error {
|
||||
func (s *SPI) Configure(config SPIConfig) error {
|
||||
|
||||
// This is only here to help catch a bug with the configuration
|
||||
// where a machine missed a value.
|
||||
@@ -330,7 +330,7 @@ func (s SPI) Configure(config SPIConfig) error {
|
||||
}
|
||||
|
||||
// Transfer writes the byte into the register and returns the read content
|
||||
func (s SPI) Transfer(b byte) (byte, error) {
|
||||
func (s *SPI) Transfer(b byte) (byte, error) {
|
||||
s.spdr.Set(uint8(b))
|
||||
|
||||
for !s.spsr.HasBits(s.spsrSPIF) {
|
||||
|
||||
Reference in New Issue
Block a user