19 Commits

Author SHA1 Message Date
Mark Liffiton 7f8fe26e4f Merge pull request #120 from toca21/master
Fixed the Compute Module 4 pin mode setting.
2021-07-26 14:22:01 -05:00
toca21 5cabf4a4f8 Fixed the Compute Module 4 pin mode setting. The CM4 is equal to RB4 std platform, not CM3 family as it turned out. 2021-07-20 21:49:53 +02:00
Mark Liffiton 6a17382a0a Merge pull request #115 from Faboor/patch-1
Return error from `softPwmCreate` if `pthread_create` fails
2021-06-19 11:07:42 -05:00
Peter Kovary 772e1198dd Return error from softPwmCreate if pthread_create fails
If `pthread_create` fails, `newPin` will never get reset to -1 and process would hang. This change will return from `softPwmCreate` immediately if  `pthread_create` returns a non-zero value and avoid hanging forever.
2021-06-19 12:55:49 +01:00
Mark Liffiton afddd8c504 Merge pull request #114 from wolfv/patch-1
LIBS have to come after OBJ files for recent GCC
2021-06-14 20:56:02 -05:00
Mark Liffiton 8b33c328be Merge pull request #111 from MichaIng/patch-1
Fix build warnings
2021-06-09 08:43:17 -05:00
Wolf Vollprecht d903619255 LIBS have to come after OBJ files for recent GCC 2021-06-08 17:52:44 +02:00
MichaIng f152400923 Update wiringPi.c
wiringPi.c:1328:21: warning: ‘digitalWrite8Dummy’ defined but not used [-Wunused-function]
 1328 | static         void digitalWrite8Dummy       (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
      |                     ^~~~~~~~~~~~~~~~~~
wiringPi.c:1327:21: warning: ‘digitalRead8Dummy’ defined but not used [-Wunused-function]
 1327 | static unsigned int digitalRead8Dummy        (UNU struct wiringPiNodeStruct *node, UNU int UNU pin)            { return 0 ; }
      |                     ^~~~~~~~~~~~~~~~~

The related nodes at line 1360 and 1362 have been commented before.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-05-01 21:32:50 +02:00
Philip Howard f66c883d7c Update README.md to clarify project status (#81) 2021-03-30 10:49:00 -05:00
fanoush 10be9486ff set WPI_MODE_GPIO as a default mode also for CM4 (#92) 2021-03-30 10:47:47 -05:00
freddyrios 22fac72e1a fixes WiringPi/WiringPi#100 (#101)
Replaces a bare wait() with waitpid() to only wait on the just-forked process.
2021-02-23 21:20:12 -06:00
Philip Howard e9821abdb4 Merge pull request #90 from WiringPi/patch-build
Remove projects@drogon.net contact from build
2020-11-28 20:25:02 +00:00
Philip Howard 3772a913d0 Merge pull request #91 from WiringPi/patch-actions
GitHub Actions
2020-11-26 20:01:21 +00:00
akvavit01 91f3520239 Fix for multiple definition of comDat (#76)
* Fix for multiple definition of comDat
2020-11-26 12:57:36 -06:00
Philip Howard d4b96c7cb4 Merge pull request #85 from namikata2020/rpi4_8g
Add piMemorySize for rpi4 8G
2020-11-26 16:36:49 +00:00
Philip Howard 4fc9420625 Merge pull request #89 from fanoush/master
Add support for Pi 400 and CM4
2020-11-26 16:19:37 +00:00
Phil Howard 50fa6362f9 First crack at a build workflow 2020-11-26 16:18:51 +00:00
fanoush 1aed7f7c9d Add support for Pi 400 and CM4 2020-11-26 15:57:05 +01:00
namikata2020 6ca0231124 Add piMemorySize for rpi4 8G 2020-10-06 14:50:12 +09:00
8 changed files with 58 additions and 19 deletions
+16
View File
@@ -0,0 +1,16 @@
name: Build
on:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run build
run: |
./build
+20 -6
View File
@@ -1,19 +1,33 @@
Unofficial WiringPi Mirror
==========================
WiringPi (Unofficial Mirror/Fork)
=================================
This is an unofficial mirror of WiringPi to support ports (Python/Ruby/etc). With the
This is an unofficial mirror/fork of wiringPi to support ports (Python/Ruby/etc). With the
[end of official development](http://wiringpi.com/wiringpi-deprecated/), this repository
has become a mirror of the last "official" source release as well as a source for small
updates to support newer hardware (primarily for use by the ports).
has become a mirror of the last "official" source release, plus a fork facilitating updates
to support newer hardware (primarily for use by the ports) and fix bugs.
* The final "official" source release can be found at the
[`final_source_2.50`](https://github.com/WiringPi/WiringPi/tree/final_official_2.50) tag.
* The default `master` branch contains code that has been written since that final source
release to provide support for newer hardware.
Ports
-----
wiringPi has been wrapped for multiple languages:
* Node - https://github.com/WiringPi/WiringPi-Node
* Perl - https://github.com/WiringPi/WiringPi-Perl
* PHP - https://github.com/WiringPi/WiringPi-PHP
* Python - https://github.com/WiringPi/WiringPi-Python
* Ruby - https://github.com/WiringPi/WiringPi-Ruby
Support
-------
Please do not email Gordon if you have issues, he will not be able to help.
Pull-requests may be accepted to add or fix support for newer hardware, but new features or
other changes will not be accepted.
other changes may not be accepted.
For support, comments, questions, etc please join the WiringPi Discord channel: https://discord.gg/SM4WUVG
+5 -3
View File
@@ -311,6 +311,8 @@ static void plus2header (int model)
printf (" +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_4B)
printf (" +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_400)
printf (" +-----+-----+---------+------+---+---Pi 400-+---+------+---------+-----+-----+\n") ;
else
printf (" +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+\n") ;
}
@@ -358,10 +360,10 @@ void doReadall (void)
(model == PI_MODEL_2) ||
(model == PI_MODEL_3AP) ||
(model == PI_MODEL_3B) || (model == PI_MODEL_3BP) ||
(model == PI_MODEL_4B) ||
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W))
(model == PI_MODEL_4B) || (model == PI_MODEL_400) ||
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W) || (model == PI_MODEL_CM4))
piPlusReadall (model) ;
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || ((model == PI_MODEL_CM3P)))
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) ;
+1 -1
View File
@@ -75,7 +75,7 @@ static:
$(DYNAMIC): $(OBJ)
$Q echo "[Link (Dynamic)]"
$Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(LIBS) $(OBJ)
$Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(OBJ) $(LIBS)
.c.o:
$Q echo [Compile] $<
+3
View File
@@ -153,6 +153,9 @@ int softPwmCreate (int pin, int initialValue, int pwmRange)
newPin = pin ;
res = pthread_create (&myThread, NULL, softPwmThread, (void *)passPin) ;
if (res != 0)
return res ;
while (newPin != -1)
delay (1) ;
+9 -6
View File
@@ -219,7 +219,7 @@ volatile unsigned int *_wiringPiTimerIrqRaw ;
static volatile unsigned int piGpioBase = 0 ;
const char *piModelNames [20] =
const char *piModelNames [21] =
{
"Model A", // 0
"Model B", // 1
@@ -240,7 +240,8 @@ const char *piModelNames [20] =
"CM3+", // 16
"Pi 4B", // 17
"Unknown18", // 18
"Unknown19", // 19
"Pi 400", // 19
"CM4", // 20
} ;
const char *piRevisionNames [16] =
@@ -290,7 +291,7 @@ const int piMemorySize [8] =
1024, // 2
2048, // 3
4096, // 4
0, // 5
8192, // 5
0, // 6
0, // 7
} ;
@@ -1323,8 +1324,8 @@ struct wiringPiNodeStruct *wiringPiFindNode (int pin)
static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; }
static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; }
static unsigned int digitalRead8Dummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return 0 ; }
static void digitalWrite8Dummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
//static unsigned int digitalRead8Dummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return 0 ; }
//static void digitalWrite8Dummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; }
static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
@@ -2048,7 +2049,7 @@ int wiringPiISR (int pin, int mode, void (*function)(void))
return wiringPiFailure (WPI_FATAL, "wiringPiISR: Can't find gpio program\n") ;
}
else // Parent, wait
wait (NULL) ;
waitpid (pid, NULL, 0) ;
}
// Now pre-open the /sys/class node - but it may already be open if
@@ -2312,6 +2313,8 @@ int wiringPiSetup (void)
break ;
case PI_MODEL_4B:
case PI_MODEL_400:
case PI_MODEL_CM4:
piGpioBase = GPIO_PERI_BASE_2711 ;
piGpioPupOffset = GPPUPPDN0 ;
break ;
+3 -1
View File
@@ -103,6 +103,8 @@
#define PI_MODEL_3AP 14
#define PI_MODEL_CM3P 16
#define PI_MODEL_4B 17
#define PI_MODEL_400 19
#define PI_MODEL_CM4 20
#define PI_VERSION_1 0
#define PI_VERSION_1_1 1
@@ -114,7 +116,7 @@
#define PI_MAKER_EMBEST 2
#define PI_MAKER_UNKNOWN 3
extern const char *piModelNames [20] ;
extern const char *piModelNames [21] ;
extern const char *piRevisionNames [16] ;
extern const char *piMakerNames [16] ;
extern const int piMemorySize [ 8] ;
+1 -2
View File
@@ -40,5 +40,4 @@ struct drcNetComStruct
uint32_t pin ;
uint32_t cmd ;
uint32_t data ;
} comDat ;
};