mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 14:33:41 +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:
@@ -419,7 +419,7 @@ type SPIConfig struct {
|
||||
// Configure is intended to setup the SPI interface.
|
||||
// Only SPI controller 0 and 1 can be used because SPI2 is a special
|
||||
// peripheral-mode controller and SPI3 is used for flashing.
|
||||
func (spi SPI) Configure(config SPIConfig) error {
|
||||
func (spi *SPI) Configure(config SPIConfig) error {
|
||||
// Use default pins if not set.
|
||||
if config.SCK == 0 && config.SDO == 0 && config.SDI == 0 {
|
||||
config.SCK = SPI0_SCK_PIN
|
||||
@@ -476,7 +476,7 @@ func (spi SPI) Configure(config SPIConfig) error {
|
||||
}
|
||||
|
||||
// Transfer writes/reads a single byte using the SPI interface.
|
||||
func (spi SPI) Transfer(w byte) (byte, error) {
|
||||
func (spi *SPI) Transfer(w byte) (byte, error) {
|
||||
spi.Bus.SSIENR.Set(0)
|
||||
|
||||
// Set transfer-receive mode.
|
||||
|
||||
Reference in New Issue
Block a user