添加开机延时
This commit is contained in:
parent
8eef0ec399
commit
41ca46e68f
@ -2,8 +2,8 @@
|
||||
#include "avctp_user.h"
|
||||
#include "key_event_deal.h"
|
||||
#include "app_task.h"
|
||||
//#include "audio_eq.h"
|
||||
//#include "media/audio_eq_drc_apply.h"
|
||||
// #include "audio_eq.h"
|
||||
// #include "media/audio_eq_drc_apply.h"
|
||||
#include "audio_dec.h"
|
||||
|
||||
typedef struct _kts_
|
||||
@ -133,7 +133,6 @@ static void start_timer(void)
|
||||
__this->timer = sys_timer_add(NULL, led_tim_callback, 100);
|
||||
}
|
||||
|
||||
|
||||
void user_eq_tre(int freq, int gain)
|
||||
{
|
||||
struct high_bass parm = {0};
|
||||
@ -152,11 +151,20 @@ void user_eq_bass(int freq, int gain)
|
||||
mix_out_high_bass(AUDIO_EQ_BASS, &parm);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void kt_init(void)
|
||||
{
|
||||
|
||||
u32 delay_10ms_cnt = 0;
|
||||
PA_MUTE();
|
||||
while (1)
|
||||
{
|
||||
clr_wdt();
|
||||
os_time_dly(2);
|
||||
delay_10ms_cnt++;
|
||||
if (delay_10ms_cnt > 40)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
__this->bass = (adc_get_value(KTCFG_BASS_AD_CHANNEL) * 24 / 1023) - 12;
|
||||
user_eq_bass(0, __this->bass);
|
||||
__this->treble = (adc_get_value(KTCFG_TREBLE_AD_CHANNEL) * 24 / 1023) - 12;
|
||||
@ -179,10 +187,10 @@ u8 kt_key_event_filter_after(int key_event)
|
||||
switch (key_event)
|
||||
{
|
||||
case KEY_USER_CHECK_AD:
|
||||
//led_tim_callback();
|
||||
//printf("KEY_USER_CHECK_AD\n");
|
||||
// led_tim_callback();
|
||||
// printf("KEY_USER_CHECK_AD\n");
|
||||
{
|
||||
//u32 val = adc_get_value(KTCFG_VOLUME_AD_CHANNEL); // 0-1023
|
||||
// u32 val = adc_get_value(KTCFG_VOLUME_AD_CHANNEL); // 0-1023
|
||||
s8 vol = (adc_get_value(KTCFG_VOLUME_AD_CHANNEL) * 30 / 1023);
|
||||
|
||||
if (vol != __this->volume)
|
||||
@ -192,7 +200,6 @@ u8 kt_key_event_filter_after(int key_event)
|
||||
app_audio_set_volume(APP_AUDIO_STATE_MUSIC, __this->volume, 1);
|
||||
}
|
||||
|
||||
|
||||
// 读取BASS AD值并转换为-12到12的范围
|
||||
s8 bass = (adc_get_value(KTCFG_BASS_AD_CHANNEL) * 24 / 1023) - 12;
|
||||
|
||||
@ -215,9 +222,9 @@ u8 kt_key_event_filter_after(int key_event)
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
//printf("bass_ad_value: %d\n", adc_get_value(KTCFG_BASS_AD_CHANNEL));
|
||||
//printf("treble_ad_value: %d\n", adc_get_value(KTCFG_TREBLE_AD_CHANNEL));
|
||||
//printf("volume_ad_value: %d\n", adc_get_value(KTCFG_VOLUME_AD_CHANNEL));
|
||||
// printf("bass_ad_value: %d\n", adc_get_value(KTCFG_BASS_AD_CHANNEL));
|
||||
// printf("treble_ad_value: %d\n", adc_get_value(KTCFG_TREBLE_AD_CHANNEL));
|
||||
// printf("volume_ad_value: %d\n", adc_get_value(KTCFG_VOLUME_AD_CHANNEL));
|
||||
break;
|
||||
case KEY_MUSIC_PP:
|
||||
bled_set();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1867,6 +1867,8 @@ objs/apps/kaotings/kt.c.o
|
||||
-r=objs/apps/kaotings/kt.c.o,mix_out_high_bass,l
|
||||
-r=objs/apps/kaotings/kt.c.o,user_eq_bass,pl
|
||||
-r=objs/apps/kaotings/kt.c.o,kt_init,pl
|
||||
-r=objs/apps/kaotings/kt.c.o,clr_wdt,l
|
||||
-r=objs/apps/kaotings/kt.c.o,os_time_dly,l
|
||||
-r=objs/apps/kaotings/kt.c.o,adc_get_value,l
|
||||
-r=objs/apps/kaotings/kt.c.o,app_audio_set_volume,l
|
||||
-r=objs/apps/kaotings/kt.c.o,bled_set,pl
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user