Downstream mouse support working!

pull/7/head
Robert Fisk 8 years ago
parent b0558e0eec
commit e9ffbe2748

@ -17,7 +17,7 @@
#define DOWNSTREAM_PACKET_HEADER_LEN (2) //Min length = CommandClass & Command bytes
#define DOWNSTREAM_PACKET_LEN (DOWNSTREAM_PACKET_HEADER_LEN + USBH_MAX_DATA_BUFFER)
#define DOWNSTREAM_PACKET_LEN (DOWNSTREAM_PACKET_HEADER_LEN + BOT_PAGE_LENGTH)
#define DOWNSTREAM_PACKET_LEN_MIN (DOWNSTREAM_PACKET_HEADER_LEN)
#define DOWNSTREAM_PACKET_HEADER_LEN_16 (DOWNSTREAM_PACKET_HEADER_LEN / 2)
@ -59,7 +59,7 @@ typedef struct
uint16_t Length16 __ALIGN_END; //Packet length includes CommandClass, Command, and Data
uint8_t CommandClass;
uint8_t Command;
uint8_t Data[USBH_MAX_DATA_BUFFER]; //Should (must?) be word-aligned, for USB copy routine
uint8_t Data[BOT_PAGE_LENGTH]; //Should (must?) be word-aligned, for USB copy routine
}
DownstreamPacketTypeDef;

@ -75,9 +75,10 @@
/*---------- -----------*/
#define USBH_USE_OS 0
#define BOT_PAGE_LENGTH 512 //Moved here from usbh_msc_bot.h to avoid a circular include loop :(
/****************************************/
/* #define for FS and HS identification */

@ -35,8 +35,8 @@
/* Includes ------------------------------------------------------------------*/
#include "usbh_core.h"
#include "usbh_hid_mouse.h"
#include "usbh_hid_keybd.h"
//#include "usbh_hid_mouse.h"
//#include "usbh_hid_keybd.h"
/** @addtogroup USBH_LIB
* @{

@ -145,7 +145,7 @@ MSC_HandleTypeDef;
/* Interface Descriptor field values for MSC Protocol */
#define MSC_BOT 0x50
#define MSC_TRANSPARENT 0x06
#define MSC_TRANSPARENT 0x06
/**
* @}
*/

@ -38,7 +38,6 @@
/* Includes ------------------------------------------------------------------*/
#include "usbh_core.h"
#include "usbh_msc_bot.h"
#include "downstream_spi.h"
@ -177,8 +176,6 @@ BOT_HandleTypeDef;
#define BOT_DIR_OUT 1
#define BOT_DIR_BOTH 2
#define BOT_PAGE_LENGTH 512
#define BOT_CBW_CB_LENGTH 16

@ -243,7 +243,7 @@ USBH_StatusTypeDef USBH_MSC_BOT_Process (USBH_HandleTypeDef *phost, uint8_t lun)
{
//Dispatch current bot_packet, then get a new one
if (Downstream_MSC_PutStreamDataPacket(MSC_Handle->hbot.bot_packet,
(BOT_PAGE_LENGTH - MSC_Handle->hbot.bot_packet_bytes_remaining)) != HAL_OK)
BOT_PAGE_LENGTH) != HAL_OK)
{
MSC_Handle->hbot.state = BOT_ERROR_IN;
break;

@ -88,7 +88,7 @@
/** @defgroup USBH_CTLREQ_Exported_Variables
* @{
*/
extern uint8_t USBH_CfgDesc[512];
//extern uint8_t USBH_CfgDesc[512];
/**
* @}
*/

@ -16,6 +16,7 @@
#include "downstream_msc.h"
#include "usbh_core.h"
#include "usbh_msc.h"
#include "usbh_hid.h"
#include "led.h"
@ -190,7 +191,7 @@ void Downstream_HostUserCallback(USBH_HandleTypeDef *phost, uint8_t id)
}
//Called from main()
if (id == HOST_USER_CLASS_SELECTED)
if (id == HOST_USER_CLASS_ACTIVE)
{
switch (phost->pActiveClass->ClassCode)
{
@ -201,6 +202,13 @@ void Downstream_HostUserCallback(USBH_HandleTypeDef *phost, uint8_t id)
}
break;
case USB_HID_CLASS:
//FIXME!
newActiveClass = COMMAND_CLASS_HID_MOUSE;
break;
//Add other classes here...

@ -1,4 +1,5 @@
These OpenOCD scripts are used in-place by the Eclipse debug configurations.
The OpenOCD scripts in ./board/ are used in-place by the Eclipse debug configurations. You
don't need to copy them anywhere.
More info for Eclipse OpenOCD configuration:
http://gnuarmeclipse.github.io/debug/openocd/

Loading…
Cancel
Save