diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 561127f9f..2523865ef 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -44,21 +44,33 @@ #if defined(HAVE_HWSERIAL0) void serialEvent() __attribute__((weak)); bool Serial0_available() __attribute__((weak)); + + void serialEvent() { } + bool Serial0_available() { return false; } #endif #if defined(HAVE_HWSERIAL1) void serialEvent1() __attribute__((weak)); bool Serial1_available() __attribute__((weak)); + + void serialEvent1() { } + bool Serial1_available() { return false; } #endif #if defined(HAVE_HWSERIAL2) void serialEvent2() __attribute__((weak)); bool Serial2_available() __attribute__((weak)); + + void serialEvent2() { } + bool Serial2_available() { return false; } #endif #if defined(HAVE_HWSERIAL3) void serialEvent3() __attribute__((weak)); bool Serial3_available() __attribute__((weak)); + + void serialEvent3() { } + bool Serial3_available() { return false; } #endif void serialEventRun(void) diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 6ff29d0b9..3e12e779f 100644 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -156,6 +156,6 @@ class HardwareSerial : public Stream #define HAVE_HWSERIAL3 #endif -extern void serialEventRun(void) __attribute__((weak)); +extern void serialEventRun(void); #endif diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp index 434cd403c..e5b9248c0 100644 --- a/cores/arduino/main.cpp +++ b/cores/arduino/main.cpp @@ -44,7 +44,7 @@ int main(void) for (;;) { loop(); - if (serialEventRun) serialEventRun(); + serialEventRun(); } return 0; diff --git a/extras/pack.release.bash b/extras/pack.release.bash index a2999d505..cf17bb39c 100755 --- a/extras/pack.release.bash +++ b/extras/pack.release.bash @@ -26,8 +26,10 @@ THIS_SCRIPT_NAME=`basename $0` rm -f avr-$VERSION.tar.bz2 cd .. -tar --transform "s|$FOLDERNAME|$FOLDERNAME-$VERSION|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf avr-$VERSION.tar.bz2 $FOLDERNAME +tar --transform "s|$FOLDERNAME|$FOLDERNAME-$VERSION|g" --exclude=extras/** --exclude=.git* --exclude=.idea -cjf cba-avr-$VERSION.tar.bz2 $FOLDERNAME cd - -mv ../avr-$VERSION.tar.bz2 . +mv ../cba-avr-$VERSION.tar.bz2 . +echo "SHA256: $(sha256sum cba-avr-${VERSION}.tar.bz2)" +echo "size: $(stat -c%s cba-avr-${VERSION}.tar.bz2)" diff --git a/platform.txt b/platform.txt index df5ddb712..5a9dfd76f 100644 --- a/platform.txt +++ b/platform.txt @@ -5,8 +5,8 @@ # For more info: # https://arduino.github.io/arduino-cli/latest/platform-specification/ -name=Arduino AVR Boards -version=1.8.6 +name=ClangBuiltArduino AVR Boards +version=1.0.0 # AVR compile variables # --------------------- @@ -18,23 +18,23 @@ compiler.warning_flags.more=-Wall compiler.warning_flags.all=-Wall -Wextra # Default "compiler.path" is correct, change only if you want to override the initial value -compiler.path={runtime.tools.avr-gcc.path}/bin/ -compiler.c.cmd=avr-gcc -compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -compiler.c.elf.cmd=avr-gcc -compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD -compiler.cpp.cmd=avr-g++ -compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -compiler.ar.cmd=avr-gcc-ar +compiler.path={runtime.tools.cba-llvm.path}/bin/ +compiler.c.cmd=clang +compiler.c.flags=--target=avr -c -g -Os {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects +compiler.c.elf.flags=--target=avr -mno-relax {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -Os -g -flto -fuse-linker-plugin -ffunction-sections -fdata-sections -Wl,--gc-sections --bfd-dir={runtime.tools.cba-avr-bfd.path} --llvmgold-dir={runtime.tools.cba-llvmgold.path} +compiler.c.elf.cmd=clang++-wrapper +compiler.S.flags=--target=avr --sysroot={runtime.tools.cba-avr-sysroot.path} -c -g -x assembler-with-cpp -flto -MMD +compiler.cpp.cmd=clang++ +compiler.cpp.flags=--target=avr -c -g -Os {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fno-rtti -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -MMD +compiler.ar.cmd=llvm-ar compiler.ar.flags=rcs -compiler.objcopy.cmd=avr-objcopy -compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 +compiler.objcopy.cmd=llvm-objcopy +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load compiler.elf2hex.flags=-O ihex -R .eeprom -compiler.elf2hex.cmd=avr-objcopy +compiler.elf2hex.cmd=llvm-objcopy compiler.ldflags= compiler.libraries.ldflags= -compiler.size.cmd=avr-size +compiler.size.cmd=llvm-size # This can be overridden in boards.txt build.extra_flags=