Hi
We are making a USB audio product based on the usb audio framework... Our device can run on USB Power or with a battery attached. The thing I want to do is this:
- Detect whether battery power is used with a GPIO on startup.
- Depending on the GPIO-state report myself as a self-powered (or not self-powered) device via USB
The problem is that in the USB audio framework, the SELF_POWERED flag is defined in compile-time. Can anyone tell me where I'd have to apply changes to make it dynamic?
Markus
Define SELF_POWERED in run-time
-
- Member
- Posts: 11
- Joined: Tue Dec 20, 2016 4:09 pm
-
- Respected Member
- Posts: 275
- Joined: Fri Mar 12, 2010 6:03 pm
I think you'll need to write all device/configuration bytes at runtime that are currently under
Code: Select all
#ifdef SELF_POWERED