button_status = button_get_status(PIN_BTN_LEFT);
if (button_status == 1)
{
- now_value |= MS_BTN_LEFT;
+ now_value |= MS_BTN_MIDDLE;//MS_BTN_LEFT;
}
else if (button_status == 2)
{
#if(BK_AUT)
- now_value |= MS_BTN_voice;
+ now_value |= MS_BTN_LEFT;//MS_BTN_voice;
#else
now_value |= MS_BTN_K4;
#endif
}
else if (button_status == 2)
{
- #if(BK_AUT)
- now_value |= MS_BTN_m;
- #else
- now_value |= MS_BTN_K5;
- #endif
+ // #if(BK_AUT)
+ // now_value |= MS_BTN_m;
+ // #else
+ // now_value |= MS_BTN_K5;
+ // #endif
//now_value |= MS_BTN_VOICE;
}
- button_status = button_get_status(PIN_BTN_MIDDLE);
+ button_status = button_get_status(PIN_BTN_M);
if (button_status == 1)
{
- now_value |= MS_BTN_MIDDLE;
+ now_value |= MS_BTN_m;
}
else if (button_status == 2)
{
- #if(BK_AUT)
- now_value |= MS_BTN_ai;
- #else
+ // #if(BK_AUT)
+ // now_value |= MS_BTN_ai;
+ // #else
now_value |= MS_BTN_VOICE;
- #endif
+ //#endif
//now_value |= MS_BTN_K5;
}
-
- if(!gpio_read(PIN_MODE_SWITCH ))
+ button_status = button_get_status(PIN_MODE_SWITCH);
+ if (button_status == 1)
+ {
+ now_value |= MS_BTN_ai;
+ }
+ else if (button_status == 2)
{
- #if(BK_AUT)
- now_value |= MS_BTN_MODE_SWITCH ;
- #else
- now_value |= MS_BTN_MODE;
- #endif
- printf("btn mode press\n");
+ now_value |= MS_BTN_MODE_SWITCH;
+
}
+ // if(!gpio_read(PIN_MODE_SWITCH ))
+ // {
+ // #if(BK_AUT)
+ // now_value |= MS_BTN_MODE_SWITCH ;
+ // #else
+ // now_value |= MS_BTN_MODE;
+ // #endif
+ // printf("btn mode press\n");
+ // }
return now_value;
}
#if BK_AUT && BK_AUT_KEY_CMD
//BK_aut_hal_send("���������\n",sizeof("���������\n"));
- BK_button_callback(voice_button,PRESS_DOWN);//���������
+ BK_button_callback(voice_button,PRESS_DOWN);//���������
bk_printf("voice button \n");
#endif
//w_snd_val(0x01);
}
- else if(clock_time_exceed(btn_tick, 290000))//�������������
+ else if(clock_time_exceed(btn_tick, 290000))//�������������
{
if(voice_key_flg == 1) //����һֱ�ظ���������
{
#if BK_AUT && BK_AUT_KEY_CMD
//BK_aut_hal_send("���������\n",sizeof("���������\n"));
printf("voice button long press start\n");
- BK_button_callback(voice_button,LONG_PRESS_START);//�����������ʼ
+ BK_button_callback(voice_button,LONG_PRESS_START);//�����������Ê?
#else
if(connect_ok)
{
}
}
- else if((last_btn_value & MS_BTN_voice) == MS_BTN_voice) //������ͷ� voice key new release
+ else if((last_btn_value & MS_BTN_voice) == MS_BTN_voice) //������ͷ� voice key new release
{
if(event_new != 0)
{
#if BK_AUT && BK_AUT_KEY_CMD
//BK_aut_hal_send("����������ͷ�\n",sizeof("����������ͷ�\n"));
printf("voice button long release\n");
- BK_button_callback(voice_button,PRESS_UP);//�����������
+ BK_button_callback(voice_button,PRESS_UP);//�����������
#else
w_snd_val(0x10);
ui_enable_mic(0); //voice off
#if BK_AUT && BK_AUT_KEY_CMD
//BK_aut_hal_send("������̰��ͷ�\n",sizeof("������̰��ͷ�\n"));
printf("voice button short release\n");
- BK_button_callback(voice_button,SINGLE_CLICK);//������̰�
+ BK_button_callback(voice_button,SINGLE_CLICK);//������̰�
#else
if(!ui_mic_enable)
{
#if BK_AUT && BK_AUT_KEY_CMD
printf("AI button short release\n");
//BK_aut_hal_send("AI�̰��ͷ�\n",sizeof("AI�̰��ͷ�\n"));
- BK_button_callback(AI_button,SINGLE_CLICK);//������̰�
+ BK_button_callback(AI_button,SINGLE_CLICK);//������̰�
#else
w_snd_val(0x06);
#endif
if(!ui_mic_enable)
{
audio_stick = clock_time()|1;
- ui_enable_mic(1);//¼���
+ ui_enable_mic(1);//¼���
}
}
else if(pData[0] == AP_CMD_CONNECT_REQ) //connect start
pData_cmd[4] = 1; //version H
pData_cmd[5] = flash_dpi_info.bt_dpi;; //dpi L
pData_cmd[6] = 0x00; //dpi H
- pData_cmd[7] = 0; //���״̬ �� 0 δ��� �� 1. ���״̬
+ pData_cmd[7] = 0; //���״Ì? �� 0 �ï¿? �� 1. ���״Ì?
pData_cmd[8] = my_batVal[0]; //����
//bls_att_pushNotifyData(USER_REPORT_INPUT_CD2_H, pData_cmd, 16);
if(user_data.mouse_mode != RF_2M_2P4G_MODE)
pData_cmd[3] = 1;
pData_cmd[4] = flash_dpi_info.bt_dpi; //1 -4
pData_cmd[5] = 0x00;
- pData_cmd[6] = 0; //���״̬ �� 0 δ��� �� 1. ���״̬
+ pData_cmd[6] = 0; //���״Ì? �� 0 �ï¿? �� 1. ���״Ì?
pData_cmd[7] = my_batVal[0]; //����
//bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 8);
if(user_data.mouse_mode != RF_2M_2P4G_MODE)
stb_app_deinit();
/*
��������stb_app_device_init
- ������������ʼ��Ӧ�õĵײ� SDK��ִ�б�Ҫ�ij�ʼ���������������Դ�����ó�ʼ״̬�ȡ�
+ ������������ʼ��Ӧ�õĵײ� SDK��ִ�б�Ҫ�ij�ʼ���������������Դ�����ó�ʼ״Ì?�ȡ�
����: uint8_t *pk_str - ָ��PK�ַ������ӻ�ɽ�Ŷӻ�ȡ
uint8_t *ps_str - ָ��PS�ַ������ӻ�ɽ�Ŷӻ�ȡ
uint8_t *mac_str - ָ���豸����MAC�ַ���
#define BTN_PM_WAKEUP_SRC PM_PIN_PULLUP_1M
- #define PIN_BTN_LEFT GPIO_PD2
+ #define PIN_BTN_LEFT GPIO_PB5
#define PD2_INPUT_ENABLE 1
#define PD2_OUTPUT_ENABLE 0
#define PD2_DATA_OUT 1
#define PULL_WAKEUP_SRC_PD2 BTN_PM_WAKEUP_SRC
- #define PIN_BTN_RIGHT GPIO_PD3
+ #define PIN_BTN_RIGHT GPIO_PB6
#define PD3_INPUT_ENABLE 1
#define PD3_OUTPUT_ENABLE 0
#define PD3_DATA_OUT 1
#define PULL_WAKEUP_SRC_PD3 BTN_PM_WAKEUP_SRC
- #define PIN_BTN_MIDDLE GPIO_PB5
+ #define PIN_BTN_M GPIO_PD3
#define PB5_INPUT_ENABLE 1
#define PB5_OUTPUT_ENABLE 0
#define PB5_DATA_OUT 1
#define PULL_WAKEUP_SRC_PB5 BTN_PM_WAKEUP_SRC
- #define PIN_MODE_SWITCH GPIO_PB6
+ #define PIN_MODE_SWITCH GPIO_PD2
#define PB6_INPUT_ENABLE 1
#define PB6_OUTPUT_ENABLE 0
#define PB6_DATA_OUT 1
#define PB6_FUNC AS_GPIO
#define IS_BLE_MODE_AAA (gpio_read(PIN_MODE_SWITCH)!=0)
- #define BTN_MATRIX {PIN_BTN_LEFT,PIN_BTN_RIGHT,PIN_BTN_MIDDLE,PIN_MODE_SWITCH}
+ #define BTN_MATRIX {PIN_BTN_LEFT,PIN_BTN_RIGHT,PIN_BTN_M,PIN_MODE_SWITCH}
#endif
#define PULL_WAKEUP_SRC_PC3 PM_PIN_UP_DOWN_FLOAT
- #define PIN_BLE_LED GPIO_PA7
- #define PA7_INPUT_ENABLE 0
- #define PA7_OUTPUT_ENABLE 1
- #define PA7_DATA_OUT LED_OFF_AAA
- #define PULL_WAKEUP_SRC_PA7 PM_PIN_UP_DOWN_FLOAT
- #define PA7_FUNC AS_GPIO
-
- #define PIN_BLE2_LED GPIO_PC2
+ #define PIN_BLE_LED GPIO_PC2
#define PC2_INPUT_ENABLE 0
#define PC2_OUTPUT_ENABLE 1
#define PC2_DATA_OUT LED_OFF_AAA
#define PULL_WAKEUP_SRC_PC2 PM_PIN_UP_DOWN_FLOAT
#define PC2_FUNC AS_GPIO
+ #define PIN_BLE2_LED GPIO_PA7
+ #define PA7_INPUT_ENABLE 0
+ #define PA7_OUTPUT_ENABLE 1
+ #define PA7_DATA_OUT LED_OFF_AAA
+ #define PULL_WAKEUP_SRC_PA7 PM_PIN_UP_DOWN_FLOAT
+ #define PA7_FUNC AS_GPIO
+
+
#endif