From 5e85a44f9327c4aeb9db939b8dd1d1ed17d05b4e Mon Sep 17 00:00:00 2001 From: Dolf Andringa Date: Mon, 2 Mar 2020 04:46:27 +0000 Subject: [PATCH] fix argument error --- wiringPi/wiringPiSPI.c | 4 ++-- wiringPi/wiringPiSPI.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wiringPi/wiringPiSPI.c b/wiringPi/wiringPiSPI.c index 3cdbe3d..ff1ca66 100644 --- a/wiringPi/wiringPiSPI.c +++ b/wiringPi/wiringPiSPI.c @@ -100,7 +100,7 @@ void getDevice(char* spidev, int channel, int port) { sprintf(spidev, "/dev/spidev/%i.%i", channel, port); } -int wiringPiSPISetupMode (int channel, int speed, int mode, int port) +int wiringPiSPISetupMode (int channel, int port, int speed, int mode) { int fd ; @@ -140,5 +140,5 @@ int wiringPiSPISetupMode (int channel, int speed, int mode, int port) int wiringPiSPISetup (int channel, int speed) { - return wiringPiSPISetupMode (channel, speed, 0) ; + return wiringPiSPISetupMode (channel, 0, speed, 0) ; } diff --git a/wiringPi/wiringPiSPI.h b/wiringPi/wiringPiSPI.h index 962f025..62c7aed 100644 --- a/wiringPi/wiringPiSPI.h +++ b/wiringPi/wiringPiSPI.h @@ -28,7 +28,7 @@ extern "C" { int wiringPiSPIGetFd (int channel) ; int wiringPiSPIDataRW (int channel, unsigned char *data, int len) ; -int wiringPiSPISetupMode (int channel, int speed, int mode, int port=0) ; +int wiringPiSPISetupMode (int channel, int port, int speed, int mode) ; int wiringPiSPISetup (int channel, int speed) ; #ifdef __cplusplus