MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / softToneCreate

Function softToneCreate

wiringPi/softTone.c:110–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 */
109
110int softToneCreate (int pin)
111{
112 int res ;
113 pthread_t myThread ;
114
115 pinMode (pin, OUTPUT) ;
116 digitalWrite (pin, LOW) ;
117
118 if (threads [pin] != 0)
119 return -1 ;
120
121 freqs [pin] = 0 ;
122
123 newPin = pin ;
124 res = pthread_create (&myThread, NULL, softToneThread, NULL) ;
125
126 while (newPin != -1)
127 delay (1) ;
128
129 threads [pin] = myThread ;
130
131 return res ;
132}
133
134
135/*

Callers 2

pinModeFunction · 0.85
mainFunction · 0.85

Calls 3

pinModeFunction · 0.85
digitalWriteFunction · 0.85
delayFunction · 0.70

Tested by

no test coverage detected