Ver a proveniência

Fixed a bug where the CPU was running at 100% when using softTone

- added delay in SoftTone thread when frequence = 0
pull/11/head
Crom há 12 anos
ascendente
cometimento
4b90644dae
1 ficheiros alterados com 5 adições e 1 eliminações
  1. +5
    -1
      wiringPi/softTone.c

+ 5
- 1
wiringPi/softTone.c Ver ficheiro

@@ -69,6 +69,10 @@ static PI_THREAD (softToneThread)
digitalWrite (pin, LOW) ;
delayMicroseconds (halfPeriod) ;
}
else
{
delayMicroseconds(1000);
}
}

return NULL ;
@@ -114,6 +118,6 @@ int softToneCreate (int pin)

while (newPin != -1)
delay (1) ;
return res ;
}

Carregando…
Cancelar
Guardar