From: kyz Date: Mon, 26 May 2025 07:05:15 +0000 (+0800) Subject: update sound freq value X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=2296361dcd771549b061a378a0d900cee2922de2;p=yn%2Falarmmonitor_mcu.git update sound freq value --- diff --git a/user/user_adc.c b/user/user_adc.c index 5304e2d..cdd92d8 100644 --- a/user/user_adc.c +++ b/user/user_adc.c @@ -77,8 +77,8 @@ uint32_t adc_fft( uint16_t * sound_freq, uint16_t *sound_amplitude ) // ¼ÆËãʵ¼ÊƵÂÊ signalFreq = (maxIndex * SAMPLE_RATE) / FFT_SIZE; //printf("Dominant Frequency: %.2f Hz\r\n", signalFreq); - if( *sound_freq ) *sound_freq = signalFreq; - if( *sound_amplitude ) *sound_amplitude = maxValue; + if( sound_freq ) *sound_freq = signalFreq; + if( sound_amplitude ) *sound_amplitude = maxValue; fft_ticks += HAL_GetTick() - start; #endif @@ -140,7 +140,7 @@ static void user_sound_task(void *argument) } if( adc_finished ){ adc_fft( &freq, &litude ); - //user_sound_info_update( freq ); + user_sound_info_update( freq, 1 ); } } }