mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2025-12-12 16:08:49 +01:00
Merge pull request #115 from Faboor/patch-1
Return error from `softPwmCreate` if `pthread_create` fails
This commit is contained in:
commit
6a17382a0a
@ -153,6 +153,9 @@ int softPwmCreate (int pin, int initialValue, int pwmRange)
|
|||||||
newPin = pin ;
|
newPin = pin ;
|
||||||
res = pthread_create (&myThread, NULL, softPwmThread, (void *)passPin) ;
|
res = pthread_create (&myThread, NULL, softPwmThread, (void *)passPin) ;
|
||||||
|
|
||||||
|
if (res != 0)
|
||||||
|
return res ;
|
||||||
|
|
||||||
while (newPin != -1)
|
while (newPin != -1)
|
||||||
delay (1) ;
|
delay (1) ;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user