Added software timers
Accessory state machine framework functional
This commit is contained in:
@@ -41,6 +41,7 @@ extern uint8_t USB_EnterLowpowerMode(void);
|
||||
//Application Includes
|
||||
#include "flashUpdate.h"
|
||||
#include "usbComms.h"
|
||||
#include "System/system.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
@@ -633,7 +634,17 @@ void USB_SendString(uint8_t * str)
|
||||
#if 1 //Send data
|
||||
|
||||
//Wait for USB ready
|
||||
while(!((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))); //TODO: make this not block forever
|
||||
// TODO: Need to timeout here
|
||||
SYSTEM_DATA_t *sys = system_getSys();
|
||||
uint32_t timeout = sys->systemTime + 100;
|
||||
while(!((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions)))
|
||||
{
|
||||
if (sys->systemTime > timeout)
|
||||
{
|
||||
txDataSize = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t size = txDataSize;
|
||||
txDataSize = 0;
|
||||
@@ -642,7 +653,6 @@ void USB_SendString(uint8_t * str)
|
||||
if (error != kStatus_USB_Success)
|
||||
{
|
||||
/* Failure to send Data Handling code here */
|
||||
|
||||
usb.sendErrorCount++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user