遥感adc值调整

This commit is contained in:
lmx
2025-12-18 14:58:35 +08:00
parent 5757f3fb12
commit 8775ec8b1a
11 changed files with 36 additions and 9 deletions

View File

@ -245,8 +245,15 @@ void control_key_init(void){
* @param key2_state 按键2值
*/
void control_key_get_value(u16* Xout_adc, u16* Yout_adc, u8* key1_state, u8* key2_state){
*Xout_adc = (u16)adc_get_value(AD_CH_PG5) * 65;
*Yout_adc = (u16)adc_get_value(AD_CH_PG7) * 65;
*Xout_adc = (u16)adc_get_value(AD_CH_PG5) * 64;
*Yout_adc = (u16)adc_get_value(AD_CH_PG7) * 64;
if(*Yout_adc >= 65535){
*Yout_adc = 65535;
}
if(*Xout_adc >= 65535){
*Xout_adc = 65535;
}
*key1_state = gpio_read(IO_PORTG_06);
rc_log("adc_get_value: Xout = %d, Yout = %d, key1_state = %d, key2_state = %d\n", *Xout_adc , *Yout_adc, *key1_state, 1);
@ -290,7 +297,7 @@ void contol_key_task(void){
}
g_send_data_to_ble_server(ble_data_buff, sizeof(ble_data_buff));
os_time_dly(5); //10ms为单位
os_time_dly(100); //10ms为单位
}
}
@ -408,7 +415,7 @@ void test_task(void){
void test_func_main(void){
#if TEST_FUNCTION == 1
// os_task_create(test_task, NULL, 1, 1024, 128, "rfid_test");
os_task_create(test_task, NULL, 1, 1024, 128, "rfid_test");
// os_task_create(contol_key_task, NULL, 1, 2048, 128, control_key_task_name);
#endif

View File

@ -123,18 +123,19 @@ void xtell_app_main()
xlog("==============xtell_app_end================\n");
u8 mac_data[6];
u8 mac_data[6];
extern void rcsp_adv_fill_mac_addr(u8 *mac_addr_buf);
rcsp_adv_fill_mac_addr(mac_data); //读取MAC地址
xlog("xtell BT mac data:%x:%x:%x:%x:%x:%x",mac_data[0],mac_data[1],mac_data[2],mac_data[3],mac_data[4],mac_data[5]);
// user_send_cmd_prepare(USER_CTRL_WRITE_SCAN_ENABLE, 0, NULL); //打开蓝牙可发现,已连接时不能操作
// delay_2ms(50);
// user_send_cmd_prepare(USER_CTRL_WRITE_CONN_ENABLE, 0, NULL); //打开蓝牙可连接
// delay_2ms(50);
extern int xtell_bt_newname(u8 *new_name);
xtell_bt_newname(xt_bt_new_name); //设置经典蓝牙名
// soft_iic_init(0);
// extern int xtell_bt_newname(u8 *new_name);
// xtell_bt_newname(xt_bt_new_name); //设置经典蓝牙名
extern void test_func_main(void);

View File

@ -13,6 +13,11 @@

View File

@ -13,6 +13,11 @@
sdfile_vfs_ops

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,6 +13,11 @@

View File

@ -13,6 +13,11 @@
[EXTRA_CFG_PARAM]
NEW_FLASH_FS = YES;

View File

@ -5412,7 +5412,6 @@ objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,start_app,l
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,check_power_on_voltage,l
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,rcsp_adv_fill_mac_addr,l
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,xtell_bt_newname,l
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,cpu_reset_by_soft,l
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,xt_bt_new_name,pl
-r=objs/apps/earphone/xtell_remote_control/xtell_app_main.c.o,app_var,l