Rev 7 | Rev 11 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7 | Rev 8 | ||
---|---|---|---|
Line 150... | Line 150... | ||
150 | // wait until there are enough samples |
150 | // wait until there are enough samples |
151 | while(1) |
151 | while(1) |
152 | { |
152 | { |
153 | 153 | ||
154 | diff = sampleCount - outSampleCount; |
154 | diff = sampleCount - outSampleCount; |
155 | if(outSampleCount > sampleCount) |
155 | if(outSampleCount >= sampleCount) |
156 | diff = sampleCount - outSampleCount; |
156 | diff = sampleCount - outSampleCount; |
157 | else |
157 | else |
158 | diff = SAMPLE_BUFF_SIZE + sampleCount - outSampleCount; |
158 | diff = SAMPLE_BUFF_SIZE + sampleCount - outSampleCount; |
159 | 159 | ||
160 | if(diff > 1) |
160 | if(diff > 1) |
161 | break; |
161 | break; |
162 | chThdSleep(1); |
162 | chThdSleep(10); |
163 | } |
163 | } |
164 | 164 | ||
165 | // pick the next out of gap sample |
165 | // pick the next out of gap sample |
166 | if(sampleState == WAIT_GAP) |
166 | if(sampleState == WAIT_GAP) |
167 | { |
167 | { |