mirror of
https://github.com/mfulz/qmk_firmware.git
synced 2025-10-06 18:31:52 +02:00
Merge branch 'features/encryption' into enc_master
This commit is contained in:
commit
f5d4b4f86f
@ -1049,7 +1049,11 @@ bool process_record_enc(uint16_t keycode, keyrecord_t *record) {
|
|||||||
if (!record->event.pressed) {
|
if (!record->event.pressed) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
enc_read_pw(keycode);
|
int ret = enc_read_pw(keycode);
|
||||||
|
if (ret != 0) {
|
||||||
|
enc_switch_mode(ENC_MODE_CLOSED);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (enc_ctx.state.pw_ready) {
|
if (enc_ctx.state.pw_ready) {
|
||||||
if (enc_unlock() != 0) {
|
if (enc_unlock() != 0) {
|
||||||
enc_switch_mode(ENC_MODE_CLOSED);
|
enc_switch_mode(ENC_MODE_CLOSED);
|
||||||
@ -1093,15 +1097,18 @@ bool process_record_enc(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enc_ctx.state.key_ready && enc_ctx.state.pw_check_ready && enc_ctx.state.pw_ready && enc_ctx.state.seed_ready) {
|
if (!enc_ctx.state.key_ready && enc_ctx.state.pw_check_ready && enc_ctx.state.pw_ready && enc_ctx.state.seed_ready) {
|
||||||
int ret = enc_read_key(keycode);
|
int ret = enc_read_key(keycode);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
enc_switch_mode(ENC_MODE_CLOSED);
|
enc_switch_mode(ENC_MODE_CLOSED);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!enc_ctx.state.key_ready) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enc_ctx.state.pw_check_ready && enc_ctx.state.pw_ready && enc_ctx.state.seed_ready) {
|
if (enc_ctx.state.key_ready && enc_ctx.state.pw_check_ready && enc_ctx.state.pw_ready && enc_ctx.state.seed_ready) {
|
||||||
if (initialize_enc(NULL, NULL, true) != 0) {
|
if (initialize_enc(NULL, NULL, true) != 0) {
|
||||||
enc_switch_mode(ENC_MODE_CLOSED);
|
enc_switch_mode(ENC_MODE_CLOSED);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user