Bladeren bron

Updated a technicality in softPwm, and added a suggested memset to zero

for the SPI code - it's mentioned in spidev.h but not used in the actual
kernel documentation example spi_test.c program )-:
pull/62/head
Gordon Henderson 9 jaren geleden
bovenliggende
commit
51fff3cab9
2 gewijzigde bestanden met toevoegingen van 9 en 5 verwijderingen
  1. +4
    -5
      wiringPi/softPwm.c
  2. +5
    -0
      wiringPi/wiringPiSPI.c

+ 4
- 5
wiringPi/softPwm.c Bestand weergeven

@@ -51,11 +51,10 @@

#define PULSE_TIME 100

static int marks [MAX_PINS] ;
static int range [MAX_PINS] ;
static pthread_t threads [MAX_PINS] ;

int newPin = -1 ;
static volatile int marks [MAX_PINS] ;
static volatile int range [MAX_PINS] ;
static volatile pthread_t threads [MAX_PINS] ;
static volatile int newPin = -1 ;


/*


+ 5
- 0
wiringPi/wiringPiSPI.c Bestand weergeven

@@ -75,6 +75,11 @@ int wiringPiSPIDataRW (int channel, unsigned char *data, int len)

channel &= 1 ;

// Mentioned in spidev.h but not used in the original kernel documentation
// test program )-:

memset (&spi, 0, sizeof (spi)) ;

spi.tx_buf = (unsigned long)data ;
spi.rx_buf = (unsigned long)data ;
spi.len = len ;


Laden…
Annuleren
Opslaan