/* report a target failure from the device, this is a callback from the device layer * which uses a mechanism to report errors from the target (i.e. special interrupts) */ static void HTCReportFailure(void *Context) { HTC_TARGET *target = (HTC_TARGET *)Context; target->TargetFailure = TRUE; if ((target->pInstanceContext != NULL) && (HTCInitInfo.TargetFailure != NULL)) { /* let upper layer know, it needs to call HTCStop() */ HTCInitInfo.TargetFailure(target->pInstanceContext, A_ERROR); } }
void HTCFwEventHandler(void *context) { HTC_TARGET *target = (HTC_TARGET *)context; HTC_INIT_INFO *initInfo = &target->HTCInitInfo; /* * Currently, there's only one event type (Target Failure); * there's no need to discriminate between event types. */ if (target->HTCInitInfo.TargetFailure != NULL) { initInfo->TargetFailure(initInfo->pContext, A_ERROR); } }