Skip to content

Commit

Permalink
Bump config version to 17
Browse files Browse the repository at this point in the history
  • Loading branch information
jfedor2 committed Jan 3, 2025
1 parent 4194a82 commit c01b49f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config-tool-web/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const STICKY_FLAG = 1 << 0;
const TAP_FLAG = 1 << 1;
const HOLD_FLAG = 1 << 2;
const CONFIG_SIZE = 32;
const CONFIG_VERSION = 16;
const CONFIG_VERSION = 17;
const VENDOR_ID = 0xCAFE;
const PRODUCT_ID = 0xBAF2;
const DEFAULT_PARTIAL_SCROLL_TIMEOUT = 1000000;
Expand Down Expand Up @@ -974,7 +974,7 @@ function add_crc(data) {
}

function check_json_version(config_version) {
if (!([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].includes(config_version))) {
if (!([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17].includes(config_version))) {
throw new Error("Incompatible version.");
}
}
Expand All @@ -990,7 +990,7 @@ async function check_device_version() {
// device because it could be version X, ignore our GET_CONFIG call with version Y and
// just happen to have Y at the right place in the buffer from some previous call done
// by some other software.
for (const version of [CONFIG_VERSION, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2]) {
for (const version of [CONFIG_VERSION, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2]) {
await send_feature_command(GET_CONFIG, [], version);
const [received_version] = await read_config_feature([UINT8]);
if (received_version == version) {
Expand Down
2 changes: 1 addition & 1 deletion config-tool/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
CONFIG_USAGE_PAGE = 0xFF00
CONFIG_USAGE = 0x0020

CONFIG_VERSION = 16
CONFIG_VERSION = 17
CONFIG_SIZE = 32
REPORT_ID_CONFIG = 100

Expand Down
3 changes: 2 additions & 1 deletion firmware/src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "platform.h"
#include "remapper.h"

const uint8_t CONFIG_VERSION = 16;
const uint8_t CONFIG_VERSION = 17;

const uint8_t CONFIG_FLAG_UNMAPPED_PASSTHROUGH = 0x01;
const uint8_t CONFIG_FLAG_UNMAPPED_PASSTHROUGH_MASK = 0b00001111;
Expand Down Expand Up @@ -530,6 +530,7 @@ void load_config(const uint8_t* persisted_config) {
// v14 is same as v13, it just introduces a new emulated device type
// v15 is same as v14, it just introduces some new expression ops
// v16 is same as v15, it just introduces a new expression op
// v17 is same as v16, it introduces new expression ops and GET_FEATURE retry behavior

persist_config_v13_t* config = (persist_config_v13_t*) persisted_config;
unmapped_passthrough_layer_mask = config->unmapped_passthrough_layer_mask;
Expand Down

0 comments on commit c01b49f

Please sign in to comment.