已裁剪掉逗猫棒的业务程序,原有的蓝牙转USB功能不受影响
This commit is contained in:
@@ -720,80 +720,8 @@ const struct low_power_param power_param = {
|
||||
};
|
||||
|
||||
/************************** wk_param ****************************/
|
||||
struct port_wakeup port0 = {
|
||||
.iomap = IO_PORTB_01, //唤醒口选择
|
||||
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_4ms,
|
||||
|
||||
};
|
||||
struct port_wakeup port2_1 = {
|
||||
.iomap = IO_PORTA_03, //唤醒口选择
|
||||
.pullup_down_enable = 0, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_16ms,
|
||||
|
||||
};
|
||||
struct port_wakeup port_1 = {
|
||||
.iomap = IO_PORTG_08, //唤醒口选择
|
||||
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_4ms,
|
||||
};
|
||||
struct port_wakeup port_2 = {
|
||||
.iomap = IO_PORTC_04, //唤醒口选择
|
||||
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_4ms,
|
||||
};
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)
|
||||
struct port_wakeup port1 = {
|
||||
.pullup_down_enable = DISABLE, //配置I/O 内部上下拉是否使能
|
||||
#if (TCFG_TEST_BOX_ANY_IO_UPDATE)
|
||||
.edge = RISING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
#else
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
#endif
|
||||
.filter = PORT_FLT_1ms,
|
||||
.iomap = TCFG_CHARGESTORE_PORT, //唤醒口选择
|
||||
};
|
||||
#endif
|
||||
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
struct port_wakeup charge_port = {
|
||||
.edge = RISING_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_16ms,
|
||||
.iomap = IO_CHGFL_DET, //唤醒口选择
|
||||
};
|
||||
|
||||
struct port_wakeup vbat_port = {
|
||||
.edge = BOTH_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_4ms,
|
||||
.iomap = IO_VBTCH_DET, //唤醒口选择
|
||||
};
|
||||
|
||||
struct port_wakeup ldoin_port = {
|
||||
.edge = BOTH_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_4ms,
|
||||
.iomap = IO_LDOIN_DET, //唤醒口选择
|
||||
};
|
||||
#endif
|
||||
|
||||
/* 桥接板:无休眠、无充电唤醒源 */
|
||||
const struct wakeup_param wk_param = {
|
||||
#if 1//(!(TCFG_LP_TOUCH_KEY_ENABLE && TCFG_LP_TOUCH_KEY1_EN))
|
||||
.port[1] = &port0,
|
||||
.port[2] = &port2_1,
|
||||
.port[3] = &port_1,
|
||||
.port[4] = &port_2,
|
||||
#endif
|
||||
#if 0//(TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)
|
||||
.port[3] = &port1,
|
||||
#endif
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
.aport[0] = &charge_port,
|
||||
.aport[1] = &vbat_port,
|
||||
.aport[2] = &ldoin_port,
|
||||
#endif
|
||||
};
|
||||
|
||||
void gSensor_wkupup_disable(void)
|
||||
@@ -1034,107 +962,35 @@ void board_set_soft_poweroff(void)
|
||||
|
||||
#define APP_IO_DEBUG_0(i,x) {JL_PORT##i->DIR &= ~BIT(x), JL_PORT##i->OUT &= ~BIT(x);}
|
||||
#define APP_IO_DEBUG_1(i,x) {JL_PORT##i->DIR &= ~BIT(x), JL_PORT##i->OUT |= BIT(x);}
|
||||
extern void usr_intterupt_close();
|
||||
extern void usr_intterupt_reinit();
|
||||
extern void usr_pwm_close();
|
||||
extern void key_active_set(u8 port);
|
||||
|
||||
/* 休眠已关闭,回调仅保留 SDK 注册接口;不做 PWM/唤醒口业务 */
|
||||
void sleep_exit_callback(u32 usec)
|
||||
{
|
||||
(void)usec;
|
||||
sleep_exit_callback_common(NULL);
|
||||
power_wakeup_index_enable(2, 0);
|
||||
power_wakeup_index_enable(3, 0);
|
||||
putchar('>');
|
||||
}
|
||||
void usr_disable_intterupt()
|
||||
{
|
||||
power_wakeup_index_enable(2, 0);
|
||||
}
|
||||
|
||||
|
||||
void usr_disable_charge_intterupt()
|
||||
{
|
||||
power_wakeup_index_enable(3, 0);
|
||||
}
|
||||
void usr_disable_all_intterupt()
|
||||
{
|
||||
usr_disable_intterupt();
|
||||
usr_disable_charge_intterupt();
|
||||
}
|
||||
|
||||
void sleep_enter_callback(u8 step)
|
||||
void sleep_enter_callback(u8 step)
|
||||
{
|
||||
/* 此函数禁止添加打印 */
|
||||
if (step == 1) {
|
||||
usr_pwm_close();
|
||||
usr_var.usr_interrupt_cnt=0;
|
||||
putchar('<');
|
||||
} else {
|
||||
gpio_set_pull_up(TCFG_CHARGESTORE_PORT, 0);
|
||||
gpio_set_pull_down(TCFG_CHARGESTORE_PORT, 0);
|
||||
gpio_set_die(TCFG_CHARGESTORE_PORT, 1);
|
||||
gpio_set_dieh(TCFG_CHARGESTORE_PORT, 1);
|
||||
gpio_set_direction(TCFG_CHARGESTORE_PORT, 1);
|
||||
|
||||
sleep_enter_callback_common(NULL);
|
||||
//if(_usr_module_cfg.power_on_flag==0)
|
||||
{
|
||||
if(_usr_module_cfg.zhengdong_kaiji)
|
||||
{
|
||||
if(usr_var.usr_disable_zjhendong==0)power_wakeup_index_enable(2, 1);
|
||||
}
|
||||
}
|
||||
power_wakeup_index_enable(3, 1);
|
||||
usr_intterupt_close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
sleep_enter_callback_common(NULL);
|
||||
}
|
||||
|
||||
|
||||
static void port_wakeup_callback(u8 index, u8 gpio)
|
||||
{
|
||||
log_info("%s:%d,%d",__FUNCTION__,index,gpio);
|
||||
if(index==2)
|
||||
{
|
||||
//if(_usr_module_cfg.power_on_flag==0)
|
||||
{
|
||||
usr_var.usr_interrupt_cnt=0;
|
||||
usr_var.usr_intterupt_reinit_falg=0;
|
||||
if(_usr_module_cfg.zhengdong_kaiji)
|
||||
{
|
||||
if(usr_var.usr_disable_zjhendong==0)usr_intterupt_reinit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if TCFG_UMIDIGI_BOX_ENABLE
|
||||
if (index == 2) {
|
||||
ldo_port_wakeup_to_cmessage();
|
||||
}
|
||||
#endif
|
||||
switch (index) {
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE)
|
||||
case 2:
|
||||
extern void chargestore_ldo5v_fall_deal(void);
|
||||
chargestore_ldo5v_fall_deal();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
(void)index;
|
||||
(void)gpio;
|
||||
}
|
||||
|
||||
static void aport_wakeup_callback(u8 index, u8 gpio, u8 edge)
|
||||
{
|
||||
/* log_info("%s:%d,%d",__FUNCTION__,index,gpio); */
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
switch (gpio) {
|
||||
case IO_CHGFL_DET://charge port
|
||||
charge_wakeup_isr();
|
||||
break;
|
||||
case IO_VBTCH_DET://vbat port
|
||||
case IO_LDOIN_DET://ldoin port
|
||||
ldoin_wakeup_isr();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
(void)index;
|
||||
(void)gpio;
|
||||
(void)edge;
|
||||
}
|
||||
|
||||
void board_power_init(void)
|
||||
@@ -1145,19 +1001,12 @@ void board_power_init(void)
|
||||
|
||||
power_set_callback(TCFG_LOWPOWER_LOWPOWER_SEL, sleep_enter_callback, sleep_exit_callback, board_set_soft_poweroff);
|
||||
|
||||
#if TCFG_UMIDIGI_BOX_ENABLE
|
||||
gpio_set_die(TCFG_CHARGESTORE_PORT, 1);
|
||||
umidigi_chargestore_message_callback(app_umidigi_chargetore_message_deal);
|
||||
#endif
|
||||
|
||||
power_keep_dacvdd_en(0);
|
||||
|
||||
power_wakeup_init(&wk_param);
|
||||
power_wakeup_init(&wk_param);
|
||||
|
||||
power_awakeup_set_callback(aport_wakeup_callback);
|
||||
power_wakeup_set_callback(port_wakeup_callback);
|
||||
|
||||
usr_disable_all_intterupt();
|
||||
|
||||
}
|
||||
#endif /* #ifdef CONFIG_BOARD_JL701N_DEMO */
|
||||
|
||||
@@ -747,19 +747,13 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
// 充电参数配置 //
|
||||
//*********************************************************************************//
|
||||
//是否支持芯片内置充电
|
||||
//桥接板不使用内置充电 / 充电舱
|
||||
#define TCFG_CHARGE_ENABLE 0
|
||||
//是否支持开机充电
|
||||
#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_4199
|
||||
/*充电截止电流可选配置*/
|
||||
#define TCFG_CHARGE_FULL_MA CHARGE_FULL_mA_10
|
||||
/*恒流充电电流可选配置*/
|
||||
#define TCFG_CHARGE_MA CHARGE_mA_50
|
||||
/*涓流充电电流配置*/
|
||||
#define TCFG_CHARGE_TRICKLE_MA CHARGE_mA_10
|
||||
|
||||
//*********************************************************************************//
|
||||
@@ -787,7 +781,7 @@ DAC硬件上的连接方式,可选的配置:
|
||||
//*********************************************************************************//
|
||||
#define TCFG_LOWPOWER_POWER_SEL PWR_LDO15//PWR_LDO15 //电源模式设置,可选DCDC和LDO
|
||||
#define TCFG_LOWPOWER_BTOSC_DISABLE 0 //低功耗模式下BTOSC是否保持
|
||||
#define TCFG_LOWPOWER_LOWPOWER_SEL SLEEP_EN//DEEP_SLEEP_EN//SLEEP_EN//DEEP_SLEEP_EN //低功耗使能,蓝牙&&系统空闲可进入低功耗
|
||||
#define TCFG_LOWPOWER_LOWPOWER_SEL 0 // 桥接板常供电,不进系统休眠//SLEEP_EN//DEEP_SLEEP_EN //低功耗使能,蓝牙&&系统空闲可进入低功耗
|
||||
#define TCFG_LOWPOWER_VDDIOM_LEVEL VDDIOM_VOL_28V //vddiom等级
|
||||
#define TCFG_LOWPOWER_OSC_TYPE OSC_TYPE_LRC //低功耗晶振类型,btosc/lrc
|
||||
///#if (TCFG_AUDIO_ASR_DEVELOP && TCFG_CVP_DEVELOP_ENABLE)
|
||||
|
||||
Reference in New Issue
Block a user