Major refactor of USB CCID and USB HID interfaces. All interfaces are rewritten.

With this new scheme we ensure that:
- memcpy's are reduced.
- no race conditions are performed.
- critical areas are protected.
- callbacks are executed immediately.
- write's are executed after the positive report is received.
- no usb middle interface anymore.
- CCID and HID are totally independent.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-08-23 10:02:19 +02:00
parent 0745838e3f
commit fa6292118d
10 changed files with 420 additions and 576 deletions

View File

@@ -29,11 +29,11 @@
typedef struct app {
const uint8_t *aid;
int (*process_apdu)();
int (*select_aid)(struct app *);
int (*select_aid)(struct app *, uint8_t);
int (*unload)();
} app_t;
extern int register_app(int (*)(app_t *), const uint8_t *);
extern int register_app(int (*)(app_t *, uint8_t), const uint8_t *);
extern int select_app(const uint8_t *aid, size_t aid_len);
typedef struct cmd {