Skip to content

Commit

Permalink
sync code from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ChnMasterOG committed Feb 3, 2024
1 parent b095c5c commit afe546c
Show file tree
Hide file tree
Showing 18 changed files with 229,340 additions and 230,156 deletions.
Binary file modified documents/TP78v2指导文档.pdf
Binary file not shown.
Binary file removed documents/TP78功能键一览.docx
Binary file not shown.
25 changes: 15 additions & 10 deletions mounriver_project/KEYBOARD_CH582M/HAL/KEYBOARD.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const uint8_t Extra_KeyArrary[ROW_SIZE][COL_SIZE] = {
/* ROW2 */{ KEY_None, KEY_BACKSPACE,KEY_UpArrow, KEY_ENTER, KEY_PageUp, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_PrintScreen,KEY_None, KEY_None, KEY_None },
/* ROW3 */{ KEY_None, KEY_LeftArrow,KEY_DownArrow,KEY_RightArrow, KEY_PageDown, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None },
/* ROW4 */{ KEY_None, KEY_None, KEY_None, KEY_None, KEY_Home, KEY_End, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None },
/* ROW5 */{ KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None },
/* ROW5 */{ KEY_None, KEY_None, KEY_None, KEY_MouseL, KEY_MouseR, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None, KEY_None },
}; // 额外默认键盘布局 - 其它键盘布局需修改此处
const uint8_t SP_KeyArrary[][8] = {
{ 0x5, 0x0, KEY_Delete, 0x0, 0x0, 0x0, 0x0, 0x0 }, //1 - Ctrl+Alt+Del
Expand Down Expand Up @@ -258,8 +258,8 @@ UINT8 KEYBOARD_Custom_Function( void )
} else if ( Fn_cnt >= 0x30 ) {
OLED_UI_add_SHOWINFO_task("%d/5 Reset", Fn_cnt >> 4);
OLED_UI_add_CANCELINFO_delay_task(1500);
} else if ( Fn_cnt == 0x20 && sys_time - press_time >= 3 * (1000 / SYS_PERIOD) ) { // 第二下Fn长按进board boot
APPJumpBoot();
} else if ( Fn_cnt == 0x20 && sys_time - press_time >= 3 * (1000 / SYS_PERIOD) ) { // 第二下Fn长按进board boot --- 防止误擦除固件,该功能暂时屏蔽
//-APPJumpBoot();
}
break;
}
Expand Down Expand Up @@ -641,7 +641,9 @@ void KEYBOARD_Detection( void )
g_capslock_status.press_Capslock_with_other = TRUE;
}//按下capslock的同时 是否按下其他键

if (KeyArr_Ptr[current_row][current_colum] == KEY_Fn) { // 功能键
if (KeyArr_Ptr[current_row][current_colum] == KEY_None) { // 不做处理
continue;
} else if (KeyArr_Ptr[current_row][current_colum] == KEY_Fn) { // 功能键
g_keyboard_status.Fn = TRUE;
} else if (KeyArr_Ptr[current_row][current_colum] >= KEY_SP_1) { // SP键(单键复合)
g_keyboard_status.SP_Key = KeyArr_Ptr[current_row][current_colum] - KEY_SP_1;
Expand Down Expand Up @@ -698,15 +700,18 @@ void KEYBOARD_Detection( void )
}
g_capslock_status.press_Capslock_with_other = FALSE;
} else {
uint8_t p = 2; // 双指针实现删除按键
for (key_idx = 2; key_idx < 8; key_idx++) {
if (KeyboardDat->data[key_idx] != KEY_None &&
(KeyboardDat->data[key_idx] == CustomKey[current_row][current_colum] ||
KeyboardDat->data[key_idx] == Extra_CustomKey[current_row][current_colum])) { // 弹起按键2层都清除
memcpy(&KeyboardDat->data[key_idx], &KeyboardDat->data[key_idx] + 1, 7 - key_idx);
KeyboardDat->Key6 = 0;
KEYBOARD_data_index--;
if (KeyboardDat->data[key_idx] != KEY_None) {
if ((KeyboardDat->data[key_idx] != CustomKey[current_row][current_colum] &&
KeyboardDat->data[key_idx] != Extra_CustomKey[current_row][current_colum])) { // 弹起按键2层都清除
KeyboardDat->data[p] = KeyboardDat->data[key_idx];
p++;
}
KeyboardDat->data[key_idx] = KEY_None;
}
}
KEYBOARD_data_index = p;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/MPR121.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ void MPR121_Post_Operation(void)
oper_dat.slide_left_l = TRUE;
MPR121_set_result(&oper_dat);
OLED_UI_add_SHOWINFO_task("<<<<<<");
MOTOR_GO();
} else if (oper_dat.slide_right && oper_dat.slide_right_l == FALSE) {
oper_dat.slide_right_l = TRUE;
MPR121_set_result(&oper_dat);
OLED_UI_add_SHOWINFO_task(">>>>>>");
MOTOR_GO();
} else if (oper_dat.l_btn && oper_dat.l_btn_l == FALSE) {
oper_dat.l_btn_l = TRUE;
MPR121_set_result(&oper_dat);
Expand Down
Loading

0 comments on commit afe546c

Please sign in to comment.