|
|
@ -39,9 +39,8 @@ void CConfig::Load (void) |
|
|
|
|
|
|
|
|
|
|
|
m_bUSBGadgetMode = m_Properties.GetNumber ("USBGadget", 0) != 0; |
|
|
|
m_bUSBGadgetMode = m_Properties.GetNumber ("USBGadget", 0) != 0; |
|
|
|
unsigned usbGadgetPinNumber = m_Properties.GetNumber ("USBGadgetPin", 26); // Default to GPIO pin 26 if not specified
|
|
|
|
unsigned usbGadgetPinNumber = m_Properties.GetNumber ("USBGadgetPin", 26); // Default to GPIO pin 26 if not specified
|
|
|
|
CGPIOPin usbGadgetPin(usbGadgetPinNumber); |
|
|
|
CGPIOPin usbGadgetPin(usbGadgetPinNumber, GPIOModeInputPullUp); |
|
|
|
usbGadgetPin.Input(); |
|
|
|
|
|
|
|
usbGadgetPin.PullUp(); // Enable the internal pull-up resistor
|
|
|
|
|
|
|
|
if (usbGadgetPin.Read() == 0) // If the pin is pulled down
|
|
|
|
if (usbGadgetPin.Read() == 0) // If the pin is pulled down
|
|
|
|
{ |
|
|
|
{ |
|
|
|
m_bUSBGadgetMode = true; |
|
|
|
m_bUSBGadgetMode = true; |
|
|
|