Skip to content

Commit

Permalink
Stmduino control bugfix (#31)
Browse files Browse the repository at this point in the history
* fixed stm32h7xx_hal.h dependendy issue

Also changed all imports from hal with double quotes to angle brackets. This should indicate the source of these imports a little better (i.e. not local files).

This addresses the problem raised in #27.

The example sketches build fine on my system (Linux / Ubuntu), and I doubt any other users will encounter platform-specific issues.

* removed temporary caching fix

* Update analog read pin numbers to new format

New version of stm32duino depricates old way we were doing this.
Previously it was just analogRead(18).
Now it needs to be analogRead(A2) for example to read from ADC2

Updated all of the board files to reflect this
Should go through the example sketches and make sure theres no hardcoded
analog reads hanging around

* Fix hardcoded analogread val in seed/knob

* Update version number to 1.4.0

* Fix petal multidelay control bug

Dont call process on a control after already calling ProcessAllControls.
This causes controls to be double processed and leads to major crunch.

* Fix pod/synthvoice bug

Called the now deprecated Led::Update

* Fix petal/multieffect bug

Same control process after processallcontrols bug as petal/multidel

* Fix Patch/FilterBank and Petal/Looper bugs

Same control processing bug as others

Co-authored-by: CorvusPrudens <[email protected]>
  • Loading branch information
beserge and CorvusPrudens authored Jul 6, 2021
1 parent 2360fd0 commit ac3698a
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/Patch/FilterBank/FilterBank.ino
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void UpdateControls()
//controls
for (int i = 0 ; i < 4; i++)
{
float val = patch.controls[i].Process();
float val = patch.controls[i].Value();
if (condUpdates[i].Process(val))
{
filters[i + bank * 4].amp = val;
Expand Down
5 changes: 3 additions & 2 deletions examples/Petal/Looper/Looper.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ void setup() {
rec = false;
play = false;

// start callback
petal.ClearLeds();

// start callback
DAISY.begin(AudioCallback);
}
void loop() {
Expand Down Expand Up @@ -98,7 +99,7 @@ void UpdateButtons() {
void Controls() {
petal.ProcessAllControls();

drywet = petal.controls[0].Process();
drywet = petal.controls[0].Value();

UpdateButtons();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Petal/MultiDelay/MultiDelay.ino
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void ProcessControls()
for(int i = 0; i < 3; i++)
{
delays[i].delayTarget = params[i].Process();
delays[i].feedback = petal.controls[(i * 2) + 1].Process();
delays[i].feedback = petal.controls[(i * 2) + 1].Value();
}

//encoder
Expand Down
8 changes: 4 additions & 4 deletions examples/Petal/MultiEffect/MultiEffect.ino
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ void loop() {

void UpdateKnobs() {
rev.SetLpFreq(reverbLpParam.Process());
rev.SetFeedback(petal.controls[1].Process());
rev.SetFeedback(petal.controls[1].Value());

delayTarget = deltime.Process();
feedback = petal.controls[3].Process();
feedback = petal.controls[3].Value();

crushmod = (int)crushrate.Process();

wah[0].SetWah(petal.controls[5].Process());
wah[1].SetWah(petal.controls[5].Process());
wah[0].SetWah(petal.controls[5].Value());
wah[1].SetWah(petal.controls[5].Value());
}

void UpdateEncoder() {
Expand Down
4 changes: 0 additions & 4 deletions examples/Pod/SynthVoice/SynthVoice.ino
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ void UpdateLeds() {
pod.leds[0].Set(mode == 2, mode == 1, mode == 0);
pod.leds[1].Set(false, selfCycle, selfCycle);

//just for now until the led pwm stuff is resolved
pod.leds[0].Update();
pod.leds[1].Update();

oldk1 = k1;
oldk2 = k2;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Seed/Knob/Knob.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ uint8_t knob_pin;

void setup() {
led_pin = 28;
knob_pin = 21;
knob_pin = A6;
pinMode(led_pin, OUTPUT);
pinMode(knob_pin, INPUT);
}
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=DaisyDuino
version=1.3.0
version=1.4.0
author=stephenhensley
maintainer=Electrosmith
sentence=Arduino library for the Daisy audio platform.
Expand Down
11 changes: 6 additions & 5 deletions src/daisy_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

#define PIN_FIELD_GATE_OUT 15

#define PIN_FIELD_ADC_POT_MUX 16
#define PIN_FIELD_ADC_CV_1 17
#define PIN_FIELD_ADC_CV_2 18
#define PIN_FIELD_ADC_POT_MUX A1

#define PIN_FIELD_ADC_CV_1 A2
#define PIN_FIELD_ADC_CV_2 A3
#define PIN_FIELD_ADC_CV_4 A9 // Jumped on Rev2 from 22
#define PIN_FIELD_ADC_CV_3 A10 // Jumped on Rev2 from 23

#define PIN_FIELD_MUX_SEL_2 19
#define PIN_FIELD_MUX_SEL_1 20
Expand All @@ -31,8 +34,6 @@

#define PIN_FIELD_DAC_2 22 // Jumped on Rev2 from 24
#define PIN_FIELD_DAC_1 23 // Jumped on Rev2 from 25
#define PIN_FIELD_ADC_CV_4 24 // Jumped on Rev2 from 22
#define PIN_FIELD_ADC_CV_3 25 // Jumped on Rev2 from 23

static LedDriverPca9685<2, true>::DmaBuffer DMA_BUFFER_MEM_SECTION
field_led_dma_buffer_a,
Expand Down
8 changes: 4 additions & 4 deletions src/daisy_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#define PIN_PATCH_GATE_IN_1 20
#define PIN_PATCH_GATE_IN_2 19

#define PIN_PATCH_CTRL_1 15
#define PIN_PATCH_CTRL_2 16
#define PIN_PATCH_CTRL_3 21
#define PIN_PATCH_CTRL_4 18
#define PIN_PATCH_CTRL_1 A0
#define PIN_PATCH_CTRL_2 A1
#define PIN_PATCH_CTRL_3 A6
#define PIN_PATCH_CTRL_4 A3

#define PIN_PATCH_CV_1 23
#define PIN_PATCH_CV_2 22
14 changes: 7 additions & 7 deletions src/daisy_petal.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#define PIN_PETAL_ENC_B 27
#define PIN_PETAL_ENC_CLICK 14

#define PIN_PETAL_EXPRESSION 15
#define PIN_PETAL_POT_1 16
#define PIN_PETAL_POT_2 19
#define PIN_PETAL_POT_3 17
#define PIN_PETAL_POT_4 20
#define PIN_PETAL_POT_5 18
#define PIN_PETAL_POT_6 21
#define PIN_PETAL_EXPRESSION A0
#define PIN_PETAL_POT_1 A1
#define PIN_PETAL_POT_2 A4
#define PIN_PETAL_POT_3 A2
#define PIN_PETAL_POT_4 A5
#define PIN_PETAL_POT_5 A3
#define PIN_PETAL_POT_6 A6

//2x pca9685 led driver
#define PIN_PETAL_I2C1_SDA 12
Expand Down
4 changes: 2 additions & 2 deletions src/daisy_pod.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define PIN_POD_POT_1 21
#define PIN_POD_POT_2 15
#define PIN_POD_POT_1 A6
#define PIN_POD_POT_2 A0
#define POD_NUM_POTS 2

#define PIN_POD_SWITCH_1 27
Expand Down

0 comments on commit ac3698a

Please sign in to comment.