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

@@ -55,6 +55,12 @@ bool ll_system_init(void)
return true;
}
void ll_system_process() {
USBH_Process(&USB_OTG_Core, &USB_Host);
}
void ll_system_delay(uint32_t msec) {
USB_OTG_BSP_mDelay(msec);
}

View File

@@ -1,23 +1,11 @@
#include "app.h"
#include "usb_hcd_int.h"
#include "usbh_usr.h"
#include "usbh_core.h"
#include "usbh_msc_core.h"
extern USB_OTG_CORE_HANDLE USB_OTG_Core;
extern USBH_HOST USB_Host;
int main(void)
{
app_init();
while (1)
{
USBH_Process(&USB_OTG_Core, &USB_Host);
app_process();
}

View File

@@ -181,7 +181,6 @@ int USBH_LL_open() {
}
//moved to common
cnt_int=0;
while(cnt_int<timeoutStartup) { //let pixy's led flashing pass
USBH_Process(&USB_OTG_Core, &USB_Host);

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****/