stub out secure data driven config

This commit is contained in:
zvecr 2022-04-11 01:59:48 +01:00
parent 05b5a4c23a
commit ffb0575eb8
5 changed files with 81 additions and 1 deletions

View file

@ -12,6 +12,13 @@
# define SECURE_IDLE_TIMEOUT 60000
#endif
#ifndef SECURE_UNLOCK_SEQUENCE
# define SECURE_UNLOCK_SEQUENCE \
{ \
{ 0, 0 } \
}
#endif
secure_status_t secure_status = SECURE_LOCKED;
static uint32_t unlock_time = 0;
static uint32_t idle_time = 0;
@ -41,8 +48,15 @@ void secure_request_unlock(void) {
}
void secure_keypress_event(uint8_t row, uint8_t col) {
static const uint8_t sequence[][2] = SECURE_UNLOCK_SEQUENCE;
// TODO: check keypress is actually part of unlock sequence
secure_unlock();
uint8_t offset = 0;
if ((sequence[offset][0] == row) && (sequence[offset][1] == col)) {
secure_unlock();
} else {
secure_lock();
}
}
void secure_task(void) {