vdeschwb / esp32-signal-generator

Open-Source Signal Generator using the ESP32 uC
MIT License
121 stars 31 forks source link

Bug in Sine Wave Channel Selection #11

Open tirandagan opened 2 years ago

tirandagan commented 2 years ago

Note: the form passes a 1 or 2 as parameter to dac_channel. However to get the sin in channel 1 - you need to pass either a 0 or DAC_CHANNEL_1 (which is a 0) and conversely channel 2 is =1 or DAC_CHANNEL_2

I fixed this by adding the following to handleSetup() in the main (SigGen) file, right before "dac->Setup(dac_channel, clk_div, frequency, scale, phase, invert);":

    if (dac_channel == 1) // Bug in the UI form: Channel 1 should be passed as a "0" and Channel 2 should be passed as a "1"
      dac_channel = DAC_CHANNEL_1;
    else
      dac_channel = DAC_CHANNEL_2;