Skip to content

Commit

Permalink
Updated all picow variants for card+PIN (cf. #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
twystd committed Oct 20, 2023
1 parent c5d131a commit 1724530
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 89 deletions.
11 changes: 6 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
- [ ] card + PIN read
- [x] timeout on keycode
- [x] rework ACL as struct (with cards, timer, etc)
- [ ] Update other variants
- [ ] Update all variants
- [ ] controller
- [ ] picow/wifi
- [ ] picow/wifi+usb
- [x] picow/base
- [x] picow/wifi
- [x] picow/wifi+usb
- [ ] pico/base
- [ ] pico/usb
- [ ] universal
- [x] picow/base
- [ ] picow/wifi
- [ ] picow/wifi+usb
- [x] picow/wifi
- [x] picow/wifi+usb
- [ ] pico/base
- [ ] pico/usb
- [ ] Remove debug stuff
Expand Down
21 changes: 0 additions & 21 deletions pico/universal/pico/base/src/universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,6 @@ int main() {
free(b);
}

if ((v & MSG) == MSG_CARD) {
on_card_read(v & 0x0fffffff);

if (last_card.ok && ((mode == READER) || (mode == CONTROLLER))) {
enum ACCESS access;

if ((access = acl_allowed(last_card.facility_code, last_card.card_number, "")) == GRANTED) {
last_card.access = GRANTED;
led_blink(1);
door_unlock(5000);
} else {
last_card.access = DENIED;
led_blink(3);
}
}

char s[64];
cardf(&last_card, s, sizeof(s), false);
logd_log(s);
}

if ((v & MSG) == MSG_LED) {
led_event(v & 0x0fffffff);
}
Expand Down
21 changes: 0 additions & 21 deletions pico/universal/pico/usb/src/universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,6 @@ int main() {
free(b);
}

if ((v & MSG) == MSG_CARD) {
on_card_read(v & 0x0fffffff);

if (last_card.ok && ((mode == READER) || (mode == CONTROLLER))) {
enum ACCESS access;

if ((access = acl_allowed(last_card.facility_code, last_card.card_number, "")) == GRANTED) {
last_card.access = GRANTED;
led_blink(1);
door_unlock(5000);
} else {
last_card.access = DENIED;
led_blink(3);
}
}

char s[64];
cardf(&last_card, s, sizeof(s), false);
logd_log(s);
}

if ((v & MSG) == MSG_LED) {
led_event(v & 0x0fffffff);
}
Expand Down
21 changes: 0 additions & 21 deletions pico/universal/picow/wifi+usb/src/universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,6 @@ int main() {
free(b);
}

if ((v & MSG) == MSG_CARD) {
on_card_read(v & 0x0fffffff);

if (last_card.ok && ((mode == READER) || (mode == CONTROLLER))) {
enum ACCESS access;

if ((access = acl_allowed(last_card.facility_code, last_card.card_number, "")) == GRANTED) {
last_card.access = GRANTED;
led_blink(1);
door_unlock(5000);
} else {
last_card.access = DENIED;
led_blink(3);
}
}

char s[64];
cardf(&last_card, s, sizeof(s), false);
logd_log(s);
}

if ((v & MSG) == MSG_LED) {
led_event(v & 0x0fffffff);
}
Expand Down
21 changes: 0 additions & 21 deletions pico/universal/picow/wifi/src/universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,6 @@ int main() {
free(b);
}

if ((v & MSG) == MSG_CARD) {
on_card_read(v & 0x0fffffff);

if (last_card.ok && ((mode == READER) || (mode == CONTROLLER))) {
enum ACCESS access;

if ((access = acl_allowed(last_card.facility_code, last_card.card_number, "")) == GRANTED) {
last_card.access = GRANTED;
led_blink(1);
door_unlock(5000);
} else {
last_card.access = DENIED;
led_blink(3);
}
}

char s[64];
cardf(&last_card, s, sizeof(s), false);
logd_log(s);
}

if ((v & MSG) == MSG_LED) {
led_event(v & 0x0fffffff);
}
Expand Down

0 comments on commit 1724530

Please sign in to comment.