mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2026-03-30 08:43:22 +02:00
Merge pull request #115 from Faboor/patch-1
Return error from `softPwmCreate` if `pthread_create` fails
This commit is contained in:
@@ -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) ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user