diff --git a/dexed_sysex.cpp b/dexed_sysex.cpp index acd5a44..9bda430 100644 --- a/dexed_sysex.cpp +++ b/dexed_sysex.cpp @@ -38,10 +38,10 @@ bool get_bank_name(uint8_t b) if (sd_card_available) { - char bankdir[3]; + char bankdir[4]; + memset(bankdir, 0, sizeof(bankdir)); bankdir[0] = '/'; - bankdir[2] = '\0'; itoa(b, &bankdir[1], 10); root = SD.open(bankdir); @@ -63,7 +63,16 @@ bool get_bank_name(uint8_t b) else { if (!entry.isDirectory()) - strcpy(bank_name, entry.name()); + { + char *token; + + token = strtok(entry.name(), "."); + if (token != NULL) + strcpy(bank_name, token); + else + strcpy(bank_name, "*ERROR*"); + return (true); + } } } } @@ -122,8 +131,13 @@ bool load_sysex(uint8_t b, uint8_t v) Serial.println(F("]")); #endif - strcpy(bank_name, entry.name()); + char *token; + token = strtok(entry.name(), "."); + if (token != NULL) + strcpy(bank_name, token); + else + strcpy(bank_name, "*ERROR*"); return (dexed->loadSysexVoice(data)); } else diff --git a/~/.arduino15/preferences-teensy.txt b/~/.arduino15/preferences-teensy.txt new file mode 100644 index 0000000..682c406 --- /dev/null +++ b/~/.arduino15/preferences-teensy.txt @@ -0,0 +1,96 @@ +board=teensy36 +boardsmanager.additional.urls= +browser=mozilla +build.verbose=false +build.warn_data_percentage=75 +compiler.cache_core=true +compiler.warning_level=none +console=true +console.auto_clear=true +console.error.file=stderr.txt +console.length=500 +console.lines=4 +console.output.file=stdout.txt +custom_keys=teensy36_en-us +custom_opt=teensy36_o2std +custom_speed=teensy36_180 +custom_usb=teensy36_serial +editor.antialias=true +editor.auto_close_braces=true +editor.caret.blink=true +editor.code_folding=false +editor.divider.size=0 +editor.external=false +editor.font=Monospaced,plain,12 +editor.indent=true +editor.invalid=false +editor.keys.alternative_cut_copy_paste=true +editor.keys.home_and_end_beginning_end_of_doc=false +editor.keys.shift_backspace_is_delete=true +editor.languages.current= +editor.linenumbers=false +editor.save_on_verify=true +editor.tabs.expand=true +editor.tabs.size=2 +editor.update_extension=true +editor.window.height.default=600 +editor.window.height.min=290 +editor.window.width.default=500 +editor.window.width.min=400 +export.applet.separate_jar_files=false +export.application.fullscreen=false +export.application.platform=true +export.application.stop=true +export.delete_target_folder=true +gui.scale=auto +last.ide.1.8.7.daterun=1537512866 +last.ide.1.8.7.hardwarepath=/home/local/arduino-1.8.7-teensy/hardware +last.sketch.count=1 +last.sketch.default.location=710,240,500,600,-1,0 +last.sketch.default.path=/tmp/untitled2066889805.tmp/sketch_sep21a/sketch_sep21a.ino +last.sketch0.location=1327,470,500,600,-1,0 +last.sketch0.path=/home/wirtz/Arduino-Teensy/MicroDexed/MicroDexed.ino +launcher=xdg-open +platform.auto_file_type_associations=true +preferences.readonly=false +preproc.color_datatype=true +preproc.enhanced_casting=true +preproc.imports.list=java.applet.*,java.awt.Dimension,java.awt.Frame,java.awt.event.MouseEvent,java.awt.event.KeyEvent,java.awt.event.FocusEvent,java.awt.Image,java.io.*,java.net.*,java.text.*,java.util.*,java.util.zip.*,java.util.regex.* +preproc.output_parse_tree=false +preproc.save_build_files=false +preproc.substitute_floats=true +preproc.substitute_unicode=true +preproc.web_colors=true +programmer=arduino:avrispmkii +proxy.manual.hostname= +proxy.manual.password= +proxy.manual.port= +proxy.manual.type=HTTP +proxy.manual.username= +proxy.pac.url= +proxy.type=auto +recent.sketches=/home/wirtz/Arduino-Teensy/MicroDexed/MicroDexed.ino, +run.display=1 +run.options= +run.options.memory=false +run.options.memory.initial=64 +run.options.memory.maximum=256 +run.present.bgcolor=#666666 +run.present.exclusive=false +run.present.stop.color=#cccccc +serial.databits=8 +serial.debug_rate=9600 +serial.line_ending=1 +serial.parity=N +serial.port= +serial.stopbits=1 +sketchbook.path=/home/wirtz/Arduino-Teensy +software=ARDUINO +target_package=teensy +target_platform=avr +theme.file= +update.check=true +update.id=2765771547162134236 +upload.using=bootloader +upload.verbose=false +upload.verify=true