If I do an AudioSynthToneSweep sweep(0.8, 1000, 1000, 1) the sweep never ends. This is because the tone_tmp and tone_incr is 0 and so the loop never triggers the end-check (if((tone_freq >> 32) > tone_hi)). While 1000Hz to 1000Hz is not really a "sweep", it may cause problems.