浏览代码

Merge GH changes for 3B+ 3A+

pull/63/head
grumpy-dude 5 年前
父节点
当前提交
e26fc46e57
共有 7 个文件被更改,包括 38 次插入21 次删除
  1. +1
    -1
      VERSION
  2. +1
    -1
      debian-template/wiringPi/DEBIAN/control
  3. +10
    -7
      gpio/readall.c
  4. +2
    -2
      version.h
  5. +7
    -3
      wiringPi/wiringPi.c
  6. +5
    -3
      wiringPi/wiringPi.h
  7. +12
    -4
      wiringPi/wiringPiSPI.c

+ 1
- 1
VERSION 查看文件

@@ -1 +1 @@
2.46
2.50

+ 1
- 1
debian-template/wiringPi/DEBIAN/control 查看文件

@@ -1,5 +1,5 @@
Package: wiringpi
Version: 2.46
Version: 2.50
Section: libraries
Priority: optional
Architecture: armhf


+ 10
- 7
gpio/readall.c 查看文件

@@ -303,10 +303,12 @@ static void plus2header (int model)
printf (" +-----+-----+---------+------+---+-Pi ZeroW-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_2)
printf (" +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3)
printf (" +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3P)
printf (" +-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3B)
printf (" +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3BP)
printf (" +-----+-----+---------+------+---+---Pi 3B+-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3AP)
printf (" +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+\n") ;
else
printf (" +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+\n") ;
}
@@ -351,11 +353,12 @@ void doReadall (void)
/**/ if ((model == PI_MODEL_A) || (model == PI_MODEL_B))
abReadall (model, rev) ;
else if ((model == PI_MODEL_BP) || (model == PI_MODEL_AP) ||
(model == PI_MODEL_2) ||
(model == PI_MODEL_3) || (model == PI_MODEL_3P) ||
(model == PI_MODEL_2) ||
(model == PI_MODEL_3AP) ||
(model == PI_MODEL_3B) || (model == PI_MODEL_3BP) ||
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W))
piPlusReadall (model) ;
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3))
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || ((model == PI_MODEL_CM3P)))
allReadall () ;
else
printf ("Oops - unable to determine board type... model: %d\n", model) ;


+ 2
- 2
version.h 查看文件

@@ -1,3 +1,3 @@
#define VERSION "2.46"
#define VERSION "2.50"
#define VERSION_MAJOR 2
#define VERSION_MINOR 46
#define VERSION_MINOR 50

+ 7
- 3
wiringPi/wiringPi.c 查看文件

@@ -220,7 +220,7 @@ volatile unsigned int *_wiringPiTimerIrqRaw ;

static volatile unsigned int piGpioBase = 0 ;

const char *piModelNames [16] =
const char *piModelNames [20] =
{
"Model A", // 0
"Model B", // 1
@@ -235,9 +235,13 @@ const char *piModelNames [16] =
"CM3", // 10
"Unknown11", // 11
"Pi Zero-W", // 12
"Pi 3+", // 13
"Unknown14", // 14
"Pi 3B+", // 13
"Pi 3A+", // 14
"Unknown15", // 15
"CM3+", // 16
"Unknown17", // 17
"Unknown18", // 18
"Unknown19", // 19
} ;

const char *piRevisionNames [16] =


+ 5
- 3
wiringPi/wiringPi.h 查看文件

@@ -99,11 +99,13 @@
#define PI_ALPHA 5
#define PI_MODEL_CM 6
#define PI_MODEL_07 7
#define PI_MODEL_3 8
#define PI_MODEL_3B 8
#define PI_MODEL_ZERO 9
#define PI_MODEL_CM3 10
#define PI_MODEL_ZERO_W 12
#define PI_MODEL_3P 13
#define PI_MODEL_3BP 13
#define PI_MODEL_3AP 14
#define PI_MODEL_CM3P 16

#define PI_VERSION_1 0
#define PI_VERSION_1_1 1
@@ -115,7 +117,7 @@
#define PI_MAKER_EMBEST 2
#define PI_MAKER_UNKNOWN 3

extern const char *piModelNames [16] ;
extern const char *piModelNames [20] ;
extern const char *piRevisionNames [16] ;
extern const char *piMakerNames [16] ;
extern const int piMemorySize [ 8] ;


+ 12
- 4
wiringPi/wiringPiSPI.c 查看文件

@@ -23,7 +23,9 @@
*/


#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
@@ -39,8 +41,8 @@
// The SPI bus parameters
// Variables as they need to be passed as pointers later on

static const char *spiDev0 = "/dev/spidev0.0" ;
static const char *spiDev1 = "/dev/spidev0.1" ;
//static const char *spiDev0 = "/dev/spidev0.0" ;
//static const char *spiDev1 = "/dev/spidev0.1" ;
static const uint8_t spiBPW = 8 ;
static const uint16_t spiDelay = 0 ;

@@ -99,12 +101,18 @@ int wiringPiSPIDataRW (int channel, unsigned char *data, int len)

int wiringPiSPISetupMode (int channel, int speed, int mode)
{
enum { SPIDEV_FILENAME_MAX_LEN = 32 };
int fd ;
char spiDev [SPIDEV_FILENAME_MAX_LEN] ;

mode &= 3 ; // Mode is 0, 1, 2 or 3
channel &= 1 ; // Channel is 0 or 1

if ((fd = open (channel == 0 ? spiDev0 : spiDev1, O_RDWR)) < 0)
// Channel can be anything - lets hope for the best
// channel &= 1 ; // Channel is 0 or 1

snprintf (spiDev, SPIDEV_FILENAME_MAX_LEN, "/dev/spidev0.%d", channel) ;

if ((fd = open (spiDev, O_RDWR)) < 0)
return wiringPiFailure (WPI_ALMOST, "Unable to open SPI device: %s\n", strerror (errno)) ;

spiSpeeds [channel] = speed ;


正在加载...
取消
保存