From fc2cecabf63cccd764c058baaba6ebf3096fcfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Wed, 12 Apr 2017 23:51:23 +0200 Subject: [PATCH] Clean up hid_bootloader.h --- right/src/buspal/bm_usb/hid_bootloader.h | 33 ++++++++++-------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/right/src/buspal/bm_usb/hid_bootloader.h b/right/src/buspal/bm_usb/hid_bootloader.h index e7d9a85..607b185 100644 --- a/right/src/buspal/bm_usb/hid_bootloader.h +++ b/right/src/buspal/bm_usb/hid_bootloader.h @@ -1,37 +1,30 @@ -#ifndef __USB_HID_MOUSE_H__ -#define __USB_HID_MOUSE_H__ 1 +#ifndef __USB_HID_BOOTLOADER_H__ +#define __USB_HID_BOOTLOADER_H__ #include "fsl_rtos_abstraction.h" #include "bootloader_hid_report_ids.h" -//! @brief Request parameters. -enum -{ +enum { // Request parameters kAppRequestParam_IdleRate = 0, kAppRequestParam_Protocol, kAppRequestParamCount }; -//! @brief State information for the USB HID packetizer. -typedef struct _usb_hid_packetizer_info -{ - bool didReceiveFirstReport; //!< Whether the first report has been received. - bool didReceiveDataPhaseAbort; //!< Whether we received a data phase abort request. - bool isReceiveDataRequestRequired; //!< Whether an interrupt out pipe receive data request is required. - uint8_t appRequestParams[kAppRequestParamCount]; //!< Storage for request parameter values. - sync_object_t receiveSync; //!< Sync object used for reading packets. - sync_object_t sendSync; //!< Sync object used for sending packets. - uint32_t reportSize; //!< The size in bytes of a received report. May be greater than the packet contained within - //! the report plus the header, as the host can send up to the max report size bytes. +typedef struct _usb_hid_packetizer_info { + bool didReceiveFirstReport; // Whether the first report has been received. + bool didReceiveDataPhaseAbort; // Whether we received a data phase abort request. + bool isReceiveDataRequestRequired; // Whether an interrupt out pipe receive data request is required. + uint8_t appRequestParams[kAppRequestParamCount]; // Storage for request parameter values. + sync_object_t receiveSync; // Sync object used for reading packets. + sync_object_t sendSync; // Sync object used for sending packets. + uint32_t reportSize; // The size in bytes of a received report. May be greater than the packet contained + // within the report plus the header, as the host can send up to the max report size bytes. bl_hid_report_t report; //!< Buffer used to hold HID reports for sending and receiving. } usb_hid_packetizer_info_t; -typedef struct _usb_hid_generic_struct -{ +typedef struct _usb_hid_generic_struct { usb_device_handle device_handle; class_handle_t hid_handle; - // uint32_t buffer[2][USB_HID_GENERIC_IN_BUFFER_LENGTH>>2]; - // uint8_t buffer_index; usb_hid_packetizer_info_t hid_packet; uint8_t idle_rate; uint8_t speed;