功能完成
This commit is contained in:
parent
9fd47355c9
commit
50d8f1f7c1
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"fm_api.h": "c"
|
||||
}
|
||||
}
|
BIN
FW/KT24-1110/KT24-1110_65E-HA651B_A056.fw
Normal file
BIN
FW/KT24-1110/KT24-1110_65E-HA651B_A056.fw
Normal file
Binary file not shown.
BIN
FW/KT24-1110/jl_isd.fw
Normal file
BIN
FW/KT24-1110/jl_isd.fw
Normal file
Binary file not shown.
@ -20,3 +20,4 @@
|
||||
16. AUX PA3 AUX0L
|
||||
17. AUX DET PC4
|
||||
18. LED PB5
|
||||
19. PA2 功放模式,0-ClassD 1-ClassAB
|
@ -17,12 +17,12 @@
|
||||
#define APP_PROTOCOL_DEMO_CODE 0
|
||||
#define APP_PROTOCOL_GMA_CODE 0
|
||||
#define APP_PROTOCOL_AMA_CODE 0
|
||||
#define APP_PROTOCOL_DMA_CODE 1
|
||||
#define APP_PROTOCOL_DMA_CODE 0
|
||||
#define APP_PROTOCOL_TME_CODE 0
|
||||
#define APP_PROTOCOL_MMA_CODE 0
|
||||
|
||||
#define APP_PROTOCOL_SPEECH_EN 1 //语音助手功能,若无此功能则关掉
|
||||
#define APP_PROTOCOL_READ_CFG_EN 1 //从custom.dat中读取配置信息,若无此功能则关掉
|
||||
#define APP_PROTOCOL_SPEECH_EN 0 //语音助手功能,若无此功能则关掉
|
||||
#define APP_PROTOCOL_READ_CFG_EN 0 //从custom.dat中读取配置信息,若无此功能则关掉
|
||||
|
||||
#define DEMO_HANDLER_ID 0x300 /*作为一个使用的例子,同时也可作为客户自己添加协议的ID*/
|
||||
#define GMA_HANDLER_ID 0x400 /*阿里天猫协议接口ID*/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@
|
||||
#define TCFG_APP_FM_EN 1
|
||||
#define TCFG_APP_PC_EN 1
|
||||
#define TCFG_APP_RTC_EN 0
|
||||
#define TCFG_APP_RECORD_EN 1
|
||||
#define TCFG_APP_RECORD_EN 0
|
||||
#define TCFG_APP_SPDIF_EN 0
|
||||
//*********************************************************************************//
|
||||
// PCM_DEBUG调试配置 //
|
||||
@ -41,9 +41,9 @@
|
||||
//*********************************************************************************//
|
||||
// UART配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_UART0_ENABLE ENABLE_THIS_MOUDLE //串口打印模块使能
|
||||
#define TCFG_UART0_ENABLE DISABLE_THIS_MOUDLE //串口打印模块使能
|
||||
#define TCFG_UART0_RX_PORT NO_CONFIG_PORT //串口接收脚配置(用于打印可以选择NO_CONFIG_PORT)
|
||||
#define TCFG_UART0_TX_PORT IO_PORTA_05 //串口发送脚配置
|
||||
#define TCFG_UART0_TX_PORT IO_PORT_DP //串口发送脚配置
|
||||
#define TCFG_UART0_BAUDRATE 1000000 //串口波特率配置
|
||||
|
||||
//*********************************************************************************//
|
||||
@ -69,7 +69,7 @@
|
||||
//*********************************************************************************//
|
||||
// 硬件SPI 配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_HW_SPI1_ENABLE ENABLE_THIS_MOUDLE
|
||||
#define TCFG_HW_SPI1_ENABLE DISABLE_THIS_MOUDLE
|
||||
//A组IO: DI: PB2 DO: PB1 CLK: PB0
|
||||
//B组IO: DI: PC3 DO: PC5 CLK: PC4
|
||||
#define TCFG_HW_SPI1_PORT 'A'
|
||||
@ -77,7 +77,7 @@
|
||||
#define TCFG_HW_SPI1_MODE SPI_MODE_BIDIR_1BIT
|
||||
#define TCFG_HW_SPI1_ROLE SPI_ROLE_MASTER
|
||||
|
||||
#define TCFG_HW_SPI2_ENABLE ENABLE_THIS_MOUDLE
|
||||
#define TCFG_HW_SPI2_ENABLE DISABLE_THIS_MOUDLE
|
||||
//A组IO: DI: PB8 DO: PB10 CLK: PB9
|
||||
//B组IO: DI: PA13 DO: DM CLK: DP
|
||||
#define TCFG_HW_SPI2_PORT 'A'
|
||||
@ -97,11 +97,11 @@
|
||||
// 充电参数配置 //
|
||||
//*********************************************************************************//
|
||||
//是否支持芯片内置充电
|
||||
#define TCFG_CHARGE_ENABLE ENABLE_THIS_MOUDLE
|
||||
#define TCFG_CHARGE_ENABLE DISABLE_THIS_MOUDLE
|
||||
//是否支持开机充电
|
||||
#define TCFG_CHARGE_POWERON_ENABLE ENABLE
|
||||
#define TCFG_CHARGE_POWERON_ENABLE DISABLE
|
||||
//是否支持拔出充电自动开机功能
|
||||
#define TCFG_CHARGE_OFF_POWERON_NE ENABLE
|
||||
#define TCFG_CHARGE_OFF_POWERON_NE DISABLE
|
||||
|
||||
#define TCFG_CHARGE_FULL_V CHARGE_FULL_V_4202
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
//B组IO: CMD:PB6 CLK:PB7 DAT0:PB5 //E组IO: CMD:PA4 CLK:PC5 DAT0:DM
|
||||
//C组IO: CMD:PA4 CLK:PA2 DAT0:PA3 //F组IO: CMD:PB6 CLK:PB7 DAT0:PB4
|
||||
#define TCFG_SD0_ENABLE ENABLE_THIS_MOUDLE
|
||||
#define TCFG_SD0_PORTS 'D'
|
||||
#define TCFG_SD0_PORTS 'F'
|
||||
#define TCFG_SD0_DAT_MODE 1//AC696x不支持4线模式
|
||||
#define TCFG_SD0_DET_MODE SD_CLK_DECT
|
||||
#define TCFG_SD0_DET_IO IO_PORT_DM//当SD_DET_MODE为2时有效
|
||||
@ -133,7 +133,7 @@
|
||||
#if TCFG_SD0_SD1_USE_THE_SAME_HW
|
||||
#define TCFG_SD1_ENABLE 1
|
||||
#else
|
||||
#define TCFG_SD1_ENABLE 0
|
||||
#define TCFG_SD1_ENABLE DISABLE_THIS_MOUDLE
|
||||
#endif
|
||||
#define TCFG_SD1_PORTS 'F'
|
||||
#define TCFG_SD1_DAT_MODE 1//AC696x不支持4线模式
|
||||
@ -238,7 +238,6 @@
|
||||
#define TCFG_IOKEY_ENABLE DISABLE_THIS_MOUDLE //是否使能IO按键
|
||||
|
||||
#define TCFG_IOKEY_POWER_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
||||
|
||||
#define TCFG_IOKEY_POWER_ONE_PORT IO_PORTB_01 //IO按键端口
|
||||
|
||||
#define TCFG_IOKEY_PREV_CONNECT_WAY ONE_PORT_TO_LOW //按键一端接低电平一端接IO
|
||||
@ -254,8 +253,8 @@
|
||||
#define TCFG_ADKEY_LED_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED IO复用,led只能设置蓝灯显示
|
||||
#define TCFG_ADKEY_IR_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 红外IO复用
|
||||
#define TCFG_ADKEY_LED_SPI_IO_REUSE DISABLE_THIS_MOUDLE //ADKEY 和 LED SPI IO复用
|
||||
#define TCFG_ADKEY_PORT IO_PORTA_06 //AD按键端口(需要注意选择的IO口是否支持AD功能)
|
||||
#define TCFG_ADKEY_AD_CHANNEL AD_CH_PA6
|
||||
#define TCFG_ADKEY_PORT IO_PORTB_01 //AD按键端口(需要注意选择的IO口是否支持AD功能)
|
||||
#define TCFG_ADKEY_AD_CHANNEL AD_CH_PB1
|
||||
#define TCFG_ADKEY_EXTERN_UP_ENABLE ENABLE_THIS_MOUDLE //是否使用外部上拉
|
||||
|
||||
#if TCFG_ADKEY_EXTERN_UP_ENABLE
|
||||
@ -266,15 +265,15 @@
|
||||
|
||||
//必须从小到大填电阻,没有则同VDDIO,填0x3ffL
|
||||
#define TCFG_ADKEY_AD0 (0) //0R
|
||||
#define TCFG_ADKEY_AD1 (0x3ffL * 30 / (30 + R_UP)) //3k
|
||||
#define TCFG_ADKEY_AD2 (0x3ffL * 62 / (62 + R_UP)) //6.2k
|
||||
#define TCFG_ADKEY_AD3 (0x3ffL * 91 / (91 + R_UP)) //9.1k
|
||||
#define TCFG_ADKEY_AD4 (0x3ffL * 150 / (150 + R_UP)) //15k
|
||||
#define TCFG_ADKEY_AD5 (0x3ffL * 240 / (240 + R_UP)) //24k
|
||||
#define TCFG_ADKEY_AD6 (0x3ffL * 330 / (330 + R_UP)) //33k
|
||||
#define TCFG_ADKEY_AD7 (0x3ffL * 510 / (510 + R_UP)) //51k
|
||||
#define TCFG_ADKEY_AD8 (0x3ffL * 1000 / (1000 + R_UP)) //100k
|
||||
#define TCFG_ADKEY_AD9 (0x3ffL * 2200 / (2200 + R_UP)) //220k
|
||||
#define TCFG_ADKEY_AD1 (0x3ffL * 100 / (100 + R_UP)) //3k
|
||||
#define TCFG_ADKEY_AD2 (0x3ffL * 150 / (150 + R_UP)) //6.2k
|
||||
#define TCFG_ADKEY_AD3 (0x3ffL * 510 / (510 + R_UP)) //9.1k
|
||||
#define TCFG_ADKEY_AD4 (0x3ffL) //15k
|
||||
#define TCFG_ADKEY_AD5 (0x3ffL) //24k
|
||||
#define TCFG_ADKEY_AD6 (0x3ffL) //33k
|
||||
#define TCFG_ADKEY_AD7 (0x3ffL) //51k
|
||||
#define TCFG_ADKEY_AD8 (0x3ffL) //100k
|
||||
#define TCFG_ADKEY_AD9 (0x3ffL) //220k
|
||||
#define TCFG_ADKEY_VDDIO (0x3ffL)
|
||||
|
||||
#define TCFG_ADKEY_VOLTAGE0 ((TCFG_ADKEY_AD0 + TCFG_ADKEY_AD1) / 2)
|
||||
@ -396,7 +395,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
DAC_OUTPUT_LR 立体声
|
||||
DAC_OUTPUT_MONO_LR_DIFF 单声道差分输出
|
||||
*/
|
||||
#define TCFG_AUDIO_DAC_CONNECT_MODE DAC_OUTPUT_LR
|
||||
#define TCFG_AUDIO_DAC_CONNECT_MODE DAC_OUTPUT_MONO_L
|
||||
|
||||
|
||||
|
||||
@ -411,7 +410,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
#define AUDIO_OUTPUT_WAY AUDIO_OUTPUT_WAY_DAC
|
||||
#define LINEIN_INPUT_WAY LINEIN_INPUT_WAY_ANALOG
|
||||
|
||||
#define AUDIO_OUTPUT_AUTOMUTE 0//ENABLE
|
||||
#define AUDIO_OUTPUT_AUTOMUTE 1//ENABLE
|
||||
|
||||
|
||||
/*
|
||||
@ -445,9 +444,9 @@ DAC硬件上的连接方式,可选的配置:
|
||||
#define TCFG_CALL_USE_DIGITAL_VOLUME 0
|
||||
|
||||
// 使能改宏,提示音音量使用music音量
|
||||
#define APP_AUDIO_STATE_WTONE_BY_MUSIC (1)
|
||||
#define APP_AUDIO_STATE_WTONE_BY_MUSIC (0)
|
||||
// 0:提示音不使用默认音量; 1:默认提示音音量值
|
||||
#define TONE_MODE_DEFAULE_VOLUME (0)
|
||||
#define TONE_MODE_DEFAULE_VOLUME (18)
|
||||
|
||||
/*
|
||||
*支持省电容MIC模块
|
||||
@ -456,7 +455,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
*/
|
||||
#define TCFG_SUPPORT_MIC_CAPLESS ENABLE_THIS_MOUDLE
|
||||
//省电容MIC使能
|
||||
#define TCFG_MIC_CAPLESS_ENABLE DISABLE_THIS_MOUDLE
|
||||
#define TCFG_MIC_CAPLESS_ENABLE ENABLE_THIS_MOUDLE
|
||||
//AudioEffects代码链接管理
|
||||
#define AUDIO_EFFECTS_DRC_AT_RAM 0
|
||||
#define AUDIO_EFFECTS_REVERB_AT_RAM 0
|
||||
@ -505,9 +504,9 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
// UI 配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_UI_ENABLE ENABLE_THIS_MOUDLE //UI总开关
|
||||
#define CONFIG_UI_STYLE STYLE_JL_LED7
|
||||
#define TCFG_UI_LED7_ENABLE ENABLE_THIS_MOUDLE //UI使用LED7显示
|
||||
#define TCFG_UI_ENABLE DISABLE_THIS_MOUDLE //UI总开关
|
||||
//#define CONFIG_UI_STYLE STYLE_JL_LED7
|
||||
#define TCFG_UI_LED7_ENABLE DISABLE_THIS_MOUDLE //UI使用LED7显示
|
||||
// #define TCFG_UI_LCD_SEG3X9_ENABLE ENABLE_THIS_MOUDLE //UI使用LCD段码屏显示
|
||||
// #define TCFG_LCD_ST7735S_ENABLE ENABLE_THIS_MOUDLE
|
||||
// #define TCFG_LCD_ST7789VW_ENABLE ENABLE_THIS_MOUDLE
|
||||
@ -557,7 +556,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
// EQ配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_EQ_ENABLE 1 //支持EQ功能,EQ总使能
|
||||
#define TCFG_EQ_ENABLE 0 //支持EQ功能,EQ总使能
|
||||
#if TCFG_EQ_ENABLE
|
||||
#define TCFG_BT_MUSIC_EQ_ENABLE 1 //支持蓝牙音乐EQ
|
||||
#define TCFG_PHONE_EQ_ENABLE 1 //支持通话近端EQ
|
||||
@ -727,8 +726,8 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
#define TCFG_AUTO_SHUT_DOWN_TIME 0 //没有蓝牙连接自动关机时间
|
||||
#define TCFG_SYS_LVD_EN 1 //电量检测使能
|
||||
#define TCFG_POWER_ON_NEED_KEY 0 //是否需要按按键开机配置
|
||||
#define TWFG_APP_POWERON_IGNORE_DEV 4000//上电忽略挂载设备,0时不忽略,非0则n毫秒忽略
|
||||
#define TCFG_POWER_ON_NEED_KEY 1 //是否需要按按键开机配置
|
||||
#define TWFG_APP_POWERON_IGNORE_DEV 0//上电忽略挂载设备,0时不忽略,非0则n毫秒忽略
|
||||
|
||||
#define TCFG_AUDIO_DEC_OUT_TASK 0 // 解码使用单独任务做输出
|
||||
|
||||
@ -764,8 +763,8 @@ DAC硬件上的连接方式,可选的配置:
|
||||
#endif
|
||||
|
||||
#define BT_INBAND_RINGTONE 0 //是否播放手机自带来电铃声
|
||||
#define BT_PHONE_NUMBER 1 //是否播放来电报号
|
||||
#define BT_SYNC_PHONE_RING 1 //是否TWS同步播放来电铃声
|
||||
#define BT_PHONE_NUMBER 0 //是否播放来电报号
|
||||
#define BT_SYNC_PHONE_RING 0 //是否TWS同步播放来电铃声
|
||||
#define BT_SUPPORT_DISPLAY_BAT 1 //是否使能电量检测
|
||||
#define BT_SUPPORT_MUSIC_VOL_SYNC 1 //是否使能音量同步
|
||||
|
||||
@ -820,9 +819,9 @@ DAC硬件上的连接方式,可选的配置:
|
||||
#if (RECORDER_MIX_EN)
|
||||
#define TCFG_LINEIN_LR_CH AUDIO_LIN0L_CH//AUDIO_LIN0_LR
|
||||
#else
|
||||
#define TCFG_LINEIN_LR_CH AUDIO_LIN0_LR
|
||||
#define TCFG_LINEIN_LR_CH AUDIO_LIN0L_CH
|
||||
#endif/*RECORDER_MIX_EN*/
|
||||
#define TCFG_LINEIN_CHECK_PORT IO_PORTB_01 // linein检测IO
|
||||
#define TCFG_LINEIN_CHECK_PORT IO_PORTC_04 // linein检测IO
|
||||
#define TCFG_LINEIN_PORT_UP_ENABLE 1 // 检测IO上拉使能
|
||||
#define TCFG_LINEIN_PORT_DOWN_ENABLE 0 // 检测IO下拉使能
|
||||
#define TCFG_LINEIN_AD_CHANNEL NO_CONFIG_PORT // 检测IO是否使用AD检测
|
||||
@ -833,7 +832,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
#if (RECORDER_MIX_EN)
|
||||
#define TCFG_LINEIN_INPUT_WAY LINEIN_INPUT_WAY_ADC//LINEIN_INPUT_WAY_ANALOG
|
||||
#else
|
||||
#define TCFG_LINEIN_INPUT_WAY LINEIN_INPUT_WAY_ANALOG
|
||||
#define TCFG_LINEIN_INPUT_WAY LINEIN_INPUT_WAY_ADC
|
||||
#endif/*RECORDER_MIX_EN*/
|
||||
#endif
|
||||
#define TCFG_LINEIN_MULTIPLEX_WITH_FM DISABLE // linein 脚与 FM 脚复用
|
||||
@ -845,8 +844,8 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
#define TCFG_DEC_G729_ENABLE ENABLE
|
||||
#define TCFG_DEC_MP3_ENABLE ENABLE
|
||||
#define TCFG_DEC_WMA_ENABLE ENABLE
|
||||
#define TCFG_DEC_WAV_ENABLE ENABLE
|
||||
#define TCFG_DEC_WMA_ENABLE 1
|
||||
#define TCFG_DEC_WAV_ENABLE 0
|
||||
#define TCFG_DEC_FLAC_ENABLE DISABLE
|
||||
#define TCFG_DEC_APE_ENABLE DISABLE
|
||||
#define TCFG_DEC_M4A_ENABLE DISABLE
|
||||
@ -877,7 +876,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
|
||||
#define TCFG_FMIN_LADC_IDX 1 // linein使用的ladc通道,对应ladc_list
|
||||
#define TCFG_FMIN_LR_CH AUDIO_LIN1_LR
|
||||
#define TCFG_FM_INPUT_WAY LINEIN_INPUT_WAY_ANALOG
|
||||
#define TCFG_FM_INPUT_WAY LINEIN_INPUT_WAY_ADC
|
||||
|
||||
#if (TCFG_FM_INSIDE_ENABLE && TCFG_FM_ENABLE)
|
||||
#if ((RECORDER_MIX_EN && RECORDER_MIX_BT_PHONE_EN) || (TCFG_MIC_EFFECT_ENABLE) || (TCFG_USER_TWS_ENABLE))
|
||||
@ -974,9 +973,9 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
#define TCFG_ENC_CVSD_ENABLE ENABLE
|
||||
#define TCFG_ENC_MSBC_ENABLE ENABLE
|
||||
#define TCFG_ENC_MP3_ENABLE ENABLE
|
||||
#define TCFG_ENC_ADPCM_ENABLE ENABLE
|
||||
#define TCFG_ENC_SBC_ENABLE ENABLE
|
||||
#define TCFG_ENC_MP3_ENABLE 0
|
||||
#define TCFG_ENC_ADPCM_ENABLE 0
|
||||
#define TCFG_ENC_SBC_ENABLE 0
|
||||
#define TCFG_ENC_OPUS_ENABLE DISABLE
|
||||
#define TCFG_ENC_SPEEX_ENABLE DISABLE
|
||||
|
||||
|
@ -19,22 +19,22 @@ const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
#endif
|
||||
},
|
||||
[1] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_CALL_HANG_UP, KEY_NULL, KEY_NULL, KEY_CALL_LAST_NO, KEY_NULL
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_CALL_LAST_NO, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_PP, KEY_CALL_HANG_UP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_ENC_START, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[7] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
@ -55,28 +55,28 @@ const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
const u16 fm_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
//单击 //长按 //hold //抬起 //双击 //三击
|
||||
[0] = {
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_FM_SCAN_ALL_DOWN, KEY_NULL
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[1] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_FM_NEXT_STATION, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_FM_SCAN_ALL_DOWN, KEY_NULL
|
||||
KEY_FM_PREV_STATION, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_PP, KEY_FM_SCAN_ALL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_FM_PREV_STATION, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_ENC_START, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_FM_PREV_FREQ, KEY_FM_SCAN_UP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_FM_NEXT_STATION, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[7] = {
|
||||
KEY_FM_NEXT_FREQ, KEY_FM_SCAN_DOWN, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[8] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
@ -97,22 +97,22 @@ const u16 linein_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[1] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_VOL_UP, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_NULL, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_ENC_START, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_NULL, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[7] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
@ -133,28 +133,28 @@ const u16 linein_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
const u16 music_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
//单击 //长按 //hold //抬起 //双击 //三击
|
||||
[0] = {
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_MUSIC_PLAYE_REC_FOLDER_SWITCH, KEY_NULL
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[1] = {
|
||||
KEY_MUSIC_CHANGE_REPEAT, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_MUSIC_CHANGE_DEV, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_MUSIC_PLAYE_NEXT_FOLDER, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_MUSIC_PP, KEY_MUSIC_CHANGE_DEV, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_MUSIC_PLAYE_PREV_FOLDER, KEY_NULL, KEY_MUSIC_FR, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[7] = {
|
||||
KEY_MUSIC_PLAYE_REC_FOLDER_SWITCH, KEY_NULL, KEY_MUSIC_FF, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[8] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
@ -178,19 +178,19 @@ const u16 pc_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[7] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
|
@ -96,6 +96,24 @@ static void app_init()
|
||||
do_platform_initcall();
|
||||
|
||||
board_init();
|
||||
{
|
||||
//mute
|
||||
gpio_set_pull_down(IO_PORTA_04,0);
|
||||
gpio_set_pull_up(IO_PORTA_04,0);
|
||||
gpio_set_direction(IO_PORTA_04,0);
|
||||
gpio_set_output_value(IO_PORTA_04,1);
|
||||
//led
|
||||
gpio_set_pull_down(IO_PORTB_05,0);
|
||||
gpio_set_pull_up(IO_PORTB_05,0);
|
||||
gpio_set_direction(IO_PORTB_05,0);
|
||||
gpio_set_output_value(IO_PORTB_05,0);
|
||||
//pa mode
|
||||
gpio_set_pull_down(IO_PORTA_02,0);
|
||||
gpio_set_pull_up(IO_PORTA_02,0);
|
||||
gpio_set_direction(IO_PORTA_02,0);
|
||||
gpio_set_output_value(IO_PORTA_02,0);
|
||||
|
||||
}
|
||||
|
||||
do_initcall();
|
||||
|
||||
@ -164,6 +182,7 @@ static void app_init()
|
||||
/* clock_add_set(CHARGE_BOX_CLK); */
|
||||
chgbox_init_app();
|
||||
#endif
|
||||
gpio_set_output_value(IO_PORTB_05,1);
|
||||
}
|
||||
|
||||
static void app_task_handler(void *p)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#define CONFIG_DEBUG_LIB(x) (x & LIB_DEBUG)
|
||||
|
||||
#define CONFIG_DEBUG_ENABLE
|
||||
//#define CONFIG_DEBUG_ENABLE
|
||||
|
||||
#ifndef CONFIG_DEBUG_ENABLE
|
||||
//#define CONFIG_DEBUG_LITE_ENABLE //轻量级打印开关, 默认关闭
|
||||
@ -159,6 +159,8 @@
|
||||
#include "usb_common_def.h"
|
||||
|
||||
|
||||
#define CONFIG_TWS_COMMON_ADDR_SELECT 0xFF
|
||||
|
||||
#if TCFG_USER_TWS_ENABLE
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define _FM_SEVER__H_
|
||||
|
||||
|
||||
u8 fm_get_play_statue(void);
|
||||
void fm_volume_pp(void);//播放暂停
|
||||
void fm_scan_down();//半自动收台
|
||||
void fm_scan_up();//半自动收台
|
||||
|
@ -2,8 +2,8 @@
|
||||
1:
|
||||
|
||||
|
||||
|
||||
|
||||
.gpio_ram
|
||||
.LED_code
|
||||
|
||||
|
||||
.usr_timer_code
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,8 +17,8 @@
|
||||
#include "fm/fm_manage.h"
|
||||
#include "fm/fm_rw.h"
|
||||
|
||||
#define LOG_TAG_CONST APP_FM
|
||||
#define LOG_TAG "[APP_FM]"
|
||||
#define LOG_TAG_CONST APP_FM
|
||||
#define LOG_TAG "[APP_FM]"
|
||||
#define LOG_ERROR_ENABLE
|
||||
#define LOG_DEBUG_ENABLE
|
||||
#define LOG_INFO_ENABLE
|
||||
@ -29,19 +29,17 @@
|
||||
/*************************************************************
|
||||
此文件函数主要是fm模式按键处理和事件处理
|
||||
|
||||
void app_fm_task()
|
||||
void app_fm_task()
|
||||
fm模式主函数
|
||||
|
||||
static int fm_event_handler(struct sys_event *event)
|
||||
static int fm_event_handler(struct sys_event *event)
|
||||
fm系统事件所有处理入口
|
||||
|
||||
static void fm_app_unint(void)
|
||||
fm模式退出
|
||||
static void fm_app_unint(void)
|
||||
fm模式退出
|
||||
|
||||
**************************************************************/
|
||||
|
||||
|
||||
|
||||
#if TCFG_APP_FM_EN
|
||||
|
||||
static u8 fm_idle_flag = 1;
|
||||
@ -53,6 +51,54 @@ u8 *get_vm_spi_code_run_addr()
|
||||
return vm_spi_code_run_addr;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static u16 tm_led;
|
||||
static int t_cnt;
|
||||
static u8 led_flag;
|
||||
|
||||
|
||||
static void led_cb(void *priv)
|
||||
{
|
||||
|
||||
if (fm_get_play_statue() == 0)
|
||||
{
|
||||
t_cnt++;
|
||||
if (t_cnt > 1)
|
||||
{
|
||||
t_cnt = 0;
|
||||
if (led_flag == 1)
|
||||
{
|
||||
led_flag = 0;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
led_flag = 1;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
led_flag = 1;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
}
|
||||
|
||||
static void start_led(void)
|
||||
{
|
||||
if (tm_led)
|
||||
{
|
||||
sys_timer_del(tm_led);
|
||||
}
|
||||
|
||||
t_cnt = 0;
|
||||
led_flag = 1;
|
||||
tm_led = sys_timer_add(NULL, led_cb, 250);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
//*----------------------------------------------------------------------------*/
|
||||
/**@brief fm按键消息入口
|
||||
@param 无
|
||||
@ -67,51 +113,53 @@ static int fm_key_event_opr(struct sys_event *event)
|
||||
struct key_event *key = &event->u.key;
|
||||
|
||||
int key_event = event->u.key.event;
|
||||
int key_value = event->u.key.value;//
|
||||
int key_value = event->u.key.value; //
|
||||
|
||||
r_printf("key value:%d, event:%d \n", key->value, key->event);
|
||||
|
||||
#if (TCFG_SPI_LCD_ENABLE)
|
||||
extern int key_is_ui_takeover();
|
||||
if (key_is_ui_takeover()) {
|
||||
if (key_is_ui_takeover())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (key_event) {
|
||||
switch (key_event)
|
||||
{
|
||||
case KEY_TEST_DEMO_0:
|
||||
log_info("KEY_TEST_DEMO_0 = %d \n", key_value);
|
||||
app_task_put_key_msg(KEY_TEST_DEMO_1, 5678); //test demo
|
||||
app_task_put_key_msg(KEY_TEST_DEMO_1, 5678); // test demo
|
||||
break;
|
||||
case KEY_TEST_DEMO_1:
|
||||
log_info("KEY_TEST_DEMO_1 = %d \n", key_value); //test demo
|
||||
log_info("KEY_TEST_DEMO_1 = %d \n", key_value); // test demo
|
||||
break;
|
||||
|
||||
case KEY_MUSIC_PP://暂停播放
|
||||
case KEY_MUSIC_PP: // 暂停播放
|
||||
/* app_task_put_key_msg(KEY_TEST_DEMO_0,1234); //test demo// */
|
||||
fm_volume_pp();
|
||||
break;
|
||||
case KEY_FM_SCAN_ALL://全自动搜台
|
||||
case KEY_FM_SCAN_ALL_DOWN://全自动搜台
|
||||
case KEY_FM_SCAN_ALL_UP://全自动搜台
|
||||
case KEY_FM_SCAN_ALL: // 全自动搜台
|
||||
case KEY_FM_SCAN_ALL_DOWN: // 全自动搜台
|
||||
case KEY_FM_SCAN_ALL_UP: // 全自动搜台
|
||||
fm_scan_all();
|
||||
break;
|
||||
case KEY_FM_SCAN_DOWN:
|
||||
fm_scan_down();//半自动搜台
|
||||
case KEY_FM_SCAN_DOWN:
|
||||
fm_scan_down(); // 半自动搜台
|
||||
break;
|
||||
case KEY_FM_SCAN_UP:
|
||||
fm_scan_up();//半自动搜台
|
||||
case KEY_FM_SCAN_UP:
|
||||
fm_scan_up(); // 半自动搜台
|
||||
break;
|
||||
case KEY_FM_PREV_STATION://下一台
|
||||
case KEY_FM_PREV_STATION: // 下一台
|
||||
fm_prev_station();
|
||||
break;
|
||||
case KEY_FM_NEXT_STATION:
|
||||
case KEY_FM_NEXT_STATION:
|
||||
fm_next_station();
|
||||
break;
|
||||
case KEY_FM_PREV_FREQ://下一个频率
|
||||
case KEY_FM_PREV_FREQ: // 下一个频率
|
||||
fm_prev_freq();
|
||||
break;
|
||||
case KEY_FM_NEXT_FREQ:
|
||||
case KEY_FM_NEXT_FREQ:
|
||||
fm_next_freq();
|
||||
break;
|
||||
case KEY_VOL_UP:
|
||||
@ -138,8 +186,6 @@ static int fm_key_event_opr(struct sys_event *event)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//*----------------------------------------------------------------------------*/
|
||||
/**@brief fm 模式活跃状态 所有消息入口
|
||||
@param 无
|
||||
@ -151,16 +197,21 @@ static int fm_key_event_opr(struct sys_event *event)
|
||||
static int fm_event_handler(struct sys_event *event)
|
||||
{
|
||||
int err = 0;
|
||||
switch (event->type) {
|
||||
switch (event->type)
|
||||
{
|
||||
case SYS_KEY_EVENT:
|
||||
return fm_key_event_opr(event);
|
||||
break;
|
||||
|
||||
case SYS_DEVICE_EVENT:
|
||||
if ((u32)event->arg == DEVICE_EVENT_FROM_FM) {
|
||||
if (event->u.dev.event == DEVICE_EVENT_IN) {
|
||||
if ((u32)event->arg == DEVICE_EVENT_FROM_FM)
|
||||
{
|
||||
if (event->u.dev.event == DEVICE_EVENT_IN)
|
||||
{
|
||||
log_info("fm online \n");
|
||||
} else if (event->u.dev.event == DEVICE_EVENT_OUT) {
|
||||
}
|
||||
else if (event->u.dev.event == DEVICE_EVENT_OUT)
|
||||
{
|
||||
log_info("fm offline \n");
|
||||
app_task_switch_next();
|
||||
}
|
||||
@ -182,7 +233,7 @@ extern u8 __movable_region2_start[];
|
||||
extern u8 __movable_region3_start[];
|
||||
extern u8 __movable_region4_start[];
|
||||
extern u8 __fm_overlay_movable_saddr[];
|
||||
static u32 *start_of_region_fm = NULL; // 记录当前代码所在区域的起始地址
|
||||
static u32 *start_of_region_fm = NULL; // 记录当前代码所在区域的起始地址
|
||||
static u32 *start_of_region_spi = NULL; // 记录当前代码所在区域的起始地址
|
||||
|
||||
static void fm_app_init(void)
|
||||
@ -191,14 +242,16 @@ static void fm_app_init(void)
|
||||
int code_size = __movable_region2_start - __movable_region_start;
|
||||
printf("code_size:%d\n", code_size);
|
||||
mem_stats();
|
||||
if (code_size && fm_code_run_addr == NULL) {
|
||||
if (code_size && fm_code_run_addr == NULL)
|
||||
{
|
||||
#if TCFG_CODE_RUN_OVERLAY_FM_MODE
|
||||
fm_code_run_addr = __fm_overlay_movable_saddr;
|
||||
#else
|
||||
fm_code_run_addr = phy_malloc(code_size);
|
||||
#endif
|
||||
}
|
||||
if (fm_code_run_addr) {
|
||||
if (fm_code_run_addr)
|
||||
{
|
||||
printf("fm_code_run_addr:0x%x", fm_code_run_addr);
|
||||
code_movable_load(__movable_region_start, code_size, fm_code_run_addr, __app_movable_slot_start, __app_movable_slot2_start, &start_of_region_fm);
|
||||
mem_stats();
|
||||
@ -208,10 +261,12 @@ static void fm_app_init(void)
|
||||
#if TCFG_VM_SPI_CODE_AT_RAM_DYANMIC
|
||||
int code_size1 = __movable_region4_start - __movable_region3_start;
|
||||
printf("code_size1:%d\n", code_size1);
|
||||
if (code_size1 && vm_spi_code_run_addr == NULL) {
|
||||
if (code_size1 && vm_spi_code_run_addr == NULL)
|
||||
{
|
||||
vm_spi_code_run_addr = phy_malloc(code_size1);
|
||||
}
|
||||
if (vm_spi_code_run_addr) {
|
||||
if (vm_spi_code_run_addr)
|
||||
{
|
||||
printf("vm_spi_code_run_addr:0x%x", vm_spi_code_run_addr);
|
||||
code_movable_load(__movable_region3_start, code_size1, vm_spi_code_run_addr, __app_movable_slot3_start, __app_movable_slot4_start, &start_of_region_spi);
|
||||
}
|
||||
@ -220,14 +275,13 @@ static void fm_app_init(void)
|
||||
sys_key_event_enable();
|
||||
ui_update_status(STATUS_FM_MODE);
|
||||
clock_idle(FM_IDLE_CLOCK);
|
||||
fm_manage_init();//
|
||||
fm_api_init();//设置频率信息
|
||||
fm_manage_init(); //
|
||||
fm_api_init(); // 设置频率信息
|
||||
}
|
||||
|
||||
|
||||
static void fm_app_start(void)
|
||||
{
|
||||
fm_manage_start();//收音出声
|
||||
fm_manage_start(); // 收音出声
|
||||
}
|
||||
|
||||
static void fm_app_uninit(void)
|
||||
@ -238,7 +292,8 @@ static void fm_app_uninit(void)
|
||||
tone_play_stop_by_path(tone_table[IDEX_TONE_FM]);
|
||||
fm_idle_flag = 1;
|
||||
#if TCFG_CODE_RUN_RAM_FM_MODE
|
||||
if (fm_code_run_addr) {
|
||||
if (fm_code_run_addr)
|
||||
{
|
||||
mem_stats();
|
||||
code_movable_unload(__movable_region_start, __app_movable_slot_start, __app_movable_slot2_start, &start_of_region_fm);
|
||||
#if (!TCFG_CODE_RUN_OVERLAY_FM_MODE)
|
||||
@ -250,7 +305,8 @@ static void fm_app_uninit(void)
|
||||
#endif
|
||||
|
||||
#if TCFG_VM_SPI_CODE_AT_RAM_DYANMIC
|
||||
if (vm_spi_code_run_addr) {
|
||||
if (vm_spi_code_run_addr)
|
||||
{
|
||||
code_movable_unload(__movable_region3_start, __app_movable_slot3_start, __app_movable_slot4_start, &start_of_region_spi);
|
||||
phy_free(vm_spi_code_run_addr);
|
||||
vm_spi_code_run_addr = NULL;
|
||||
@ -258,19 +314,20 @@ static void fm_app_uninit(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void fm_tone_play_end_callback(void *priv, int flag)
|
||||
static void fm_tone_play_end_callback(void *priv, int flag)
|
||||
{
|
||||
u32 index = (u32)priv;
|
||||
|
||||
if (APP_FM_TASK != app_get_curr_task()) {
|
||||
if (APP_FM_TASK != app_get_curr_task())
|
||||
{
|
||||
log_error("tone callback task out \n");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (index) {
|
||||
switch (index)
|
||||
{
|
||||
case IDEX_TONE_FM:
|
||||
///提示音播放结束, 启动播放器播放
|
||||
/// 提示音播放结束, 启动播放器播放
|
||||
fm_app_start();
|
||||
break;
|
||||
default:
|
||||
@ -290,10 +347,12 @@ int fm_close_bt()
|
||||
{
|
||||
int flag;
|
||||
int msg[32];
|
||||
//fm和蓝牙共用模拟,后台时需要进入的时候关闭蓝牙
|
||||
|
||||
// fm和蓝牙共用模拟,后台时需要进入的时候关闭蓝牙
|
||||
flag = bt_background_close_bt_hardward(1);
|
||||
if (flag != 0) {
|
||||
//搞个消息获取驱动sys timer的执行
|
||||
if (flag != 0)
|
||||
{
|
||||
// 搞个消息获取驱动sys timer的执行
|
||||
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
||||
}
|
||||
return flag;
|
||||
@ -306,37 +365,53 @@ void app_fm_task()
|
||||
if (fm_close_bt() != 0) {
|
||||
return;
|
||||
}*/
|
||||
// PA mode set to class AB
|
||||
gpio_set_pull_down(IO_PORTA_02, 0);
|
||||
gpio_set_pull_up(IO_PORTA_02, 0);
|
||||
gpio_set_direction(IO_PORTA_02, 0);
|
||||
gpio_set_output_value(IO_PORTA_02, 1);
|
||||
fm_app_init();
|
||||
#if TCFG_DEC2TWS_ENABLE
|
||||
extern void set_tws_background_connected_flag(u8 flag);
|
||||
extern u8 get_tws_background_connected_flag();
|
||||
if (get_tws_background_connected_flag()) { //不播放提示音
|
||||
if (get_tws_background_connected_flag())
|
||||
{ // 不播放提示音
|
||||
fm_app_start();
|
||||
set_tws_background_connected_flag(0);
|
||||
} else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
tone_play_with_callback_by_name(tone_table[IDEX_TONE_FM], 1, fm_tone_play_end_callback, (void *)IDEX_TONE_FM);
|
||||
}
|
||||
// if (err) {
|
||||
// ///提示音播放失败,直接启动播放
|
||||
// fm_app_start();
|
||||
// }
|
||||
// if (err) {
|
||||
// ///提示音播放失败,直接启动播放
|
||||
// fm_app_start();
|
||||
// }
|
||||
|
||||
while (1) {
|
||||
start_led();
|
||||
|
||||
while (1)
|
||||
{
|
||||
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
||||
|
||||
switch (msg[0]) {
|
||||
switch (msg[0])
|
||||
{
|
||||
case APP_MSG_SYS_EVENT:
|
||||
if (fm_event_handler((struct sys_event *)(&msg[1])) == false) {
|
||||
app_default_event_deal((struct sys_event *)(&msg[1])); //由common统一处理
|
||||
if (fm_event_handler((struct sys_event *)(&msg[1])) == false)
|
||||
{
|
||||
app_default_event_deal((struct sys_event *)(&msg[1])); // 由common统一处理
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (app_task_exitting()) {
|
||||
if (app_task_exitting())
|
||||
{
|
||||
sys_timer_del(tm_led);
|
||||
gpio_set_output_value(IO_PORTB_05, 1);
|
||||
|
||||
fm_app_uninit();
|
||||
return;
|
||||
}
|
||||
@ -354,13 +429,8 @@ REGISTER_LP_TARGET(fm_lp_target) = {
|
||||
|
||||
#else
|
||||
|
||||
|
||||
void app_fm_task()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -418,6 +418,11 @@ void fm_scan_all()
|
||||
sys_timeout_add(NULL, __fm_scan_all, 20);
|
||||
}
|
||||
|
||||
u8 fm_get_play_statue(void)
|
||||
{
|
||||
return __this->fm_dev_mute;
|
||||
|
||||
}
|
||||
void fm_volume_pp(void)
|
||||
{
|
||||
log_info("KEY_MUSIC_PP\n");
|
||||
|
@ -67,7 +67,53 @@
|
||||
static u8 linein_last_onoff = (u8) - 1;
|
||||
static u8 linein_bt_back_flag = 0;
|
||||
static u8 linein_idle_flag = 1;
|
||||
//-----------------------------------------------------------------------------
|
||||
static u16 tm_led;
|
||||
static int t_cnt;
|
||||
static u8 led_flag;
|
||||
|
||||
|
||||
static void led_cb(void *priv)
|
||||
{
|
||||
|
||||
if (linein_get_status() == 1)
|
||||
{
|
||||
t_cnt++;
|
||||
if (t_cnt > 1)
|
||||
{
|
||||
t_cnt = 0;
|
||||
if (led_flag == 1)
|
||||
{
|
||||
led_flag = 0;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
led_flag = 1;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
led_flag = 1;
|
||||
gpio_set_output_value(IO_PORTB_05, led_flag);
|
||||
}
|
||||
}
|
||||
|
||||
static void start_led(void)
|
||||
{
|
||||
if (tm_led)
|
||||
{
|
||||
sys_timer_del(tm_led);
|
||||
}
|
||||
|
||||
t_cnt = 0;
|
||||
led_flag = 1;
|
||||
tm_led = sys_timer_add(NULL, led_cb, 250);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
///*----------------------------------------------------------------------------*/
|
||||
/**@brief 当前出于非linein 模式时候linein的在common消息处理
|
||||
@param 无
|
||||
@ -296,6 +342,14 @@ void app_linein_task()
|
||||
int err = 0;
|
||||
int msg[32];
|
||||
|
||||
|
||||
|
||||
// PA mode set to class D
|
||||
gpio_set_pull_down(IO_PORTA_02, 0);
|
||||
gpio_set_pull_up(IO_PORTA_02, 0);
|
||||
gpio_set_direction(IO_PORTA_02, 0);
|
||||
gpio_set_output_value(IO_PORTA_02,0);
|
||||
|
||||
#if TCFG_APP_BT_EN
|
||||
linein_bt_back_flag = get_bt_back_flag();//从蓝牙后台返回标志
|
||||
set_bt_back_flag(0);
|
||||
@ -323,6 +377,7 @@ void app_linein_task()
|
||||
// ///提示音播放失败,直接推送KEY_MUSIC_PLAYER_START启动播放
|
||||
// app_task_put_key_msg(KEY_LINEIN_START, 0);
|
||||
// }
|
||||
start_led();
|
||||
|
||||
while (1) {
|
||||
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
||||
@ -338,6 +393,8 @@ void app_linein_task()
|
||||
}
|
||||
|
||||
if (app_task_exitting()) {
|
||||
sys_timer_del(tm_led);
|
||||
gpio_set_output_value(IO_PORTB_05, 1);
|
||||
linein_task_close();
|
||||
return;
|
||||
}
|
||||
|
@ -277,6 +277,8 @@ void linein_stop(void)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
int linein_volume_pp(void)
|
||||
{
|
||||
if (__this->onoff) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -132,9 +132,9 @@ void app_poweron_task()
|
||||
|
||||
UI_SHOW_MENU(MENU_POWER_UP, 0, 0, NULL);
|
||||
|
||||
int err = tone_play_with_callback_by_name(tone_table[IDEX_TONE_POWER_ON], 1, tone_play_end_callback, (void *)IDEX_TONE_POWER_ON);
|
||||
//int err = tone_play_with_callback_by_name(tone_table[IDEX_TONE_POWER_ON], 1, tone_play_end_callback, (void *)IDEX_TONE_POWER_ON);
|
||||
/* if (err) { //提示音没有,播放失败,直接init流程 */
|
||||
/* power_on_init(); */
|
||||
power_on_init(); /* */
|
||||
/* } */
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
||||
*/
|
||||
#if (TCFG_AUDIO_DAC_CONNECT_MODE == DAC_OUTPUT_MONO_LR_DIFF || \
|
||||
TCFG_AUDIO_DAC_CONNECT_MODE == DAC_OUTPUT_DUAL_LR_DIFF)
|
||||
#define MAX_ANA_VOL (21)
|
||||
#define MAX_ANA_VOL (28)
|
||||
#else
|
||||
#define MAX_ANA_VOL (30)
|
||||
#endif/*TCFG_AUDIO_DAC_CONNECT_MODE*/
|
||||
@ -113,8 +113,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define SYS_DEFAULT_VOL 0//(SYS_MAX_VOL/2)
|
||||
#define SYS_DEFAULT_TONE_VOL 10//(SYS_MAX_VOL)
|
||||
#define SYS_DEFAULT_VOL SYS_MAX_VOL/2 //(SYS_MAX_VOL/2)
|
||||
#define SYS_DEFAULT_TONE_VOL 18//(SYS_MAX_VOL)
|
||||
#define SYS_DEFAULT_SIN_VOL 17
|
||||
|
||||
#define APP_AUDIO_STATE_IDLE 0
|
||||
|
@ -946,7 +946,16 @@ REGISTER_LP_TARGET(audio_dec_init_lp_target) = {
|
||||
|
||||
void audio_mix_out_automute_mute(u8 mute)
|
||||
{
|
||||
printf(">>>>>>>>>>>>>>>>>>>> %s\n", mute ? ("MUTE") : ("UNMUTE"));
|
||||
//printf(">>>>>>>>>>>>>>>>>>>> %s\n", mute ? ("MUTE") : ("UNMUTE"));
|
||||
if (mute)
|
||||
{
|
||||
gpio_set_output_value(IO_PORTA_04,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_set_output_value(IO_PORTA_04,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* #define AUDIO_E_DET_UNMUTE (0x00) */
|
||||
|
@ -37,22 +37,8 @@ mp3_decoder
|
||||
|
||||
wma_decoder
|
||||
g729_decoder
|
||||
wav_decoder
|
||||
cvsd_encoder
|
||||
|
||||
|
||||
|
||||
msbc_encoder
|
||||
|
||||
|
||||
|
||||
mp3_encoder
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
adpcm_encoder
|
||||
sbc_encoder
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
1
cpu/br25/tools/soundbox/standard/KTS_AC690x_5458.key
Normal file
1
cpu/br25/tools/soundbox/standard/KTS_AC690x_5458.key
Normal file
@ -0,0 +1 @@
|
||||
44b10a8a9a97a7ea8795ce48fe8bb180954fc20c5763ded5954fc20c5763ded5399f4f1d
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -7,13 +7,13 @@ copy ..\..\uboot.boot .
|
||||
copy ..\..\ota.bin .
|
||||
copy ..\..\eq_cfg_hw.bin .
|
||||
|
||||
..\..\isd_download.exe -tonorflash -dev br25 -boot 0x12000 -div8 -wait 300 -uboot uboot.boot -app app.bin -res tone.cfg cfg_tool.bin eq_cfg_hw.bin -uboot_compress
|
||||
..\..\isd_download.exe -tonorflash -dev br25 -boot 0x12000 -div8 -wait 300 -uboot uboot.boot -app app.bin -res tone.cfg cfg_tool.bin eq_cfg_hw.bin -uboot_compress -key KTS_AC690x_5458.key
|
||||
:: -format all
|
||||
::-reboot 2500
|
||||
|
||||
|
||||
|
||||
@rem 删除临时文件-format all
|
||||
@rem ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ļ<EFBFBD>-format all
|
||||
if exist *.mp3 del *.mp3
|
||||
if exist *.PIX del *.PIX
|
||||
if exist *.TAB del *.TAB
|
||||
@ -26,16 +26,16 @@ copy jl_isd.ufw update.ufw
|
||||
del jl_isd.ufw
|
||||
|
||||
|
||||
@REM 生成配置文件升级文件
|
||||
@REM <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
::ufw_maker.exe -chip AC800X %ADD_KEY% -output config.ufw -res bt_cfg.cfg
|
||||
|
||||
::IF EXIST jl_696x.bin del jl_696x.bin
|
||||
|
||||
|
||||
@rem 常用命令说明
|
||||
@rem -format vm //擦除VM 区域
|
||||
@rem -format cfg //擦除BT CFG 区域
|
||||
@rem -format 0x3f0-2 //表示从第 0x3f0 个 sector 开始连续擦除 2 个 sector(第一个参数为16进制或10进制都可,第二个参数必须是10进制)
|
||||
@rem <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
||||
@rem -format vm //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VM <20><><EFBFBD><EFBFBD>
|
||||
@rem -format cfg //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>BT CFG <20><><EFBFBD><EFBFBD>
|
||||
@rem -format 0x3f0-2 //<EFBFBD><EFBFBD>ʾ<EFBFBD>ӵ<EFBFBD> 0x3f0 <20><> sector <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 <20><> sector(<28><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ16<31><36><EFBFBD>ƻ<EFBFBD>10<31><30><EFBFBD>ƶ<EFBFBD><C6B6>ɣ<EFBFBD><C9A3>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10<31><30><EFBFBD><EFBFBD>)
|
||||
|
||||
ping /n 2 127.1>null
|
||||
IF EXIST null del null
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard/extra_tones/tf.wtg
Normal file
BIN
cpu/br25/tools/soundbox/standard/extra_tones/tf.wtg
Normal file
Binary file not shown.
BIN
cpu/br25/tools/soundbox/standard/extra_tones/usb.wtg
Normal file
BIN
cpu/br25/tools/soundbox/standard/extra_tones/usb.wtg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
BIN
tone/bt.mp3
Normal file
BIN
tone/bt.mp3
Normal file
Binary file not shown.
BIN
tone/bt.wtg
Normal file
BIN
tone/bt.wtg
Normal file
Binary file not shown.
BIN
tone/connect.mp3
Normal file
BIN
tone/connect.mp3
Normal file
Binary file not shown.
BIN
tone/connect.wtg
Normal file
BIN
tone/connect.wtg
Normal file
Binary file not shown.
BIN
tone/disconnect.mp3
Normal file
BIN
tone/disconnect.mp3
Normal file
Binary file not shown.
BIN
tone/disconnect.wtg
Normal file
BIN
tone/disconnect.wtg
Normal file
Binary file not shown.
BIN
tone/linein.mp3
Normal file
BIN
tone/linein.mp3
Normal file
Binary file not shown.
BIN
tone/linein.wtg
Normal file
BIN
tone/linein.wtg
Normal file
Binary file not shown.
BIN
tone/low_power.mp3
Normal file
BIN
tone/low_power.mp3
Normal file
Binary file not shown.
BIN
tone/low_power.wtg
Normal file
BIN
tone/low_power.wtg
Normal file
Binary file not shown.
BIN
tone/pwr_off.mp3
Normal file
BIN
tone/pwr_off.mp3
Normal file
Binary file not shown.
BIN
tone/pwr_off.wtg
Normal file
BIN
tone/pwr_off.wtg
Normal file
Binary file not shown.
BIN
tone/radio.mp3
Normal file
BIN
tone/radio.mp3
Normal file
Binary file not shown.
BIN
tone/radio.wtg
Normal file
BIN
tone/radio.wtg
Normal file
Binary file not shown.
BIN
tone/tf.mp3
Normal file
BIN
tone/tf.mp3
Normal file
Binary file not shown.
BIN
tone/tf.wtg
Normal file
BIN
tone/tf.wtg
Normal file
Binary file not shown.
BIN
tone/usb.mp3
Normal file
BIN
tone/usb.mp3
Normal file
Binary file not shown.
BIN
tone/usb.wtg
Normal file
BIN
tone/usb.wtg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user