Skip to content

Commit f03fb40

Browse files
authored
Merge pull request #325 from Builty/GP5
Merging Gp5 dev branch back to main
2 parents cc96857 + 5f1ba35 commit f03fb40

File tree

124 files changed

+56000
-17288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+56000
-17288
lines changed

.gitignore

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,5 @@
33

44
build_distrib/temp
55

6-
# ignore SquareLine Studio files
7-
ui_design/backup
8-
ui_design/cache
9-
ui_design/autosave
10-
ui_design_0.85/backup
11-
ui_design_0.85/cache
12-
ui_design_0.85/autosave
13-
ui_design_1.69/backup
14-
ui_design_1.69/cache
15-
ui_design_1.69/autosave
16-
ui_design_1.69_land/backup
17-
ui_design_1.69_land/cache
18-
ui_design_1.69_land/autosave
19-
ui_design_1.9/backup
20-
ui_design_1.9/cache
21-
ui_design_1.9/autosave
22-
ui_design_480x320land/backup
23-
ui_design_480x320land/cache
24-
ui_design_480x320land/autosave
25-
26-
6+
# ignore EEZ Studio state files
7+
**/*.eez-project-ui-state

source/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ build_lgtdisps3/
1818
build_ws19t/
1919
build_ws35b/
2020
build_jc3248w/
21+
build_piratemax35/
22+
build_piratepro/
2123

2224
# ignore everything in managed components directory. Will be generated by the build system
2325
managed_components/

source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(CONFIG_TONEX_CONTROLLER_DISPLAY_FULL_UI)
2020
set(image_file ${project_dir}/skin_images/16bit/skins_minimal.bin)
2121
endif()
2222

23-
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_JC3248W535)
23+
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_JC3248W535 OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_PIRATE_MIDI_POLAR_MAX_V2)
2424
set(image_file ${project_dir}/skin_images/16bitswapped/skins.bin)
2525
endif()
2626

source/components/esp_lcd_touch_ft6336/esp_lcd_touch_ft6336.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static esp_err_t esp_lcd_touch_ft6336_del(esp_lcd_touch_handle_t tp)
220220
}
221221

222222

223-
static esp_err_t touch_ft6336_i2c_write(esp_lcd_touch_handle_t tp, uint8_t reg, uint8_t data)
223+
static esp_err_t __attribute__((unused)) touch_ft6336_i2c_write(esp_lcd_touch_handle_t tp, uint8_t reg, uint8_t data)
224224
{
225225
assert(tp != NULL);
226226

source/components/lvgl__lvgl/src/lv_conf_internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,30 +160,30 @@
160160
#else /*LV_MEM_CUSTOM*/
161161
#ifndef LV_MEM_CUSTOM_INCLUDE
162162
#ifdef CONFIG_LV_MEM_CUSTOM_INCLUDE
163-
#define LV_MEM_CUSTOM_INCLUDE CONFIG_LV_MEM_CUSTOM_INCLUDE
163+
#define LV_MEM_CUSTOM_INCLUDE "esp_heap_caps.h" //CONFIG_LV_MEM_CUSTOM_INCLUDE
164164
#else
165-
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
165+
#define LV_MEM_CUSTOM_INCLUDE "esp_heap_caps.h" /*Header for the dynamic memory function*/
166166
#endif
167167
#endif
168168
#ifndef LV_MEM_CUSTOM_ALLOC
169169
#ifdef CONFIG_LV_MEM_CUSTOM_ALLOC
170170
#define LV_MEM_CUSTOM_ALLOC CONFIG_LV_MEM_CUSTOM_ALLOC
171171
#else
172-
#define LV_MEM_CUSTOM_ALLOC malloc
172+
#define LV_MEM_CUSTOM_ALLOC(size) heap_caps_malloc((size), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)
173173
#endif
174174
#endif
175175
#ifndef LV_MEM_CUSTOM_FREE
176176
#ifdef CONFIG_LV_MEM_CUSTOM_FREE
177177
#define LV_MEM_CUSTOM_FREE CONFIG_LV_MEM_CUSTOM_FREE
178178
#else
179-
#define LV_MEM_CUSTOM_FREE free
179+
#define LV_MEM_CUSTOM_FREE(ptr) heap_caps_free(ptr)
180180
#endif
181181
#endif
182182
#ifndef LV_MEM_CUSTOM_REALLOC
183183
#ifdef CONFIG_LV_MEM_CUSTOM_REALLOC
184184
#define LV_MEM_CUSTOM_REALLOC CONFIG_LV_MEM_CUSTOM_REALLOC
185185
#else
186-
#define LV_MEM_CUSTOM_REALLOC realloc
186+
#define LV_MEM_CUSTOM_REALLOC(ptr, new_size) heap_caps_realloc((ptr), (new_size), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)
187187
#endif
188188
#endif
189189
#endif /*LV_MEM_CUSTOM*/

source/esp_idf_project_configuration.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,5 +466,57 @@
466466
"postBuild": "",
467467
"postFlash": ""
468468
}
469+
},
470+
"PiratePro": {
471+
"build": {
472+
"compileArgs": [],
473+
"ninjaArgs": [],
474+
"buildDirectoryPath": "${workspaceFolder}/build_piratepro",
475+
"sdkconfigDefaults": [
476+
"sdkconfig.defaults",
477+
"sdkconfig.piratepro"
478+
],
479+
"sdkconfigFilePath": "${workspaceFolder}/build_piratepro"
480+
},
481+
"env": {},
482+
"flashBaudRate": "",
483+
"monitorBaudRate": "",
484+
"openOCD": {
485+
"debugLevel": 0,
486+
"configs": [],
487+
"args": []
488+
},
489+
"tasks": {
490+
"preBuild": "",
491+
"preFlash": "",
492+
"postBuild": "",
493+
"postFlash": ""
494+
}
495+
},
496+
"PirateMaxV2": {
497+
"build": {
498+
"compileArgs": [],
499+
"ninjaArgs": [],
500+
"buildDirectoryPath": "${workspaceFolder}/build_piratemax35",
501+
"sdkconfigDefaults": [
502+
"sdkconfig.defaults",
503+
"sdkconfig.piratemax35"
504+
],
505+
"sdkconfigFilePath": "${workspaceFolder}/build_piratemax35"
506+
},
507+
"env": {},
508+
"flashBaudRate": "",
509+
"monitorBaudRate": "",
510+
"openOCD": {
511+
"debugLevel": 0,
512+
"configs": [],
513+
"args": []
514+
},
515+
"tasks": {
516+
"preBuild": "",
517+
"preFlash": "",
518+
"postBuild": "",
519+
"postFlash": ""
520+
}
469521
}
470522
}

source/main/CMakeLists.txt

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
2-
idf_component_register(SRCS "valeton_params.c" "midi_control.c" "control.c" "footswitches.c" "CH422G.c" "display.c" "main.c" "tonex_params.c" "SX1509.c"
3-
"usb_comms.c" "usb_tonex_one.c" "usb_tonex_common.c" "usb_tonex.c" "usb_valeton_gp5.c" "CH422G.c" "midi_serial.c" "wifi_config.c" "leds.c" "midi_helper.c" "LP5562.c"
1+
idf_component_register(SRCS "platform_pirate_pro_169.c" "platform_pirate_max35.c" "valeton_params.c" "midi_control.c" "control.c" "footswitches.c" "CH422G.c" "display.c" "main.c" "tonex_params.c" "SX1509.c" "display_tonex.c" "display_valeton.c"
2+
"usb_comms.c" "usb_tonex_one.c" "usb_tonex_common.c" "usb_tonex.c" "usb_valeton_gp5.c" "CH422G.c" "midi_serial.c" "wifi_config.c" "leds.c" "midi_helper.c" "midi_helper_tonex.c" "midi_helper_valeton.c" "LP5562.c"
43
"platform_devkitc.c" "platform_lgtdisps3.c" "platform_m5atoms3r.c" "platform_ws19t.c" "platform_ws43.c" "platform_wszero.c" "platform_ws169.c"
54
"platform_ws35b.c" "platform_jc3248w.c"
6-
INCLUDE_DIRS "." "./"
7-
EMBED_TXTFILES index.html)
8-
5+
INCLUDE_DIRS "." "./"
6+
EMBED_FILES
7+
"web/index.html" "web/amp_disabled.png" "web/amp_off.png" "web/amp_on.png" "web/cab_disabled.png" "web/cab_off.png" "web/cab_on.png"
8+
"web/dly_off.png" "web/dly_on.png" "web/dst_off.png" "web/dst_on.png" "web/effect_icon_amp_off.png" "web/effect_icon_amp_on.png"
9+
"web/effect_icon_cab_off.png" "web/effect_icon_cab_on.png" "web/effect_icon_comp_off.png" "web/effect_icon_comp_on.png"
10+
"web/effect_icon_delay_off.png" "web/effect_icon_delay_on_d.png" "web/effect_icon_delay_on_t.png" "web/effect_icon_eq.png"
11+
"web/effect_icon_gate_on.png" "web/effect_icon_gate_off.png" "web/effect_icon_mod_off.png" "web/effect_icon_mod_on_chorus.png"
12+
"web/effect_icon_mod_on_flanger.png" "web/effect_icon_mod_on_phaser.png" "web/effect_icon_mod_on_rotary.png" "web/effect_icon_mod_on_tremolo.png"
13+
"web/effect_icon_reverb_off.png" "web/effect_icon_reverb_on.png" "web/effect_icon_reverb_on_p.png" "web/effect_icon_reverb_on_r.png"
14+
"web/effect_icon_reverb_on_s1.png" "web/effect_icon_reverb_on_s2.png" "web/effect_icon_reverb_on_s3.png" "web/effect_icon_reverb_on_s4.png"
15+
"web/eq_off.png" "web/eq_on.png" "web/mod_off.png" "web/mod_on.png" "web/nr_off.png" "web/nr_on.png" "web/pre_off.png" "web/pre_on.png"
16+
"web/rvb_off.png" "web/rvb_on.png" "web/tc_off.png" "web/tc_on.png"
17+
"web/favicon.ico" "web/bootstrap.js" "web/jquery.js" "web/index.css" "web/bootstrap.css" "web/script.js"
18+
)
19+
920
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_43B OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_43DEVONLY)
1021
target_include_directories(${COMPONENT_LIB} PRIVATE include "ui_generated_800x480land")
1122

@@ -38,14 +49,14 @@ if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_43B OR CONFIG_TONEX_CONTR
3849
"ui_generated_800x480land/ui_image_nr_off.c" "ui_generated_800x480land/ui_image_nr_on.c"
3950
"ui_generated_800x480land/ui_image_rvb_off.c" "ui_generated_800x480land/ui_image_rvb_on.c"
4051
"ui_generated_800x480land/ui_image_tc_off.c" "ui_generated_800x480land/ui_image_tc_on.c"
41-
"ui_generated_800x480land/ui_image_amp_off.c" "ui_generated_800x480land/ui_image_amp_on.c"
52+
"ui_generated_800x480land/ui_image_amp_off.c" "ui_generated_800x480land/ui_image_amp_on.c" "ui_generated_800x480land/ui_image_amp_disabled.c"
4253
"ui_generated_800x480land/ui_image_dly_off.c" "ui_generated_800x480land/ui_image_dly_on.c"
4354
"ui_generated_800x480land/ui_image_dst_off.c" "ui_generated_800x480land/ui_image_dst_on.c"
44-
"ui_generated_800x480land/ui_image_cab_off.c" "ui_generated_800x480land/ui_image_cab_on.c"
55+
"ui_generated_800x480land/ui_image_cab_off.c" "ui_generated_800x480land/ui_image_cab_on.c" "ui_generated_800x480land/ui_image_cab_disabled.c"
4556
"ui_generated_800x480land/ui_image_skin_jcm.c")
4657
endif()
4758

48-
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_JC3248W535)
59+
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_JC3248W535 OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_PIRATE_MIDI_POLAR_MAX_V2)
4960
target_include_directories(${COMPONENT_LIB} PRIVATE include "ui_generated_480x320land")
5061

5162
target_sources(${COMPONENT_LIB} PRIVATE "ui_generated_480x320land/ui.c" "ui_generated_480x320land/styles.c"
@@ -54,8 +65,8 @@ if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTR
5465
"ui_generated_480x320land/ui_image_usb_fail.c" "ui_generated_480x320land/ui_image_next.c" "ui_generated_480x320land/ui_image_previous.c"
5566
"ui_generated_480x320land/ui_image_usb_ok.c" "ui_generated_480x320land/ui_image_next_down.c" "ui_generated_480x320land/ui_image_previous_down.c" "ui_generated_480x320land/ui_image_settings.c"
5667
"ui_generated_480x320land/ui_image_wifi_conn.c" "ui_generated_480x320land/ui_image_wifi_disconn.c"
57-
"ui_generated_480x320land/ui_image_effect_icon_amp_off.c" "ui_generated_480x320land/ui_image_effect_icon_amp_on.c"
58-
"ui_generated_480x320land/ui_image_effect_icon_cab_off.c" "ui_generated_480x320land/ui_image_effect_icon_cab_on.c"
68+
"ui_generated_480x320land/ui_image_effect_icon_amp_off.c" "ui_generated_480x320land/ui_image_effect_icon_amp_on.c" "ui_generated_480x320land/ui_image_amp_disabled.c"
69+
"ui_generated_480x320land/ui_image_effect_icon_cab_off.c" "ui_generated_480x320land/ui_image_effect_icon_cab_on.c" "ui_generated_480x320land/ui_image_cab_disabled.c"
5970
"ui_generated_480x320land/ui_image_effect_icon_comp_off.c" "ui_generated_480x320land/ui_image_effect_icon_comp_on.c"
6071
"ui_generated_480x320land/ui_image_effect_icon_delay_off.c"
6172
"ui_generated_480x320land/ui_image_effect_icon_gate_off.c" "ui_generated_480x320land/ui_image_effect_icon_gate_on.c"
@@ -84,7 +95,7 @@ if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_35B OR CONFIG_TONEX_CONTR
8495
"ui_generated_480x320land/ui_image_skin_jcm.c")
8596
endif()
8697

87-
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_169 OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_169TOUCH)
98+
if(CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_169 OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_169TOUCH OR CONFIG_TONEX_CONTROLLER_HARDWARE_PLATFORM_PIRATE_MIDI_POLAR_PRO)
8899
if(CONFIG_TONEX_CONTROLLER_WAVESHARE_169_LANDSCAPE)
89100
target_include_directories(${COMPONENT_LIB} PRIVATE include "ui_generated_280x240land")
90101

source/main/Kconfig.projbuild

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ menu "Tonex Controller Configuration"
3636

3737
config TONEX_CONTROLLER_HARDWARE_PLATFORM_WAVESHARE_19TOUCH
3838
bool "Waveshare 1.9 Touch"
39+
40+
config TONEX_CONTROLLER_HARDWARE_PLATFORM_PIRATE_MIDI_POLAR_PRO
41+
bool "Pirate Midi Polar Pro 1.69"
42+
43+
config TONEX_CONTROLLER_HARDWARE_PLATFORM_PIRATE_MIDI_POLAR_MAX_V2
44+
bool "Pirate Midi Polar Max V2 3.5 touch"
3945

4046
endchoice
4147

@@ -94,11 +100,41 @@ menu "Tonex Controller Configuration"
94100
Enable this option to show BPM indicator
95101

96102
config TONEX_CONTROLLER_ENABLE_MIDI_THRU
97-
bool "Enable Midi Thru"
103+
bool "Enable Midi Thru"
98104
default "y"
99105
help
100106
Enable this option if the platform can support Midi Transmit
101-
107+
108+
choice TONEX_CONTROLLER_LED_CONTROL_MODE
109+
prompt "Led control mode"
110+
default TONEX_CONTROLLER_LED_CONTROL_DISABLED
111+
112+
config TONEX_CONTROLLER_LED_CONTROL_DISABLED
113+
bool "Disabled"
114+
115+
config TONEX_CONTROLLER_LED_CONTROL_BOOT_FLASH
116+
bool "Boot flash"
117+
endchoice
118+
119+
choice TONEX_CONTROLLER_LED_COLOUR_ORDER
120+
prompt "Led colour order"
121+
default TONEX_CONTROLLER_LED_COLOUR_ORDER_RGB
122+
123+
config TONEX_CONTROLLER_LED_COLOUR_ORDER_RGB
124+
bool "RGB"
125+
126+
config TONEX_CONTROLLER_LED_COLOUR_ORDER_GBR
127+
bool "GBR"
128+
129+
endchoice
130+
131+
config TONEX_CONTROLLER_LED_NUMBER
132+
int "Number of Leds"
133+
range 0 16
134+
default 0
135+
help
136+
Set the number of leds the platform has
137+
102138
config EXAMPLE_DOUBLE_FB
103139
bool "Use double Frame Buffer"
104140
default "n"

source/main/control.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ limitations under the License.
4343
#include "wifi_config.h"
4444
#include "task_priorities.h"
4545
#include "tonex_params.h"
46+
#include "valeton_params.h"
4647

4748
#define CTRL_TASK_STACK_SIZE (3 * 1024)
4849

@@ -892,7 +893,20 @@ static uint8_t process_control_command(tControlMessage* message)
892893
ESP_LOGI(TAG, "Tap Tempo BPM = %d", (int)bpm);
893894

894895
// update pedal
895-
usb_modify_parameter(TONEX_GLOBAL_BPM, ControlData.TapTempo.BPM);
896+
switch (usb_get_connected_modeller_type())
897+
{
898+
case AMP_MODELLER_TONEX_ONE: // fallthrough
899+
case AMP_MODELLER_TONEX: // fallthrough
900+
default:
901+
{
902+
usb_modify_parameter(TONEX_GLOBAL_BPM, ControlData.TapTempo.BPM);
903+
} break;
904+
905+
case AMP_MODELLER_VALETON_GP5:
906+
{
907+
usb_modify_parameter(VALETON_GLOBAL_BPM, ControlData.TapTempo.BPM);
908+
} break;
909+
}
896910

897911
// save time for next trigger
898912
ControlData.TapTempo.LastTime = current_time;

source/main/control.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ enum WiFiTxPower
191191
WIFI_TX_POWER_100
192192
};
193193

194-
enum ConfigTabs43B
194+
enum ConfigTabs43BTonex
195195
{
196196
CONFIG_TAB_GATE,
197197
CONFIG_TAB_COMPRESSOR,
@@ -203,6 +203,21 @@ enum ConfigTabs43B
203203
CONFIG_TAB_GLOBAL,
204204
};
205205

206+
enum ConfigTabs43BValeton
207+
{
208+
CONFIG_TAB_VAL_NR,
209+
CONFIG_TAB_VAL_PRE,
210+
CONFIG_TAB_VAL_DST,
211+
CONFIG_TAB_VAL_AMP,
212+
CONFIG_TAB_VAL_CAB,
213+
CONFIG_TAB_VAL_EQ,
214+
CONFIG_TAB_VAL_MOD,
215+
CONFIG_TAB_VAL_DLY,
216+
CONFIG_TAB_VAL_RVB,
217+
CONFIG_TAB_VAL_NS,
218+
CONFIG_TAB_VAL_GLOBAL,
219+
};
220+
206221
enum FootswitchLayouts
207222
{
208223
FOOTSWITCH_LAYOUT_1X2, // next/previous
@@ -254,13 +269,19 @@ enum ParamTypes
254269

255270
#define MAX_PARAM_NAME 12
256271

272+
// special cases for handling effect switches that use Midi but don't change a parameter
273+
#define TONEX_UNKNOWN 0xFFFF
274+
257275
typedef struct
258276
{
259277
float Value;
260278
float Min;
261279
float Max;
262280
char Name[MAX_PARAM_NAME];
263281
uint8_t Type;
282+
uint8_t Data1; // usage depends on connected modeller
283+
uint8_t Data2; // usage depends on connected modeller
284+
uint8_t Data3; // usage depends on connected modeller
264285
} tModellerParameter;
265286

266287
typedef struct __attribute__ ((packed))

0 commit comments

Comments
 (0)