Add support for Lemokey P1 HE - #5
Merged
Merged
Conversation
Member
|
What modifications did you make to the firmware? I kinda forgot to look at it, but I guess the same patches just need to be applied to the lemokey analog_matrix. |
Contributor
Author
|
Yeah. They are exactly the same. I've even copied your version overwrite. diff --git a/keyboards/lemokey/common/analog_matrix/analog_matrix.c b/keyboards/lemokey/common/analog_matrix/analog_matrix.c
index d4e64c0ec3..21173b1b94 100644
--- a/keyboards/lemokey/common/analog_matrix/analog_matrix.c
+++ b/keyboards/lemokey/common/analog_matrix/analog_matrix.c
@@ -94,6 +94,7 @@ enum {
AMC_SET_GAME_CONTROLLER_MODE,
AMC_GET_REALTIME_TRAVEL = 0x30,
+ AMC_GET_REALTIME_TRAVEL_ALL,
AMC_CALIBRATE = 0x40,
AMC_GET_CALIBRATE_STATE,
@@ -811,6 +812,24 @@ bool get_realtime_travel(uint8_t *data) {
return true;
}
+bool get_realtime_travel_all(uint8_t *data) {
+ uint8_t i = 2;
+
+ for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
+ for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+ data[i++] = analog_key_matrix[r][c].travel;
+ if (i == RAW_EPSIZE) {
+ // Ran out of space for this chunk.
+ raw_hid_send(data, RAW_EPSIZE);
+ i = 2;
+ memset(&data[2], 0, RAW_EPSIZE - 2);
+ }
+ }
+ }
+
+ return true;
+}
+
void analog_matrix_task(void) {
calibrate();
profile_indication_timer_check();
@@ -873,6 +892,7 @@ void analog_matrix_rx(uint8_t *data, uint8_t length) {
switch (cmd) {
case AMC_GET_VERSION:
data[2] = KC_ANALOG_MATRIX_VERSION & 0xFF;
+ data[RAW_EPSIZE - 1] = 0x45;
break;
case AMC_GET_PROFILES_INFO:
@@ -934,6 +954,10 @@ void analog_matrix_rx(uint8_t *data, uint8_t length) {
data[2] = success ? 0 : 1;
break;
+ case AMC_GET_REALTIME_TRAVEL_ALL:
+ success = get_realtime_travel_all(data);
+ break;
+
case AMC_RESET_PROFILE:
success = profile_reset(data[2]);
update_travel_configs();
diff --git a/keyboards/lemokey/common/lemokey_raw_hid.c b/keyboards/lemokey/common/lemokey_raw_hid.c
index 30b56f2c7c..fd3b78f3ef 100644
--- a/keyboards/lemokey/common/lemokey_raw_hid.c
+++ b/keyboards/lemokey/common/lemokey_raw_hid.c
@@ -105,6 +105,10 @@ bool kc_raw_hid_rx(uint8_t *data, uint8_t length) {
itoa((DEVICE_VER >> 4) & 0xF, (char *)&data[i++], 16);
data[i++] = '.';
itoa(DEVICE_VER & 0xF, (char *)&data[i++], 16);
+ data[i++] = '+';
+ data[i++] = 'f';
+ data[i++] = 'a';
+ data[i++] = 'r';
data[i++] = ' ';
memcpy(&data[i], QMK_BUILDDATE, sizeof(QMK_BUILDDATE));
i += sizeof(QMK_BUILDDATE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for Lemokey P1 HE. Originally brought it up here.
Also I've compiled the custom firmware for this keyboard as well: lemokey_p1_he_ansi_via.bin.zip (tested with JS SDK, works as expected).