-
Notifications
You must be signed in to change notification settings - Fork 1
/
password.h
50 lines (36 loc) · 1.48 KB
/
password.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* KTHW - Hardware Clone of Keep Talking and Nobody Explodes
Copyright (C) 2017 Toby P., Thomas H.
Copyright (C) 2019 Toby P.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef PASSWORD_H_
#define PASSWORD_H_
#include <stdint.h>
#include "bomb.h"
#include "util.h"
struct word;
struct password {
struct module module;
struct gpio * in;
struct shreg * ser;
struct lcd * lcd;
const struct word * word;
char letters[5][6]; // 5 column cylinders with 6 letters each
uint8_t selections[5]; // currently selected index for each column
uint8_t pos; // currently focused column
uint8_t ticks;
uint8_t cache;
struct lcd_cache { uint8_t mode; uint8_t cmd; } lcd_cache[6];
};
void password_prepare_tick(struct bomb * bomb, struct module * module);
void password_tick(struct bomb * bomb, struct module * module);
void password_reset(struct bomb * bomb, struct module * module);
#define PASSWORD_MOD_INIT {"password", 0, &password_prepare_tick, &password_tick, &password_reset, NULL}
#endif