Simplified code a bit. Emulator does not work stable when replugging pixy.

This commit is contained in:
t-moe
2015-04-25 00:40:23 +02:00
parent 416883c15b
commit 3d1e4b2ef2
11 changed files with 24 additions and 51 deletions

View File

@@ -1,8 +1,6 @@
#include "usbh_usr.h"
#include <stdbool.h>
#include <string.h>
//#include "pixy.h"
USBH_Usr_cb_TypeDef USR_Callbacks =
@@ -55,9 +53,9 @@ void USBH_USR_DeviceAttached(void)
serial_ok=false;
STM_EVAL_LEDOff(LED5);
STM_EVAL_LEDOff(LED3);
STM_EVAL_LEDOn(LED4);
STM_EVAL_LEDOff(LED5);
STM_EVAL_LEDOff(LED3);
STM_EVAL_LEDOn(LED4);
}
/**
@@ -144,7 +142,6 @@ void USBH_USR_Configuration_DescAvailable(USBH_CfgDesc_TypeDef * cfgDesc,
void USBH_USR_Manufacturer_String(void *ManufacturerString)
{
manufacturer_ok = strcmp((char*)ManufacturerString,"Charmed Labs") == 0;
/* callback for Manufacturer String */
}
/**
@@ -155,7 +152,6 @@ void USBH_USR_Manufacturer_String(void *ManufacturerString)
void USBH_USR_Product_String(void *ProductString)
{
product_ok = strcmp((char*)ProductString,"Pixy") == 0;
/* callback for Product String */
}
/**
@@ -166,7 +162,6 @@ void USBH_USR_Product_String(void *ProductString)
void USBH_USR_SerialNum_String(void *SerialNumString)
{
serial_ok = strcmp((char*)SerialNumString,"DEMO 0.0") == 0;
/* callback for SerialNum_String */
}
/**
@@ -220,26 +215,8 @@ void USBH_USR_OverCurrentDetected (void)
* @param None
* @retval Staus
*/
/*int colorind;
const uint32_t colors [] = {0xFF0000, 0x00FF00,0x0000FF,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF,0x000000};
const int num_colors = sizeof(colors)/sizeof(uint32_t);
*/
int USBH_USR_MSC_Application(void)
{
/* if(colorind==0) {
pixy_led_set_max_current(5);
}
int32_t response;
int return_value;
return_value = pixy_command("led_set", INT32(colors[colorind++]), END_OUT_ARGS, &response, END_IN_ARGS);
colorind%=num_colors;
USB_OTG_BSP_mDelay(500);
*/
return 0;
}
@@ -254,10 +231,3 @@ void USBH_USR_DeInit(void)
}
/**
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/