Starting to integrate usb branch.

Optimized Makefiles
This commit is contained in:
t-moe
2015-04-03 18:46:25 +02:00
parent 1f2af9f2fb
commit 21dd1e21f7
175 changed files with 88773 additions and 5 deletions

51
discovery/src/main.c Normal file
View File

@@ -0,0 +1,51 @@
#include "main.h"
#include "pixy.h"
USB_OTG_CORE_HANDLE USB_OTG_Core;
USBH_HOST USB_Host;
RCC_ClocksTypeDef RCC_Clocks;
void SysTick_Handler(void)
{
USBH_LL_systick();
}
void TIM2_IRQHandler(void)
{
USB_OTG_BSP_TimerIRQ();
}
void OTG_FS_IRQHandler(void)
{
USBH_OTG_ISR_Handler(&USB_OTG_Core);
}
int main(void)
{
/* Initialize LEDS */
STM_EVAL_LEDInit(LED3);
STM_EVAL_LEDInit(LED4);
STM_EVAL_LEDInit(LED5);
STM_EVAL_LEDInit(LED6);
STM_EVAL_PBInit(BUTTON_USER, BUTTON_MODE_GPIO);
/* Blue Led On: start of application */
STM_EVAL_LEDOn(LED6);
/* SysTick end of count event each 1ms */
RCC_GetClocksFreq(&RCC_Clocks); //we run at 168mhz :)
SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000);
/* Init Host Library */
USBH_Init(&USB_OTG_Core, USB_OTG_FS_CORE_ID, &USB_Host, &USBH_MSC_cb, &USR_Callbacks);
while (1)
{
/* Host Task handler */
USBH_Process(&USB_OTG_Core, &USB_Host);
}
}