Skip to content

Commit

Permalink
Try USBGadgetPin (#670)
Browse files Browse the repository at this point in the history
* Try USBGadgetPin

* CGPIOPin usbGadgetPin(usbGadgetPinNumber, GPIOModeInputPullUp);

* Remove extraneous line
  • Loading branch information
probonopd authored Jul 5, 2024
1 parent 98b5274 commit 75e82ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
#include "config.h"
#include "../Synth_Dexed/src/dexed.h"
#include <circle/gpiopin.h>

CConfig::CConfig (FATFS *pFileSystem)
: m_Properties ("minidexed.ini", pFileSystem)
Expand All @@ -37,6 +38,13 @@ void CConfig::Load (void)
m_Properties.Load ();

m_bUSBGadgetMode = m_Properties.GetNumber ("USBGadget", 0) != 0;
unsigned usbGadgetPinNumber = m_Properties.GetNumber ("USBGadgetPin", 26); // Default to GPIO pin 26 if not specified
CGPIOPin usbGadgetPin(usbGadgetPinNumber, GPIOModeInputPullUp);

if (usbGadgetPin.Read() == 0) // If the pin is pulled down
{
m_bUSBGadgetMode = true;
}

m_SoundDevice = m_Properties.GetString ("SoundDevice", "pwm");

Expand Down

0 comments on commit 75e82ca

Please sign in to comment.