完成功能,等待测试
This commit is contained in:
parent
d428b715b0
commit
a1a4fb183b
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"board_ac695x_demo_cfg.h": "c"
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,130 @@
|
||||
#include "kt.h"
|
||||
#include "key_event_deal.h"
|
||||
#include "music_player.h"
|
||||
|
||||
enum {
|
||||
KT_LED_IDLE = 0, /* 空闲慢闪 */
|
||||
KT_LED_PLAY, /* 播放常亮 */
|
||||
KT_LED_FAIL, /* 播放失败快闪 */
|
||||
};
|
||||
|
||||
/* 定时器 50ms:慢闪 1s灭/1s亮,快闪 100ms灭/100ms亮 */
|
||||
#define KT_LED_SLOW_HALF 20
|
||||
#define KT_LED_FAST_HALF 2
|
||||
|
||||
typedef struct _kt_var_ {
|
||||
int kt_timer;
|
||||
int t_cnt;
|
||||
u8 led_mode;
|
||||
u8 active_ch; /* 1~6, 0=无按键播放会话 */
|
||||
} _kt_var;
|
||||
|
||||
static _kt_var kt_var;
|
||||
#define __this (&kt_var)
|
||||
|
||||
static const char *const kt_file_tab[6] = {
|
||||
"/01.mp3", "/02.mp3", "/03.mp3", "/04.mp3", "/05.mp3", "/06.mp3",
|
||||
};
|
||||
|
||||
static void kt_led_set_mode(u8 mode)
|
||||
{
|
||||
__this->led_mode = mode;
|
||||
__this->t_cnt = 0;
|
||||
if (mode == KT_LED_PLAY) {
|
||||
BT_LED_ON();
|
||||
}
|
||||
}
|
||||
|
||||
static void kt_audio_all_off(void)
|
||||
{
|
||||
AUDIO_OUT_CH1_OFF();
|
||||
AUDIO_OUT_CH2_OFF();
|
||||
AUDIO_OUT_CH3_OFF();
|
||||
AUDIO_OUT_CH4_OFF();
|
||||
}
|
||||
|
||||
static void kt_channel_outputs_off(u8 ch)
|
||||
{
|
||||
switch (ch) {
|
||||
case 1:
|
||||
AUDIO_OUT_CH1_OFF();
|
||||
VOLTAGE_OUT_CH1_OFF();
|
||||
VLED_OUT_CH1_OFF();
|
||||
break;
|
||||
case 2:
|
||||
AUDIO_OUT_CH2_OFF();
|
||||
VOLTAGE_OUT_CH2_OFF();
|
||||
VLED_OUT_CH2_OFF();
|
||||
break;
|
||||
case 3:
|
||||
AUDIO_OUT_CH3_OFF();
|
||||
VOLTAGE_OUT_CH3_OFF();
|
||||
VLED_OUT_CH3_OFF();
|
||||
break;
|
||||
case 4:
|
||||
AUDIO_OUT_CH4_OFF();
|
||||
VOLTAGE_OUT_CH4_OFF();
|
||||
VLED_OUT_CH4_OFF();
|
||||
break;
|
||||
case 5:
|
||||
VLED_OUT_CH5_OFF();
|
||||
break;
|
||||
case 6:
|
||||
VLED_OUT_CH6_OFF();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void kt_channel_outputs_on(u8 ch)
|
||||
{
|
||||
/* 音频通道互斥:先全关再开对应通道(仅 1~4 有音频/电压脚) */
|
||||
kt_audio_all_off();
|
||||
VOLTAGE_OUT_CH1_OFF();
|
||||
VOLTAGE_OUT_CH2_OFF();
|
||||
VOLTAGE_OUT_CH3_OFF();
|
||||
VOLTAGE_OUT_CH4_OFF();
|
||||
VLED_OUT_CH1_OFF();
|
||||
VLED_OUT_CH2_OFF();
|
||||
VLED_OUT_CH3_OFF();
|
||||
VLED_OUT_CH4_OFF();
|
||||
VLED_OUT_CH5_OFF();
|
||||
VLED_OUT_CH6_OFF();
|
||||
|
||||
switch (ch) {
|
||||
case 1:
|
||||
AUDIO_OUT_CH1_ON();
|
||||
VOLTAGE_OUT_CH1_ON();
|
||||
VLED_OUT_CH1_ON();
|
||||
break;
|
||||
case 2:
|
||||
AUDIO_OUT_CH2_ON();
|
||||
VOLTAGE_OUT_CH2_ON();
|
||||
VLED_OUT_CH2_ON();
|
||||
break;
|
||||
case 3:
|
||||
AUDIO_OUT_CH3_ON();
|
||||
VOLTAGE_OUT_CH3_ON();
|
||||
VLED_OUT_CH3_ON();
|
||||
break;
|
||||
case 4:
|
||||
AUDIO_OUT_CH4_ON();
|
||||
VOLTAGE_OUT_CH4_ON();
|
||||
VLED_OUT_CH4_ON();
|
||||
break;
|
||||
case 5:
|
||||
/* 硬件无 AUDIO/VOLTAGE 通道5,仅 VLED */
|
||||
VLED_OUT_CH5_ON();
|
||||
break;
|
||||
case 6:
|
||||
/* 硬件无 AUDIO/VOLTAGE 通道6,仅 VLED */
|
||||
VLED_OUT_CH6_ON();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void kt_boot_init(void)
|
||||
{
|
||||
@ -21,40 +146,177 @@ void kt_boot_init(void)
|
||||
gpio_set_die(IO_PORTA_05,1);
|
||||
|
||||
//CS8406 TX EN
|
||||
//ch1
|
||||
gpio_set_pull_down(IO_PORTB_07,0);
|
||||
gpio_set_pull_up(IO_PORTB_07,0);
|
||||
gpio_set_direction(IO_PORTB_07,0);
|
||||
gpio_set_output_value(IO_PORTB_07,0);
|
||||
//ch2
|
||||
gpio_set_pull_down(IO_PORTB_08,0);
|
||||
gpio_set_pull_up(IO_PORTB_08,0);
|
||||
gpio_set_direction(IO_PORTB_08,0);
|
||||
gpio_set_output_value(IO_PORTB_08,0);
|
||||
//ch3
|
||||
gpio_set_pull_down(IO_PORTB_09,0);
|
||||
gpio_set_pull_up(IO_PORTB_09,0);
|
||||
gpio_set_direction(IO_PORTB_09,0);
|
||||
gpio_set_output_value(IO_PORTB_09,0);
|
||||
//ch4
|
||||
gpio_set_pull_down(IO_PORTB_10,0);
|
||||
gpio_set_pull_up(IO_PORTB_10,0);
|
||||
gpio_set_direction(IO_PORTB_10,0);
|
||||
gpio_set_output_value(IO_PORTB_10,0);
|
||||
|
||||
//earphone enable
|
||||
//ch1
|
||||
|
||||
gpio_set_pull_down(AUDIO_OUT_CHANNEL1,0);
|
||||
gpio_set_pull_up(AUDIO_OUT_CHANNEL1,0);
|
||||
gpio_set_direction(AUDIO_OUT_CHANNEL1,0);
|
||||
gpio_set_output_value(AUDIO_OUT_CHANNEL1,0);
|
||||
|
||||
gpio_set_pull_down(AUDIO_OUT_CHANNEL2,0);
|
||||
gpio_set_pull_up(AUDIO_OUT_CHANNEL2,0);
|
||||
gpio_set_direction(AUDIO_OUT_CHANNEL2,0);
|
||||
gpio_set_output_value(AUDIO_OUT_CHANNEL2,0);
|
||||
|
||||
gpio_set_pull_down(AUDIO_OUT_CHANNEL3,0);
|
||||
gpio_set_pull_up(AUDIO_OUT_CHANNEL3,0);
|
||||
gpio_set_direction(AUDIO_OUT_CHANNEL3,0);
|
||||
gpio_set_output_value(AUDIO_OUT_CHANNEL3,0);
|
||||
|
||||
gpio_set_pull_down(AUDIO_OUT_CHANNEL4,0);
|
||||
gpio_set_pull_up(AUDIO_OUT_CHANNEL4,0);
|
||||
gpio_set_direction(AUDIO_OUT_CHANNEL4,0);
|
||||
gpio_set_output_value(AUDIO_OUT_CHANNEL4,0);
|
||||
|
||||
//voltage output
|
||||
gpio_set_pull_down(VOLTAGE_OUT_CHANNEL1,0);
|
||||
gpio_set_pull_up(VOLTAGE_OUT_CHANNEL1,0);
|
||||
gpio_set_direction(VOLTAGE_OUT_CHANNEL1,0);
|
||||
gpio_set_output_value(VOLTAGE_OUT_CHANNEL1,0);
|
||||
|
||||
gpio_set_pull_down(VOLTAGE_OUT_CHANNEL2,0);
|
||||
gpio_set_pull_up(VOLTAGE_OUT_CHANNEL2,0);
|
||||
gpio_set_direction(VOLTAGE_OUT_CHANNEL2,0);
|
||||
gpio_set_output_value(VOLTAGE_OUT_CHANNEL2,0);
|
||||
|
||||
gpio_set_pull_down(VOLTAGE_OUT_CHANNEL3,0);
|
||||
gpio_set_pull_up(VOLTAGE_OUT_CHANNEL3,0);
|
||||
gpio_set_direction(VOLTAGE_OUT_CHANNEL3,0);
|
||||
gpio_set_output_value(VOLTAGE_OUT_CHANNEL3,0);
|
||||
|
||||
gpio_set_pull_down(VOLTAGE_OUT_CHANNEL4,0);
|
||||
gpio_set_pull_up(VOLTAGE_OUT_CHANNEL4,0);
|
||||
gpio_set_direction(VOLTAGE_OUT_CHANNEL4,0);
|
||||
gpio_set_output_value(VOLTAGE_OUT_CHANNEL4,0);
|
||||
|
||||
//vled output
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL1,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL1,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL1,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL1,0);
|
||||
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL2,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL2,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL2,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL2,0);
|
||||
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL3,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL3,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL3,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL3,0);
|
||||
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL4,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL4,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL4,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL4,0);
|
||||
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL5,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL5,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL5,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL5,0);
|
||||
|
||||
gpio_set_pull_down(VLED_OUT_CHANNEL6,0);
|
||||
gpio_set_pull_up(VLED_OUT_CHANNEL6,0);
|
||||
gpio_set_direction(VLED_OUT_CHANNEL6,0);
|
||||
gpio_set_output_value(VLED_OUT_CHANNEL6,0);
|
||||
|
||||
//bt led
|
||||
gpio_set_pull_down(BT_LED_PIN,0);
|
||||
gpio_set_pull_up(BT_LED_PIN,0);
|
||||
gpio_set_direction(BT_LED_PIN,0);
|
||||
gpio_set_output_value(BT_LED_PIN,0);
|
||||
}
|
||||
|
||||
static void timer_cb(void *priv)
|
||||
{
|
||||
u8 half;
|
||||
|
||||
if (__this->led_mode == KT_LED_PLAY) {
|
||||
BT_LED_ON();
|
||||
return;
|
||||
}
|
||||
|
||||
half = (__this->led_mode == KT_LED_FAIL) ? KT_LED_FAST_HALF : KT_LED_SLOW_HALF;
|
||||
__this->t_cnt++;
|
||||
if (__this->t_cnt <= half) {
|
||||
BT_LED_OFF();
|
||||
} else if (__this->t_cnt <= (half * 2)) {
|
||||
BT_LED_ON();
|
||||
} else {
|
||||
__this->t_cnt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void start_time_base(u32 time_base_ms)
|
||||
{
|
||||
if (__this->kt_timer) {
|
||||
sys_timer_del(__this->kt_timer);
|
||||
}
|
||||
__this->t_cnt = 0;
|
||||
__this->kt_timer = sys_timer_add(NULL, timer_cb, time_base_ms);
|
||||
}
|
||||
|
||||
void kt_init(void)
|
||||
{
|
||||
__this->active_ch = 0;
|
||||
kt_led_set_mode(KT_LED_IDLE);
|
||||
//CS8406 RST
|
||||
gpio_set_output_value(IO_PORTA_06,1);
|
||||
gpio_set_output_value(IO_PORTA_06, 1);
|
||||
/* 默认关闭各音频通道,按键播放时再打开对应通道 */
|
||||
kt_audio_all_off();
|
||||
start_time_base(50);
|
||||
}
|
||||
|
||||
//CS8406 TX EN
|
||||
gpio_set_output_value(IO_PORTB_07,1);
|
||||
gpio_set_output_value(IO_PORTB_08,1);
|
||||
gpio_set_output_value(IO_PORTB_09,1);
|
||||
gpio_set_output_value(IO_PORTB_10,1);
|
||||
}
|
||||
/* 播放结束/出错/拔卡:关闭对应输出,返回1表示是按键播放会话 */
|
||||
int kt_music_play_end_handler(void)
|
||||
{
|
||||
if (__this->active_ch == 0) {
|
||||
return 0;
|
||||
}
|
||||
printf("kt_music_play_end_handler ch=%d\n", __this->active_ch);
|
||||
kt_channel_outputs_off(__this->active_ch);
|
||||
__this->active_ch = 0;
|
||||
kt_led_set_mode(KT_LED_IDLE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* 优先 sd1/0x.mp3,其次 udisk0/0x.mp3;
|
||||
* 成功则打开对应音频/电压/VLED,失败不做任何反应;
|
||||
* 播完由 kt_music_play_end_handler 关闭输出。
|
||||
*/
|
||||
int kt_key_event_handler(u16 key)
|
||||
{
|
||||
u8 ch;
|
||||
int err;
|
||||
const char *path;
|
||||
|
||||
if (key < KEY_USER_KEY_1 || key > KEY_USER_KEY_6) {
|
||||
return MUSIC_PLAYER_ERR_NULL;
|
||||
}
|
||||
|
||||
ch = (u8)(key - KEY_USER_KEY_1 + 1);
|
||||
path = kt_file_tab[ch - 1];
|
||||
printf("kt_key_event_handler key=%d ch=%d path=%s\n", key, ch, path);
|
||||
|
||||
/* 若上一首按键播放未结束,先关掉上一通道输出 */
|
||||
if (__this->active_ch) {
|
||||
kt_channel_outputs_off(__this->active_ch);
|
||||
__this->active_ch = 0;
|
||||
}
|
||||
|
||||
err = music_player_play_by_path((char *)"sd1", path);
|
||||
if (err != MUSIC_PLAYER_SUCC) {
|
||||
err = music_player_play_by_path((char *)"udisk0", path);
|
||||
}
|
||||
|
||||
if (err == MUSIC_PLAYER_SUCC) {
|
||||
kt_channel_outputs_on(ch);
|
||||
__this->active_ch = ch;
|
||||
kt_led_set_mode(KT_LED_PLAY);
|
||||
return MUSIC_PLAYER_SUCC;
|
||||
}
|
||||
|
||||
/* 播放失败:通道不动作,BT_LED 快闪 */
|
||||
printf("kt play fail ch=%d err=%d\n", ch, err);
|
||||
kt_led_set_mode(KT_LED_FAIL);
|
||||
return MUSIC_PLAYER_ERR_NULL;
|
||||
}
|
||||
|
||||
@ -3,9 +3,65 @@
|
||||
|
||||
#include "system/includes.h"
|
||||
|
||||
#define BT_LED_PIN IO_PORTB_03
|
||||
#define BT_LED_ON() (gpio_set_output_value(BT_LED_PIN,1))
|
||||
#define BT_LED_OFF() (gpio_set_output_value(BT_LED_PIN,0))
|
||||
|
||||
#define AUDIO_OUT_CHANNEL1 IO_PORTB_07
|
||||
#define AUDIO_OUT_CHANNEL2 IO_PORTB_08
|
||||
#define AUDIO_OUT_CHANNEL3 IO_PORTB_09
|
||||
#define AUDIO_OUT_CHANNEL4 IO_PORTB_10
|
||||
|
||||
#define AUDIO_OUT_CH1_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL1,1))
|
||||
#define AUDIO_OUT_CH2_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL2,1))
|
||||
#define AUDIO_OUT_CH3_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL3,1))
|
||||
#define AUDIO_OUT_CH4_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL4,1))
|
||||
|
||||
#define AUDIO_OUT_CH1_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL1,0))
|
||||
#define AUDIO_OUT_CH2_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL2,0))
|
||||
#define AUDIO_OUT_CH3_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL3,0))
|
||||
#define AUDIO_OUT_CH4_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL4,0))
|
||||
|
||||
#define VOLTAGE_OUT_CHANNEL1 IO_PORTA_09
|
||||
#define VOLTAGE_OUT_CHANNEL2 IO_PORTA_10
|
||||
#define VOLTAGE_OUT_CHANNEL3 IO_PORTB_02
|
||||
#define VOLTAGE_OUT_CHANNEL4 IO_PORTB_11
|
||||
|
||||
#define VOLTAGE_OUT_CH1_ON() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL1,1))
|
||||
#define VOLTAGE_OUT_CH2_ON() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL2,1))
|
||||
#define VOLTAGE_OUT_CH3_ON() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL3,1))
|
||||
#define VOLTAGE_OUT_CH4_ON() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL4,1))
|
||||
|
||||
#define VOLTAGE_OUT_CH1_OFF() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL1,0))
|
||||
#define VOLTAGE_OUT_CH2_OFF() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL2,0))
|
||||
#define VOLTAGE_OUT_CH3_OFF() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL3,0))
|
||||
#define VOLTAGE_OUT_CH4_OFF() (gpio_set_output_value(VOLTAGE_OUT_CHANNEL4,0))
|
||||
|
||||
#define VLED_OUT_CHANNEL1 IO_PORTA_12
|
||||
#define VLED_OUT_CHANNEL2 IO_PORTC_00
|
||||
#define VLED_OUT_CHANNEL3 IO_PORTC_01
|
||||
#define VLED_OUT_CHANNEL4 IO_PORTC_02
|
||||
#define VLED_OUT_CHANNEL5 IO_PORTC_03
|
||||
#define VLED_OUT_CHANNEL6 IO_PORTB_00
|
||||
|
||||
#define VLED_OUT_CH1_ON() (gpio_set_output_value(VLED_OUT_CHANNEL1,1))
|
||||
#define VLED_OUT_CH2_ON() (gpio_set_output_value(VLED_OUT_CHANNEL2,1))
|
||||
#define VLED_OUT_CH3_ON() (gpio_set_output_value(VLED_OUT_CHANNEL3,1))
|
||||
#define VLED_OUT_CH4_ON() (gpio_set_output_value(VLED_OUT_CHANNEL4,1))
|
||||
#define VLED_OUT_CH5_ON() (gpio_set_output_value(VLED_OUT_CHANNEL5,1))
|
||||
#define VLED_OUT_CH6_ON() (gpio_set_output_value(VLED_OUT_CHANNEL6,1))
|
||||
|
||||
#define VLED_OUT_CH1_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL1,0))
|
||||
#define VLED_OUT_CH2_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL2,0))
|
||||
#define VLED_OUT_CH3_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL3,0))
|
||||
#define VLED_OUT_CH4_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL4,0))
|
||||
#define VLED_OUT_CH5_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL5,0))
|
||||
#define VLED_OUT_CH6_OFF() (gpio_set_output_value(VLED_OUT_CHANNEL6,0))
|
||||
|
||||
// tx rst PA6
|
||||
// tx audio status PA7
|
||||
|
||||
int kt_key_event_handler(u16 key);
|
||||
int kt_music_play_end_handler(void);
|
||||
void kt_boot_init(void);
|
||||
void kt_init(void);
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
//*********************************************************************************//
|
||||
// app 配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_APP_BT_EN 1
|
||||
#define TCFG_APP_BT_EN 0
|
||||
#define TCFG_APP_MUSIC_EN 1
|
||||
#define TCFG_APP_LINEIN_EN 0
|
||||
#define TCFG_APP_FM_EN 0
|
||||
@ -42,7 +42,7 @@
|
||||
//*********************************************************************************//
|
||||
// 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_PORT_DP //串口发送脚配置
|
||||
#define TCFG_UART0_BAUDRATE 1000000 //串口波特率配置
|
||||
@ -142,7 +142,7 @@
|
||||
// USB 配置 //
|
||||
//*********************************************************************************//
|
||||
#define TCFG_PC_ENABLE TCFG_APP_PC_EN//PC模块使能
|
||||
#define TCFG_UDISK_ENABLE DISABLE_THIS_MOUDLE//U盘模块使能
|
||||
#define TCFG_UDISK_ENABLE ENABLE_THIS_MOUDLE//U盘模块使能
|
||||
#define TCFG_OTG_USB_DEV_EN BIT(0)//USB0 = BIT(0) USB1 = BIT(1)
|
||||
|
||||
#define TCFG_VIR_UDISK_ENABLE 0//ENABLE_THIS_MOUDLE
|
||||
|
||||
@ -12,22 +12,22 @@
|
||||
const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
//单击 //长按 //hold //抬起 //双击 //三击
|
||||
[0] = {
|
||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_1, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[1] = {
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_2, KEY_NULL, KEY_NULL, 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_USER_KEY_3, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_4, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_USER_KEY_5, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_ENC_START, KEY_NULL
|
||||
KEY_USER_KEY_6, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
@ -129,25 +129,25 @@ 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_USER_KEY_1, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[1] = {
|
||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_2, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[2] = {
|
||||
KEY_MUSIC_PP, KEY_MUSIC_CHANGE_DEV, KEY_NULL, KEY_NULL, KEY_MUSIC_CHANGE_REPEAT, KEY_NULL
|
||||
KEY_USER_KEY_3, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[3] = {
|
||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_4, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[4] = {
|
||||
KEY_MUSIC_PLAYE_PREV_FOLDER, KEY_MUSIC_FR, KEY_MUSIC_FR, KEY_NULL, KEY_REVERB_OPEN, KEY_NULL
|
||||
KEY_USER_KEY_5, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[5] = {
|
||||
KEY_MUSIC_PLAYE_NEXT_FOLDER, KEY_MUSIC_FF, KEY_MUSIC_FF, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
KEY_USER_KEY_6, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL
|
||||
},
|
||||
[6] = {
|
||||
KEY_MUSIC_PLAYER_AB_REPEAT_SWITCH, KEY_NULL, KEY_NULL, KEY_NULL, KEY_NULL, 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
|
||||
|
||||
@ -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 //轻量级打印开关, 默认关闭
|
||||
|
||||
@ -172,6 +172,12 @@ enum {
|
||||
KEY_IR_NUM_8,
|
||||
KEY_IR_NUM_9,//中间不允许插入
|
||||
//在这里增加元素
|
||||
KEY_USER_KEY_1,
|
||||
KEY_USER_KEY_2,
|
||||
KEY_USER_KEY_3,
|
||||
KEY_USER_KEY_4,
|
||||
KEY_USER_KEY_5,
|
||||
KEY_USER_KEY_6,
|
||||
//
|
||||
KEY_HID_MODE_SWITCH,
|
||||
KEY_HID_TAKE_PICTURE,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -62,8 +62,14 @@ static int power_on_init(void)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
|
||||
app_task_switch_to(APP_MUSIC_TASK);
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
#if TCFG_APP_BT_EN
|
||||
app_task_switch_to(APP_BT_TASK);
|
||||
app_task_switch_to(APP_MUSIC_TASK);
|
||||
#else
|
||||
|
||||
#if TCFG_USB_APPLE_DOCK_EN //苹果iap协议使用pc模式
|
||||
@ -76,6 +82,7 @@ static int power_on_init(void)
|
||||
/* app_task_switch_to(APP_LINEIN_TASK);//如果带检测,设备不在线,则不跳转 */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,5 +1,26 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fat_vfs_ops
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,27 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rem @echo off
|
||||
|
||||
@echo *****************************************************************
|
||||
|
||||
Binary file not shown.
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
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user