added soundOnGPIOCounter soundOnGPIOFreq to options.txt

This commit is contained in:
penfold42 2018-06-12 11:17:52 +10:00
parent 113653a1ce
commit cd7f8e3fef
3 changed files with 11 additions and 2 deletions

View file

@ -721,7 +721,8 @@ void emulator()
int headSoundFreqCounter = 0; int headSoundFreqCounter = 0;
//const int headSoundFreq = 3333; // 300Hz = 1/300 * 10^6; //const int headSoundFreq = 3333; // 300Hz = 1/300 * 10^6;
//const int headSoundFreq = 1666; // 600Hz = 1/600 * 10^6; //const int headSoundFreq = 1666; // 600Hz = 1/600 * 10^6;
const int headSoundFreq = 833; // 1200Hz = 1/1200 * 10^6; // const int headSoundFreq = 833; // 1200Hz = 1/1200 * 10^6;
const int headSoundFreq = options.SoundOnGPIOFreq(); // 1200Hz = 1/1200 * 10^6;
unsigned char oldHeadDir; unsigned char oldHeadDir;
unsigned numberOfImages = diskCaddy.GetNumberOfImages(); unsigned numberOfImages = diskCaddy.GetNumberOfImages();
@ -801,7 +802,7 @@ void emulator()
oldHeadDir = headDir; oldHeadDir = headDir;
if (options.SoundOnGPIO()) if (options.SoundOnGPIO())
{ {
headSoundCounter = 1000000; headSoundCounter = options.SoundOnGPIOCounter();
headSoundFreqCounter = headSoundFreq; headSoundFreqCounter = headSoundFreq;
} }
else else

View file

@ -129,6 +129,8 @@ Options::Options(void)
, quickBoot(0) , quickBoot(0)
, displayPNGIcons(0) , displayPNGIcons(0)
, soundOnGPIO(0) , soundOnGPIO(0)
, soundOnGPIOCounter(1000000)
, soundOnGPIOFreq(833)
, invertIECInputs(0) , invertIECInputs(0)
, invertIECOutputs(1) , invertIECOutputs(1)
, splitIECLines(0) , splitIECLines(0)
@ -183,6 +185,8 @@ void Options::Process(char* buffer)
ELSE_CHECK_DECIMAL_OPTION(quickBoot) ELSE_CHECK_DECIMAL_OPTION(quickBoot)
ELSE_CHECK_DECIMAL_OPTION(displayPNGIcons) ELSE_CHECK_DECIMAL_OPTION(displayPNGIcons)
ELSE_CHECK_DECIMAL_OPTION(soundOnGPIO) ELSE_CHECK_DECIMAL_OPTION(soundOnGPIO)
ELSE_CHECK_DECIMAL_OPTION(soundOnGPIOCounter)
ELSE_CHECK_DECIMAL_OPTION(soundOnGPIOFreq)
ELSE_CHECK_DECIMAL_OPTION(invertIECInputs) ELSE_CHECK_DECIMAL_OPTION(invertIECInputs)
ELSE_CHECK_DECIMAL_OPTION(invertIECOutputs) ELSE_CHECK_DECIMAL_OPTION(invertIECOutputs)
ELSE_CHECK_DECIMAL_OPTION(splitIECLines) ELSE_CHECK_DECIMAL_OPTION(splitIECLines)

View file

@ -58,6 +58,8 @@ public:
inline unsigned int QuickBoot() const { return quickBoot; } inline unsigned int QuickBoot() const { return quickBoot; }
inline unsigned int DisplayPNGIcons() const { return displayPNGIcons; } inline unsigned int DisplayPNGIcons() const { return displayPNGIcons; }
inline unsigned int SoundOnGPIO() const { return soundOnGPIO; } inline unsigned int SoundOnGPIO() const { return soundOnGPIO; }
inline unsigned int SoundOnGPIOCounter() const { return soundOnGPIOCounter; }
inline unsigned int SoundOnGPIOFreq() const { return soundOnGPIOFreq; }
inline unsigned int SplitIECLines() const { return splitIECLines; } inline unsigned int SplitIECLines() const { return splitIECLines; }
inline unsigned int InvertIECInputs() const { return invertIECInputs; } inline unsigned int InvertIECInputs() const { return invertIECInputs; }
inline unsigned int InvertIECOutputs() const { return invertIECOutputs; } inline unsigned int InvertIECOutputs() const { return invertIECOutputs; }
@ -88,6 +90,8 @@ private:
unsigned int quickBoot; unsigned int quickBoot;
unsigned int displayPNGIcons; unsigned int displayPNGIcons;
unsigned int soundOnGPIO; unsigned int soundOnGPIO;
unsigned int soundOnGPIOCounter;
unsigned int soundOnGPIOFreq;
unsigned int invertIECInputs; unsigned int invertIECInputs;
unsigned int invertIECOutputs; unsigned int invertIECOutputs;
unsigned int splitIECLines; unsigned int splitIECLines;