diff --git a/Documents/Disc407.bin b/Documents/Disc407.bin index 31a7dbe..93a3881 100755 Binary files a/Documents/Disc407.bin and b/Documents/Disc407.bin differ diff --git a/Documents/STM32pedalStomps.pdf b/Documents/STM32pedalStomps.pdf new file mode 100644 index 0000000..db2a318 Binary files /dev/null and b/Documents/STM32pedalStomps.pdf differ diff --git a/README.md b/README.md index c711e2b..41659d5 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,34 @@ I got great inspiration from 2 open source projects: ## Specifications -* 10 buttons -* 8 potentiometers +### Features +* 10 buttons (9 general purpose + Page2) +* 8 potentiometers (7 general purpose + Mode) * 2 expression pedals * USB MIDI class-compliant +### How to use it +Page2/Looper Btn +* When activated (Led on) use second page for other buttons +* No CC is sent when pressed +Mode potentiometer (#8, the last one) +* Left => Normal mode: Btn sends 127 when activated (Led On) and 0 on deactivation +* Right => Bypass mode: Btn sends 0 when activated (Led On) and 127 on deactivation +* Half => Disable potentiometers CC +* No CC is sent when rotated +Button CC values (excluded Looper/Page2 Btn) + {51, 52, 53, 54, 55, 56, 57, 58, 59} + {61, 62, 63, 64, 65, 66, 67, 68, 69} +Potentiometers CC values (excluded Mode Pot) + {18, 19, 20, 21, 22, 23, 24}; +Expression pedal CC values + {16, 17}; + ## Building Information ### Making hardware -See [Presentation](./Documents/STM32pedalStomps.odp) +See [Presentation](./Documents/STM32pedalStomps.pdf) Basically you should work some wood: @@ -44,7 +62,7 @@ When building the binary file will be created in /stm32/Debug/ or /stm32/Release * [Binary file for STM32F407G-DISC1](./Documents/Disc407.bin) * [STM32CubeIDE Project file](./stm32/) -* [Documentation](./Documents/STM32pedalStomps.odp) +* [Documentation](./Documents/STM32pedalStomps.pdf) ## NOTICE diff --git a/stm32/Core/Inc/CAllDevices.h b/stm32/Core/Inc/CAllDevices.h index 6e6aec7..f9f6850 100755 --- a/stm32/Core/Inc/CAllDevices.h +++ b/stm32/Core/Inc/CAllDevices.h @@ -2,7 +2,7 @@ * AllDevices.h * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CALLDEVICES_H_ diff --git a/stm32/Core/Inc/CDebounce.h b/stm32/Core/Inc/CDebounce.h index 560d646..3978486 100755 --- a/stm32/Core/Inc/CDebounce.h +++ b/stm32/Core/Inc/CDebounce.h @@ -2,7 +2,7 @@ * CDebounce.h * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CDEBOUNCE_H_ diff --git a/stm32/Core/Inc/CExp.h b/stm32/Core/Inc/CExp.h index 35b3a32..2efef18 100755 --- a/stm32/Core/Inc/CExp.h +++ b/stm32/Core/Inc/CExp.h @@ -2,7 +2,7 @@ * CExp.h * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CEXP_H_ diff --git a/stm32/Core/Inc/CFIR.h b/stm32/Core/Inc/CFIR.h index 1f22c5b..0bca2bf 100755 --- a/stm32/Core/Inc/CFIR.h +++ b/stm32/Core/Inc/CFIR.h @@ -2,7 +2,7 @@ * CFIR.h * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CFIR_H_ diff --git a/stm32/Core/Inc/CPot.h b/stm32/Core/Inc/CPot.h index 07d1e60..1109a68 100755 --- a/stm32/Core/Inc/CPot.h +++ b/stm32/Core/Inc/CPot.h @@ -2,7 +2,7 @@ * CPot.h * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CPOT_H_ diff --git a/stm32/Core/Inc/CPwmLed.h b/stm32/Core/Inc/CPwmLed.h index d621ca1..6072d1b 100755 --- a/stm32/Core/Inc/CPwmLed.h +++ b/stm32/Core/Inc/CPwmLed.h @@ -2,7 +2,7 @@ * PwmLed.h * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_PWMLED_H_ diff --git a/stm32/Core/Inc/CStompBtn.h b/stm32/Core/Inc/CStompBtn.h index 47f8770..3ab00d6 100755 --- a/stm32/Core/Inc/CStompBtn.h +++ b/stm32/Core/Inc/CStompBtn.h @@ -2,7 +2,7 @@ * CStompBtn.h * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef SRC_CSTOMPBTN_H_ diff --git a/stm32/Core/Inc/Process.h b/stm32/Core/Inc/Process.h new file mode 100644 index 0000000..d7eb740 --- /dev/null +++ b/stm32/Core/Inc/Process.h @@ -0,0 +1,20 @@ +/* + * Process.h + * + * Created on: 21 May 2021 + * Author: Daniele Caltabiano + */ + +#ifndef INC_PROCESS_H_ +#define INC_PROCESS_H_ + +#ifdef __cplusplus + #define EXTERNC extern "C" +#else + #define EXTERNC +#endif + +EXTERNC void ProcessInit(void); +EXTERNC void ProcessExecute(void); + +#endif /* INC_PROCESS_H_ */ diff --git a/stm32/Core/Inc/midilib.h b/stm32/Core/Inc/midilib.h index 4d36c45..5a1f7d6 100755 --- a/stm32/Core/Inc/midilib.h +++ b/stm32/Core/Inc/midilib.h @@ -2,7 +2,7 @@ * midilib.h * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #ifndef __MIDI_LIB_H diff --git a/stm32/Core/Src/CAllDevices.cpp b/stm32/Core/Src/CAllDevices.cpp index 5e54108..dab15e3 100755 --- a/stm32/Core/Src/CAllDevices.cpp +++ b/stm32/Core/Src/CAllDevices.cpp @@ -2,7 +2,7 @@ * AllDevices.cpp * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CAllDevices.h" @@ -63,8 +63,6 @@ void CAllDevices::Update(void) int i, Mode, StompPolarity, EnablePot; CStompBtn *ActiveLayer; - HAL_Delay(1); - //this->tick++; //Wait USB configuration when USB connection error has occurred. if(USBD_STATE_CONFIGURED != hUsbDeviceFS.dev_state) { this->LedMain.Set(0, 400, 200); @@ -101,6 +99,7 @@ void CAllDevices::Update(void) if (Exp[0].Update()) this->LedMain.Pulse(); if (Exp[1].Update()) this->LedMain.Pulse(); this->LedMain.Update(); + USBD_MIDI_SendPacket(); if( FUNC_SUCCESS == midiGetFromUsbRx(0, &uart_tx_dat) ) { this->LedMain.Pulse(); diff --git a/stm32/Core/Src/CDebounce.cpp b/stm32/Core/Src/CDebounce.cpp index f440bf5..e0ce481 100755 --- a/stm32/Core/Src/CDebounce.cpp +++ b/stm32/Core/Src/CDebounce.cpp @@ -2,7 +2,7 @@ * CDebounce.cpp * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CDebounce.h" diff --git a/stm32/Core/Src/CExp.cpp b/stm32/Core/Src/CExp.cpp index dd13c9e..619880f 100755 --- a/stm32/Core/Src/CExp.cpp +++ b/stm32/Core/Src/CExp.cpp @@ -2,7 +2,7 @@ * CExp.cpp * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CExp.h" diff --git a/stm32/Core/Src/CFIR.cpp b/stm32/Core/Src/CFIR.cpp index a7cbab0..24577e1 100755 --- a/stm32/Core/Src/CFIR.cpp +++ b/stm32/Core/Src/CFIR.cpp @@ -2,7 +2,7 @@ * CFIR.cpp * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CFIR.h" diff --git a/stm32/Core/Src/CPot.cpp b/stm32/Core/Src/CPot.cpp index 0577f77..fc0a024 100755 --- a/stm32/Core/Src/CPot.cpp +++ b/stm32/Core/Src/CPot.cpp @@ -2,7 +2,7 @@ * CPot.cpp * * Created on: May 15, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CPot.h" diff --git a/stm32/Core/Src/CPwmLed.cpp b/stm32/Core/Src/CPwmLed.cpp index 042c302..4325897 100755 --- a/stm32/Core/Src/CPwmLed.cpp +++ b/stm32/Core/Src/CPwmLed.cpp @@ -2,7 +2,7 @@ * PwmLed.cpp * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include diff --git a/stm32/Core/Src/CStompBtn.cpp b/stm32/Core/Src/CStompBtn.cpp index afbef68..0b6b3db 100755 --- a/stm32/Core/Src/CStompBtn.cpp +++ b/stm32/Core/Src/CStompBtn.cpp @@ -2,7 +2,7 @@ * CStompBtn.cpp * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "CStompBtn.h" diff --git a/stm32/Core/Src/Process.cpp b/stm32/Core/Src/Process.cpp new file mode 100644 index 0000000..e305cca --- /dev/null +++ b/stm32/Core/Src/Process.cpp @@ -0,0 +1,23 @@ +/* + * Process.cpp + * + * Created on: 21 May 2021 + * Author: Daniele Caltabiano + */ + + + +#include "Process.h" +#include "CAllDevices.h" + +CAllDevices AllDevices; + +void ProcessInit(void) +{ + +} + +void ProcessExecute(void) +{ + AllDevices.Update(); +} diff --git a/stm32/Core/Src/main.cpp b/stm32/Core/Src/main.c similarity index 96% rename from stm32/Core/Src/main.cpp rename to stm32/Core/Src/main.c index b13e4a8..f733732 100644 --- a/stm32/Core/Src/main.cpp +++ b/stm32/Core/Src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "usbd_midi_if.h" -#include "CAllDevices.h" +#include "Process.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -77,7 +77,7 @@ uint16_t *getADCbuffer(void) int main(void) { /* USER CODE BEGIN 1 */ - CAllDevices AllDevices; + /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ @@ -86,6 +86,7 @@ int main(void) HAL_Init(); /* USER CODE BEGIN Init */ + ProcessInit(); /* USER CODE END Init */ @@ -132,7 +133,8 @@ int main(void) /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ - AllDevices.Update(); + HAL_Delay(1); + ProcessExecute(); } /* USER CODE END 3 */ } diff --git a/stm32/Core/Src/midilib.c b/stm32/Core/Src/midilib.c index 6e28cd1..715d9d8 100755 --- a/stm32/Core/Src/midilib.c +++ b/stm32/Core/Src/midilib.c @@ -2,7 +2,7 @@ * midilib.c * * Created on: May 14, 2021 - * Author: caltabid + * Author: Daniele Caltabiano */ #include "midilib.h" @@ -19,7 +19,6 @@ void sendMidiNote(uint8_t noteOnOff, uint8_t channel, uint8_t pitch, uint8_t vel { midiEventPacket_t MidiMsg = {0x08 | noteOnOff, 0x80 | channel, pitch, velocity}; sendMidiMessage(&MidiMsg.type, 4); - USBD_MIDI_SendPacket(); } // Event type hard-coded (0x0B = control change, aka "MIDI CC"). @@ -31,5 +30,4 @@ void sendMidiCC(uint8_t channel, uint8_t control, uint8_t value) { midiEventPacket_t MidiMsg = {0x0B, 0xB0 | channel, control, value}; sendMidiMessage(&MidiMsg.type, 4); - USBD_MIDI_SendPacket(); }