Originally Posted By: mlord
There were two lines with that setting in mine here, with an #ifdef deciding which one to use.You can test whether or not your mod gets picked up by inserting a #error line there for testing. Eg. #error "it works"


Mark, you are brilliant, thank you. My change isn't getting picked up.

I inserted the #error "it works" , both with and without the quotes (the file has an example of it without the quotes right below there) and tried putting it both before and after some of the #if statements surrounding the SERIAL_BUFFER_SIZE stuff in that section of the code (including placing it before the #ifndef SERIAL_BUFFER_SIZE statement so it should definitely have been hit). The compilation step never blows up with an error message, either when using the installed local Arduino compiler or their online compiler.

So if my issue really is a serial buffer size issue, then this change isn't helping because it's never hitting the change. That's so awesome that you suggested putting an error into the compilation to see if it even hits the code. Super helpful!

I've been googling around trying to find the correct way to do this, and all the answers say either "make sure your code doesn't ever let the buffer fill up" or they suggest changing the exact same line that you already suggested changing.

If the serial buffer does turn out to be the root of the issue, then I would want to rearchitect the code to fix the issue, but before I do that I need to know if that's even the issue at all, so I want to try to get this buffer size experiment working. I'll keep poking at it.

By the way, the file in question was located in this place on the Mac:
Macintosh HD -> /Applications/Arduino (which, once you're inside it, gets listed as "Arduino.app" in the directory tree)
(then you have to open the contents of the "Arduino" App, then)
Contents/Java/hardware/arduino/avr/cores/arduino/USBAPI.h

When compiling I have tried both the "AVR ISP" programmer option and the "AVRISP Mk II" programmer option, and the compiler output says that at least it's hitting the right folder, though I don't see that particular file in the list:

Quote:

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/tonyfabris/Documents/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10805 -build-path /var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320 -warnings=none -build-cache /var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_cache_72365 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/tonyfabris/Documents/Windows Laptop/My Documents/Empeg related documents/BlueGigaEmpeg/BlueGigaEmpeg.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/tonyfabris/Documents/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10805 -build-path /var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320 -warnings=none -build-cache /var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_cache_72365 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/tonyfabris/Documents/Windows Laptop/My Documents/Empeg related documents/BlueGigaEmpeg/BlueGigaEmpeg.ino
Using board 'mega' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/sketch/BlueGigaEmpeg.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/sketch/BlueGigaEmpeg.ino.cpp" -o "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/sketch/BlueGigaEmpeg.ino.cpp" -o "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/sketch/BlueGigaEmpeg.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/BlueGigaEmpeg.ino.elf" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/sketch/BlueGigaEmpeg.ino.cpp.o" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/../arduino_cache_72365/core/core_arduino_avr_mega_cpu_atmega2560_51f02b7210b938436b779d1c032618e1.a" "-L/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320" -lm
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/BlueGigaEmpeg.ino.elf" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/BlueGigaEmpeg.ino.eep"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/BlueGigaEmpeg.ino.elf" "/var/folders/6w/0th2m9n50q5dlyh_93g3_lw40000gn/T/arduino_build_771320/BlueGigaEmpeg.ino.hex"
Sketch uses 19780 bytes (7%) of program storage space. Maximum is 253952 bytes.
Global variables use 2288 bytes (27%) of dynamic memory, leaving 5904 bytes for local variables. Maximum is 8192 bytes.
_________________________
Tony Fabris