const int16_t *src, *end; | const int16_t *src, *end; | ||||
int16_t *dest; | int16_t *dest; | ||||
audio_block_t *block; | audio_block_t *block; | ||||
uint32_t saddr, offset; | |||||
uint32_t saddr; | |||||
saddr = (uint32_t)DMA_TCD4_SADDR; | saddr = (uint32_t)DMA_TCD4_SADDR; | ||||
DMA_CINT = 4; | DMA_CINT = 4; | ||||
} | } | ||||
block = AudioOutputAnalog::block_left_1st; | block = AudioOutputAnalog::block_left_1st; | ||||
if (block) { | if (block) { | ||||
src = &block->data[offset]; | |||||
src = block->data; | |||||
do { | do { | ||||
// TODO: this should probably dither | // TODO: this should probably dither | ||||
*dest++ = ((*src++) + 32767) >> 4; | *dest++ = ((*src++) + 32767) >> 4; |
{ | { | ||||
public: | public: | ||||
AudioSynthWaveform(void) : | AudioSynthWaveform(void) : | ||||
AudioStream(0,NULL), tone_amp(0), ramp_up(0), ramp_down(0), | |||||
ramp_length(0), tone_phase(0), tone_incr(0), | |||||
tone_type(0), tone_freq(0) | |||||
AudioStream(0,NULL), | |||||
tone_freq(0), tone_phase(0), tone_incr(0), tone_type(0), | |||||
ramp_down(0), ramp_up(0), ramp_length(0) | |||||
{ | { | ||||
} | } | ||||
// Change the frequency on-the-fly to permit a phase-continuous | // Change the frequency on-the-fly to permit a phase-continuous |