Skip to content

Commit

Permalink
update firmware to V2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ChnMasterOG committed Sep 9, 2024
1 parent 1881c02 commit 3cc3e37
Show file tree
Hide file tree
Showing 18 changed files with 218,142 additions and 217,693 deletions.
4 changes: 4 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,7 @@ You can submit you code [here](https://github.com/ChnMasterOG/tp78_v2/issues). T
- V2.1.4

        1. Fix BUG: There are some errors when using Capslock+Space alone to simulate left and right mouse buttons([Issue #3](https://github.com/ChnMasterOG/tp78_v2/issues/3)).

- V2.1.5

        1. Add motor_en configuration: The motor vibration is controlled by this configuration.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,7 @@ BUG
- V2.1.4

        1. 修复BUG:单独使用Capslock+空格模拟鼠标左右键异常([Issue #3](https://github.com/ChnMasterOG/tp78_v2/issues/3)

- V2.1.5

        1. 修改触摸条按键/滑动触发振动的功能为可配置(配置项:motor_en)
Binary file modified documents/TP78v2指导文档.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/FATFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const BYTE WriteBuffer[] = {
"LINE17:进入屏保时间/s(1~65536)\n"
"LINE18:进入休眠时间/s(1~65536)\n"
"LINE19:RF模式下重传检查间隔/ms(1~255)\n"
"LINE20:是否使能振动(0~1)\n"
"keyboard_spkey.txt---存放sp按键映射键位(每行8byte)\n"
"LINE1:spKEY1的HID报表数据\n"
"LINE2:spKEY2的HID报表数据\n"
Expand Down
8 changes: 4 additions & 4 deletions mounriver_project/KEYBOARD_CH582M/HAL/HW_I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ uint8_t HW_I2C_WaitUntilTimeout(expression_func exp_func, uint32_t event_flag, u
timeout--;
}
}
// if (exp_func == (expression_func)I2C_GetFlagStatus && event_flag == I2C_FLAG_BUSY && timeout == 0) {
// /* 总线异常 */
// HW_I2C_Reset();
// }
if (exp_func == (expression_func)I2C_GetFlagStatus && event_flag == I2C_FLAG_BUSY && timeout == 0) {
/* 总线异常 */
HW_I2C_Reset();
}
return timeout == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion mounriver_project/KEYBOARD_CH582M/HAL/KEYBOARD.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void KEYBOARD_Reset( void )
TOUCHBAR_TOU_THRESH, TOUCHBAR_REL_THRESH,
DOUBLE_TOUCH_CNT, LONG_TOUCH_CNT,
1, LED_DEFAULT_BRIGHTNESS, 2, // RF频率默认2.405G
0, 180, 240, 10
0, 180, 240, 10, 0
};

memcpy(CustomKey, KeyArrary, COL_SIZE*ROW_SIZE);
Expand Down
8 changes: 8 additions & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/MCU.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,14 @@ void FLASH_Init(void)
lp_max_period = tmp * (1000 / SYS_PERIOD);
}

/* 其它配置 */
HAL_Fs_Read_keyboard_cfg(FS_LINE_ENABLE_MOTOR, 1, &tmp);
if (tmp == 0) {
g_Enable_Status.motor = FALSE;
} else {
g_Enable_Status.motor = TRUE;
}

#if (defined HAL_WS2812_PWM) && (HAL_WS2812_PWM == TRUE)
DATAFLASH_Read_LEDStyle( );
#endif
Expand Down
6 changes: 3 additions & 3 deletions mounriver_project/KEYBOARD_CH582M/HAL/MPR121.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ void MPR121_Post_Operation(void)
oper_dat.l_btn_l = TRUE;
MPR121_set_result(&oper_dat);
OLED_UI_add_SHOWINFO_task("L Btn");
// MOTOR_GO(); // 打开可能导致指点杆异常
MOTOR_GO();
} else if (oper_dat.m_btn && oper_dat.m_btn_l == FALSE) {
oper_dat.m_btn_l = TRUE;
MPR121_set_result(&oper_dat);
OLED_UI_add_SHOWINFO_task("M Btn");
// MOTOR_GO(); // 打开可能导致指点杆异常
MOTOR_GO();
} else if (oper_dat.r_btn && oper_dat.r_btn_l == FALSE) {
oper_dat.r_btn_l = TRUE;
MPR121_set_result(&oper_dat);
OLED_UI_add_SHOWINFO_task("R Btn");
// MOTOR_GO(); // 打开可能导致指点杆异常
MOTOR_GO();
} else return;
OLED_UI_add_CANCELINFO_delay_task(2000);
}
13 changes: 12 additions & 1 deletion mounriver_project/KEYBOARD_CH582M/HAL/OLED_UI_CFG.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ const oled_ui_menu_structure cfg_menu_5 = {
.type = OLED_UI_TYPE_MENU,
.text[0] = "lp_cnt",
.text[1] = "RF_chk_ms",
.text[2] = "motor_en",
.p[0] = (uint8_t*)&lp_max_cnt_en,
.p[1] = (uint8_t*)&rf_chk_ms_en,
.p[2] = (uint8_t*)&enable_motor_en,
.p[3] = (uint8_t*)&main_menu,
.p[4] = (uint8_t*)&cfg_menu_4,
.p[5] = (uint8_t*)&cfg_menu_1,
.menu_size = 2,
.menu_size = 3,
};
const oled_ui_menu_structure key_status_menu_1 = {
.type = OLED_UI_TYPE_MENU,
Expand Down Expand Up @@ -348,6 +350,15 @@ const oled_ui_enter_num_structure rf_chk_ms_en = {
.line = FS_LINE_RF_CHECK_ACK_MS,
.limit_len = 3,
};
const oled_ui_enter_num_structure enable_motor_en = {
.type = OLED_UI_TYPE_ENTER_NUM,
.p = (uint8_t*)&cfg_menu_5,
.preStr = "val:",
.postStr = "OK",
.pStr_len = 4,
.line = FS_LINE_ENABLE_MOTOR,
.limit_len = 1,
};

/* 执行项 */
const oled_ui_execute_structure scan_tpm = {
Expand Down
1 change: 1 addition & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/FATFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define FS_LINE_IDLE_MAX_CNT 16
#define FS_LINE_LP_MAX_CNT 17
#define FS_LINE_RF_CHECK_ACK_MS 18
#define FS_LINE_ENABLE_MOTOR 19

uint8_t unsigned_dec_to_string(uint16_t num, char *buff, uint8_t type);
uint8_t string_dec_to_u16(char *buff, uint16_t *num);
Expand Down
4 changes: 2 additions & 2 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ typedef union {
#define DEFAULT_LP_MAX_PERIOD (240 * (1000 / SYS_PERIOD)) // idle_cnt大于该值则进入低功耗模式

#define MOTOR_PIN GPIO_Pin_19
#define MOTOR_RUN() { GPIOB_SetBits( MOTOR_PIN ); }
#define MOTOR_RUN() { if (g_Enable_Status.motor == TRUE) GPIOB_SetBits( MOTOR_PIN ); }
#define MOTOR_STOP() { GPIOB_ResetBits( MOTOR_PIN ); }
#define MOTOR_Init() { GPIOB_SetBits( MOTOR_PIN ); GPIOB_ModeCfg( MOTOR_PIN, GPIO_ModeOut_PP_5mA ); MOTOR_STOP(); }
#define MOTOR_Init() { MOTOR_STOP(); GPIOB_ModeCfg( MOTOR_PIN, GPIO_ModeOut_PP_5mA ); }
#define MOTOR_GO() { MOTOR_RUN(); tmos_start_task( halTaskID, MOTOR_STOP_EVENT, MS1_TO_SYSTEM_TIME(100) ); }

/* CapsLock LEDOn Status */
Expand Down
1 change: 1 addition & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/OLED_UI.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
extern const oled_ui_enter_num_structure idle_max_cnt_en;
extern const oled_ui_enter_num_structure lp_max_cnt_en;
extern const oled_ui_enter_num_structure rf_chk_ms_en;
extern const oled_ui_enter_num_structure enable_motor_en;
extern const oled_ui_execute_structure scan_tpm;

void OLED_UI_ShowOK(uint8_t x, uint8_t y, uint8_t s);
Expand Down
2 changes: 1 addition & 1 deletion mounriver_project/KEYBOARD_CH582M/HAL/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* 默认配置值
*/
#ifndef FIRMWARE_VERSION
#define FIRMWARE_VERSION "v2_1_4"
#define FIRMWARE_VERSION "v2_1_5"
#endif
#ifndef BLE_MAC
#define BLE_MAC FALSE
Expand Down
Binary file modified mounriver_project/KEYBOARD_CH582M/obj/BLE_CH582M.bin
Binary file not shown.
Binary file modified mounriver_project/KEYBOARD_CH582M/obj/BLE_CH582M.elf
Binary file not shown.
Loading

0 comments on commit 3cc3e37

Please sign in to comment.