Merge pull request #115 from Faboor/patch-1

Return error from `softPwmCreate` if `pthread_create` fails
This commit is contained in:
Mark Liffiton 2021-06-19 11:07:42 -05:00 committed by GitHub
commit 6a17382a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) ;