USB_ReferenceDeregister (SWI&55386)

USB_ReferenceDeregister (SWI&55386) — Deregisters a reference to an object.

On Entry

R0Pointer to the structure at which a reference should be deregistered.
R2Object type Table A.8, “Object reference types”
R3Reserved. Must be set to zero.
R4Reserved. Must be set to zero.

On Exit

R0preserved
R1Error code Table A.1, “Error codes used by the USB system”
R2, R3, R4Preserved

Use

The reference to the object structure is deregistered automatically in every case.

If your no longer wants to use an object to which the application is holding a reference this reference must be deregistered. Normally this is done automatically by using the according functions (eg. USB_EndpointDeregister). But think about the situation that your application has only got a reference to an object by using USB_FindObject (SWI&55387) to enumerate its child's or something like that. In this case USB_FindObject has generated a reference which is protecting the object by deleting which must deregistered if the object is not longer used by the application. If your application was the last one holding a reference to that object it will be removed physically from memory.

Related SWI's

USB_FindObject (SWI&55387)