F1 tone resolution: try to force compiler optimisation

This commit is contained in:
stevstrong 2018-03-23 10:55:26 +01:00 committed by GitHub
parent 41b165cae0
commit e76e8adb52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ void tone(uint32_t pin, uint32_t freq, uint32_t duration) {
tone_ncount = tone_n = (count>>16)+1; // number of 16-bit count chunk
tone_tcount = count/tone_ncount; // size of count chunk
if(duration > 0) // number of half waves to be generated
tone_nhw = (2*duration*freq)/1000;
tone_nhw = duration*freq*2/1000;
else // no duration specified, continuous sound until noTone() called
tone_nhw = 0;