diff options
author | Amir Hammad <amirhammad@users.noreply.github.com> | 2016-09-11 13:40:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-11 13:40:59 +0200 |
commit | 5e714edfa65f2f0d18fe9dc722ccd564a04e152a (patch) | |
tree | 5e310e07bdfb28e36d663ccdffbe65f78081187e /src/usbh_driver_hub_private.h | |
parent | 5615b9c938f6e4d05f7fae68b5329346df1238f9 (diff) | |
parent | b7167bf2aff1a7c9cf223dc2a1d2e401f599d5d8 (diff) | |
download | secure-hid-5e714edfa65f2f0d18fe9dc722ccd564a04e152a.tar.gz secure-hid-5e714edfa65f2f0d18fe9dc722ccd564a04e152a.tar.bz2 secure-hid-5e714edfa65f2f0d18fe9dc722ccd564a04e152a.zip |
Merge pull request #4 from amirhammad/core-refactor
Major rework
Diffstat (limited to 'src/usbh_driver_hub_private.h')
-rw-r--r-- | src/usbh_driver_hub_private.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/usbh_driver_hub_private.h b/src/usbh_driver_hub_private.h index df38243..8c9bc44 100644 --- a/src/usbh_driver_hub_private.h +++ b/src/usbh_driver_hub_private.h @@ -61,7 +61,19 @@ #define CURRENT_PORT_NONE -1 -#define EMPTY_PACKET_READ_STATE 255 +enum EVENT_STATE { + EVENT_STATE_NONE, + EVENT_STATE_INITIAL, + EVENT_STATE_POLL_REQ, + EVENT_STATE_POLL, + EVENT_STATE_READ_HUB_DESCRIPTOR_COMPLETE, + EVENT_STATE_ENABLE_PORTS, + EVENT_STATE_GET_PORT_STATUS, + EVENT_STATE_PORT_RESET_REQ, + EVENT_STATE_PORT_RESET_COMPLETE, + EVENT_STATE_SLEEP_500_MS, + EVENT_STATE_GET_STATUS_COMPLETE, +}; struct _hub_device { usbh_device_t *device[USBH_HUB_MAX_DEVICES + 1]; @@ -69,8 +81,7 @@ struct _hub_device { uint16_t endpoint_in_maxpacketsize; uint8_t endpoint_in_address; uint8_t endpoint_in_toggle; - uint8_t state; - uint8_t state_after_empty_read; + enum EVENT_STATE state; uint8_t desc_len; uint16_t ports_num; |