Skip to content

Commit

Permalink
update firmware to V2.1.8
Browse files Browse the repository at this point in the history
1. Fix the BUG where the RF function cannot be used in V2.1.6 and V2.1.7 versions.
2. Add Fn+Y to control the touchbar slide enable function, Fn+T only controls the trackpoint enable function.
3. Optimize the latency in Game Mode.
  • Loading branch information
ChnMasterOG committed Jan 14, 2025
1 parent 68fce37 commit fec814a
Show file tree
Hide file tree
Showing 19 changed files with 230,227 additions and 229,775 deletions.
8 changes: 8 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,11 @@ You can submit you code [here](https://github.com/ChnMasterOG/tp78_v2/issues). T
- V2.1.7

        1. Fix BUG: Unable to remotely wake up host at USB mode.

- V2.1.8

        1. Fix the BUG where the RF function cannot be used in V2.1.6 and V2.1.7 versions.

        2. Add Fn+Y to control the touchbar slide enable function, Fn+T only controls the trackpoint enable function.

        3. Optimize the latency in Game Mode.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,11 @@ BUG
- V2.1.7

        1. 修复USB模式下无法远程唤醒主机的BUG

- V2.1.8

        1. 修复 V2.1.6 和 V2.1.7 版本无法使用 RF 功能的 BUG

        2. 增加 Fn+Y 单独控制触摸条滑动使能功能,Fn+T 只控制小红点使能功能

        3. 优化游戏模式下延迟
Binary file modified documents/TP78v2指导文档.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1583831302431893160" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="313314382710102915" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
11 changes: 11 additions & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/KEYBOARD.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ UINT8 KEYBOARD_Custom_Function( void )
} else if ( KeyboardDat->Key1 == KEY_T && Fn_Mode != Fn_Mode_DisEnableTP ) { // 使能/失能小红点
Fn_Mode = Fn_Mode_DisEnableTP;
Fn_cnt = 0;
} else if ( KeyboardDat->Key1 == KEY_Y && Fn_Mode != Fn_Mode_DisEnableTouchbar ) { // 使能/失能触摸条
Fn_Mode = Fn_Mode_DisEnableTouchbar;
Fn_cnt = 0;
} else if ( KeyboardDat->Key1 == KEY_F10 && Fn_Mode != Fn_Mode_USBMode ) { // 切换USB模式
Fn_Mode = Fn_Mode_USBMode;
Fn_cnt = 0;
Expand Down Expand Up @@ -360,6 +363,14 @@ UINT8 KEYBOARD_Custom_Function( void )
OLED_UI_add_CANCELINFO_delay_task(2000);
break;
}
case Fn_Mode_DisEnableTouchbar: { // Fn+Y关闭/开启触摸条
Fn_Mode = Fn_Mode_None;
g_Enable_Status.touchbar = !g_Enable_Status.touchbar;
if ( g_Enable_Status.touchbar == TRUE ) OLED_UI_add_SHOW_ICONINFO_task(OLED_UI_ICON_TOUCHBAR_IDX, " ON");
else OLED_UI_add_SHOW_ICONINFO_task(OLED_UI_ICON_TOUCHBAR_IDX, " OFF");
OLED_UI_add_CANCELINFO_delay_task(2000);
break;
}
case Fn_Mode_USBMode: { // Fn+F10切换USB模式
Fn_Mode = Fn_Mode_None;
if (g_Enable_Status.usb == TRUE) {
Expand Down
17 changes: 10 additions & 7 deletions mounriver_project/KEYBOARD_CH582M/HAL/MCU.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ NumLock_LEDOn_Status_t g_NumLock_LEDOn_Status; // 大小写信号
Ready_Status_t g_Ready_Status; // 就绪信号
Enable_Status_t g_Enable_Status = { // 使能信号
.tp = TRUE,
.touchbar = TRUE,
};
uint8_t g_TP_speed_div = 1;
uint8_t g_Game_Mode = FALSE; // 性能模式
Expand Down Expand Up @@ -875,7 +876,7 @@ tmosEvents HAL_ProcessEvent( tmosTaskID task_id, tmosEvents events )
#endif
}
if (g_Game_Mode == TRUE) {
tmos_start_task( halTaskID, HAL_KEYBOARD_EVENT, 2 ); // 处理键盘加速 - 1.25ms
tmos_start_task( halTaskID, HAL_KEYBOARD_EVENT, 1 ); // 处理键盘加速 - 0.625ms
} else {
tmos_start_task( halTaskID, HAL_KEYBOARD_EVENT, MS1_TO_SYSTEM_TIME(5) ); // 处理键盘
}
Expand All @@ -900,10 +901,12 @@ tmosEvents HAL_ProcessEvent( tmosTaskID task_id, tmosEvents events )
#if (defined HAL_MPR121_TOUCHBAR) && (HAL_MPR121_TOUCHBAR == TRUE)
if (collect_cnt == 0) {
if (g_keyboard_status.enter_cfg == FALSE) { // 配置参数模式不进行touchbar判断
if (g_Enable_Status.tp && g_Enable_Status.touchbar_button) { // 通过小红点使能和触摸条配置联合控制
MPR121_alg_judge_touchbar(ALG_ENABLE_TOUCHBAR_SLIDE | ALG_ENABLE_TOUCHBAR_TOUCH);
} else {
MPR121_alg_judge_touchbar(ALG_ENABLE_TOUCHBAR_SLIDE);
if (g_Enable_Status.touchbar) {
if (g_Enable_Status.touchbar_button) {
MPR121_alg_judge_touchbar(ALG_ENABLE_TOUCHBAR_SLIDE | ALG_ENABLE_TOUCHBAR_TOUCH); // 通过触摸条使能和触摸条按键使能配置联合控制
} else {
MPR121_alg_judge_touchbar(ALG_ENABLE_TOUCHBAR_SLIDE);
}
}
MPR121_Post_Operation();
}
Expand Down Expand Up @@ -1103,7 +1106,7 @@ void FLASH_Init(void)
break;
case RF_WORK_MODE:
g_Enable_Status.rf = TRUE;
g_Ready_Status.rf_l = TRUE; // 初始化显示更新
g_Ready_Status.rf = TRUE; // 初始化显示更新 - RF显示
g_lp_type = lp_sw_mode; // RTC+GPIO唤醒
OLED_UI_add_SHOWINFO_task("RF Mode");
OLED_UI_add_CANCELINFO_delay_task(2000);
Expand All @@ -1117,7 +1120,7 @@ void FLASH_Init(void)
break;
default:
g_Enable_Status.usb = TRUE;
g_Ready_Status.usb_l = TRUE; // 初始化显示更新
g_Ready_Status.usb_l = TRUE; // 初始化显示更新 - USB不开启
g_lp_type = lp_idle_mode;
OLED_UI_add_SHOWINFO_task("USB Mode");
OLED_UI_add_CANCELINFO_delay_task(2000);
Expand Down
8 changes: 6 additions & 2 deletions mounriver_project/KEYBOARD_CH582M/HAL/OLEDFONT.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ const unsigned char Hzk[][16]={
/* USB icon */
{0x00,0xC0,0xDE,0xD6,0xDE,0xD6,0xDE,0xC0,0x00,0x00,0x00,0x01,0x03,0x03,0x07,0x03,0x03,0x01,0x00,0x00},
/* RF UNCONNECT icon */
{0xC8,0x44,0x52,0xCA,0x2A,0xCA,0x52,0x44,0x58,0x00,0x07,0x01,0x03,0x05,0x00,0x07,0x01,0x01,0x00,0x00},
/* RF icon */
{0x04,0x08,0x92,0x94,0x95,0x94,0x92,0x08,0x06,0x00,0x02,0x01,0x04,0x02,0x0A,0x02,0x04,0x01,0x06,0x00},
/* RF icon */
{0xC8,0x44,0x52,0xCA,0x2A,0xCA,0x52,0x44,0x58,0x00,0x07,0x01,0x03,0x05,0x00,0x07,0x01,0x01,0x00,0x00},
/* MODULE icon */
{0xF8,0xFC,0x1E,0xDC,0x3E,0xDC,0x1E,0xFC,0xF8,0x00,0x03,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x00},
/* NUMLOCK icon */
Expand All @@ -332,12 +332,16 @@ const unsigned char Hzk[][16]={
{0xFC,0xF6,0x66,0x0E,0x00,0x9A,0x66,0xF6,0xFC,0x00,0x07,0x06,0x06,0x07,0x00,0x05,0x06,0x06,0x03,0x00},
/* TP icon */
{0x3E,0x22,0x7E,0x42,0x5A,0x5A,0x42,0x7E,0x22,0x3E,0x00,0x01,0x0F,0x01,0x00,0x00,0x0F,0x05,0x07,0x00},
/* Touchbar icon */
{0xBE,0xA2,0xA2,0x22,0x22,0x22,0x22,0x22,0x22,0x3E,0x00,0x07,0x00,0x07,0x05,0x07,0x00,0x07,0x04,0x07},
/* LED_Style icon */
{0x0C,0x18,0xC0,0x5C,0x40,0x40,0x5C,0xC0,0x18,0x0C,0x04,0x07,0x05,0x04,0x04,0x04,0x04,0x05,0x07,0x04},
/* miniFOC icon */
{0x00,0xFA,0xFC,0x0C,0x0C,0x0C,0x0C,0xFC,0xF8,0x00,0x00,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x05,0x00},
/* TP78mini icon */
{0xFE,0x02,0xF2,0x52,0xF2,0x52,0xF2,0x02,0xFE,0x00,0x07,0x04,0x05,0x05,0x05,0x05,0x05,0x04,0x07,0x00},
/* touchFish icon */
{0x40,0xE0,0xF0,0xF8,0xBC,0xFE,0x40,0xE0,0xF0,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x00,0x00,0x01,0x00},
/* USB_with_BLE_MODE icon */
{0x00,0xE0,0xEF,0xEB,0xEF,0xAB,0x7F,0x18,0xD4,0x32,0x04,0x02,0x01,0x00,0x0F,0x0B,0x0D,0x00,0x06,0x09},
/* BLE_with_USB_MODE icon */
Expand Down
6 changes: 4 additions & 2 deletions mounriver_project/KEYBOARD_CH582M/HAL/OLED_UI.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ void OLED_UI_show_version(uint8_t ena)
if (ena) {
OLED_ShowString(OLED_Midx(strlen("Firmware"), 0, 64), 2, "Firmware");
OLED_ShowString(OLED_Midx(strlen(FIRMWARE_VERSION), 0, 64), 3, FIRMWARE_VERSION);
OLED_ShowString(OLED_Midx(strlen("Designers"), 0, 64), 4, "Designers");
OLED_ShowString(OLED_Midx(strlen("Q.C, CW.L"), 0, 64), 5, "Q.C, CW.L");
// OLED_ShowString(OLED_Midx(strlen("Designers"), 0, 64), 4, "Designers");
// OLED_ShowString(OLED_Midx(strlen("Q.C, CW.L"), 0, 64), 5, "Q.C, CW.L");
OLED_ShowString(OLED_Midx(strlen("TP78 group"), 0, 64), 4, "TP78 group");
OLED_ShowString(OLED_Midx(strlen("Hello 2025"), 0, 64), 5, "Hello 2025");
//-OLED_Scroll(5, 5, 16, 48, 2, 1, 0);
} else {
OLED_Clr(0, 2, 63, 8);
Expand Down
1 change: 1 addition & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ typedef struct _Enable_Status_t
uint8_t usb_ble : 1;
uint8_t motor : 1;
uint8_t tp : 1;
uint8_t touchbar : 1;
uint8_t paintedegg : 1;
uint8_t touchbar_button : 1;
uint8_t sleep : 1;
Expand Down
1 change: 1 addition & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/KEYBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
#define Fn_Mode_VolumeUp 0xC0
#define Fn_Mode_VolumeDown 0xC1
#define Fn_Mode_DisEnableTP 0xD0
#define Fn_Mode_DisEnableTouchbar 0xD1
#define Fn_Mode_PriorityUSBorBLE 0xE0
#define Fn_Mode_SelectDevice1 0xE1
#define Fn_Mode_SelectDevice2 0xE2
Expand Down
2 changes: 2 additions & 0 deletions mounriver_project/KEYBOARD_CH582M/HAL/include/OLED_UI.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@
OLED_UI_ICON_BLE3_IDX,
OLED_UI_ICON_BLE4_IDX,
OLED_UI_ICON_TP_IDX,
OLED_UI_ICON_TOUCHBAR_IDX,
OLED_UI_ICON_LED_STYLE_IDX,
OLED_UI_ICON_MINIFOC_IDX,
OLED_UI_ICON_TP78MINI_IDX,
OLED_UI_ICON_TOUCHFISH_IDX,
OLED_UI_ICON_USB_WITH_BLE_MODE_IDX,
OLED_UI_ICON_BLE_WITH_USB_MODE_IDX,
}oled_ui_icon_index;
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_7"
#define FIRMWARE_VERSION "v2_1_8"
#endif
#ifndef BLE_MAC
#define BLE_MAC FALSE
Expand Down
Binary file modified mounriver_project/KEYBOARD_CH582M/LIB/LIBTP78_TPM.a
Binary file not shown.
2 changes: 1 addition & 1 deletion mounriver_project/KEYBOARD_CH582M/LIB/TP78_TPM_LIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define __TP78_TPM_LIB_H

#define MODULE_I2C_ADDR_MIN 0xC0
#define MODULE_I2C_ADDR_MAX 0xC4
#define MODULE_I2C_ADDR_MAX 0xC6

/* 错误代码 */
#define MODULE_ERR_I2C_NO_READY 0x01
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 fec814a

Please sign in to comment.