optimizations

This commit is contained in:
sessionm21 2020-05-14 07:12:34 +01:00
parent f45f3848df
commit 33f56ddd7d
2 changed files with 74 additions and 8 deletions

View File

@ -22,11 +22,13 @@ CFLAGS?=-Datmega328p\
-fdata-sections\ -fdata-sections\
-MMD\ -MMD\
-flto\ -flto\
-std=c++11\
-fno-fat-lto-objects\ -fno-fat-lto-objects\
-fuse-linker-plugin\ -fuse-linker-plugin\
-Wall -Wall
CXXFLAGS?=-Datmega328p\ CXXFLAGS?=-Datmega328p\
-std=c++11\
-Dmega328p\ -Dmega328p\
-mmcu=atmega328p\ -mmcu=atmega328p\
-Wl,--gc-sections\ -Wl,--gc-sections\
@ -34,7 +36,6 @@ CXXFLAGS?=-Datmega328p\
-DARDUINO=200\ -DARDUINO=200\
-DARDUINO_AVR_NANO\ -DARDUINO_AVR_NANO\
-DARDUINO_ARCH_AVR\ -DARDUINO_ARCH_AVR\
-std=c++11\
-Os\ -Os\
-ffunction-sections\ -ffunction-sections\
-fdata-sections\ -fdata-sections\
@ -47,13 +48,15 @@ CXXFLAGS?=-Datmega328p\
INC_DIRS?=-I./$(ARDUINO_DIR)/libraries/SPI/src\ INC_DIRS?=-I./$(ARDUINO_DIR)/libraries/SPI/src\
-I./$(ARDUINO_DIR)/cores/arduino\ -I./$(ARDUINO_DIR)/cores/arduino\
-I./$(ARDUINO_DIR)/variants/eightanaloginputs\ -I./$(ARDUINO_DIR)/variants/eightanaloginputs\
-I./libraries/arduino-LoRa/src\
-I./libraries/TinyGPSPlus/src\ -I./libraries/TinyGPSPlus/src\
-I./libraries/TinyLoRa\
-I./libraries/arduino-base64\ -I./libraries/arduino-base64\
-I./$(NANOPB_DIR)\ -I./$(NANOPB_DIR)\
-I./protobuf\ -I./protobuf\
-I./$(ARDUINO_DIR)/libraries/SoftwareSerial/src/ -I./$(ARDUINO_DIR)/libraries/SoftwareSerial/src/\
-I./libraries/arduino-lmic/src/\
-I./libraries/arduino-lmic/src/hal/\
-I./libraries/arduino-lmic/src/lmic/\
-I./libraries/arduino-lmic/src/aes/
SRC_FILES?=./$(ARDUINO_DIR)/cores/arduino/main.cpp\ SRC_FILES?=./$(ARDUINO_DIR)/cores/arduino/main.cpp\
./$(ARDUINO_DIR)/cores/arduino/wiring_digital.c\ ./$(ARDUINO_DIR)/cores/arduino/wiring_digital.c\
@ -77,16 +80,32 @@ SRC_FILES?=./$(ARDUINO_DIR)/cores/arduino/main.cpp\
./$(ARDUINO_DIR)/cores/arduino/abi.cpp\ ./$(ARDUINO_DIR)/cores/arduino/abi.cpp\
./$(ARDUINO_DIR)/libraries/SoftwareSerial/src/SoftwareSerial.cpp\ ./$(ARDUINO_DIR)/libraries/SoftwareSerial/src/SoftwareSerial.cpp\
./$(ARDUINO_DIR)/libraries/SPI/src/SPI.cpp\ ./$(ARDUINO_DIR)/libraries/SPI/src/SPI.cpp\
./libraries/arduino-LoRa/src/LoRa.cpp\
./libraries/TinyGPSPlus/src/TinyGPS++.cpp\ ./libraries/TinyGPSPlus/src/TinyGPS++.cpp\
./libraries/TinyLoRa/TinyLoRa.cpp\ ./libraries/arduino-lmic/src/hal/hal.cpp\
./libraries/arduino-base64/Base64.cpp ./libraries/arduino-lmic/src/hal/getpinmap_thisboard.cpp\
./libraries/arduino-lmic/src/aes/ideetron/AES-128_V10.cpp\
./libraries/arduino-lmic/src/lmic/lmic.c\
./libraries/arduino-lmic/src/lmic/lmic_eu_like.c\
./libraries/arduino-lmic/src/lmic/lmic_compliance.c\
./libraries/arduino-lmic/src/lmic/lmic_us_like.c\
./libraries/arduino-lmic/src/lmic/lmic_util.c\
./libraries/arduino-lmic/src/lmic/lmic_as923.c\
./libraries/arduino-lmic/src/lmic/lmic_au915.c\
./libraries/arduino-lmic/src/lmic/oslmic.c\
./libraries/arduino-lmic/src/lmic/lmic_eu868.c\
./libraries/arduino-lmic/src/lmic/lmic_us915.c\
./libraries/arduino-lmic/src/lmic/lmic_kr920.c\
./libraries/arduino-lmic/src/lmic/radio.c\
./libraries/arduino-lmic/src/lmic/lmic_in866.c\
./libraries/arduino-lmic/src/aes/lmic.c\
./libraries/arduino-lmic/src/aes/other.c
SRC_FILES_COMMON?=\ SRC_FILES_COMMON?=\
./$(NANOPB_DIR)/pb_encode.c\ ./$(NANOPB_DIR)/pb_encode.c\
./$(NANOPB_DIR)/pb_decode.c\ ./$(NANOPB_DIR)/pb_decode.c\
./$(NANOPB_DIR)/pb_common.c\ ./$(NANOPB_DIR)/pb_common.c\
./protobuf/gateway/message.pb.c ./protobuf/gateway/message.pb.c\
# Make targets for each source file # Make targets for each source file
OBJS := $(SRC_FILES:%=./bin/%.o) OBJS := $(SRC_FILES:%=./bin/%.o)

47
lmic_project_config.h Normal file
View File

@ -0,0 +1,47 @@
// project-specific definitions
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP */
//#define CFG_kr920 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
// define this in lmic_project_config.h to disable all code related to joining
#define DISABLE_JOIN
// define this in lmic_project_config.h to disable all code related to ping
#define DISABLE_PING
// define this in lmic_project_config.h to disable all code related to beacon tracking.
// Requires ping to be disabled too
#define DISABLE_BEACONS
// define these in lmic_project_config.h to disable the corresponding MAC commands.
// Class A
//#define DISABLE_MCMD_DutyCycleReq // duty cycle cap
//#define DISABLE_MCMD_RXParamSetupReq // 2nd DN window param
//#define DISABLE_MCMD_NewChannelReq // set new channel
//#define DISABLE_MCMD_DlChannelReq // set downlink channel for RX1 for given uplink channel.
//#define DISABLE_MCMD_RXTimingSetupReq // delay between TX and RX
// Class B
//#define DISABLE_MCMD_PingSlotChannelReq // set ping freq, automatically disabled by DISABLE_PING
//#define ENABLE_MCMD_BeaconTimingAns // next beacon start, DEPRECATED, normally disabled by DISABLE_BEACON
// DEPRECATED(tmm@mcci.com); replaced by LMIC.noRXIQinversion (dynamic). Don't define this.
//#define DISABLE_INVERT_IQ_ON_RX
// This allows choosing between multiple included AES implementations.
// Make sure exactly one of these is uncommented.
//
// This selects the original AES implementation included LMIC. This
// implementation is optimized for speed on 32-bit processors using
// fairly big lookup tables, but it takes up big amounts of flash on the
// AVR architecture.
// #define USE_ORIGINAL_AES
//
// This selects the AES implementation written by Ideetroon for their
// own LoRaWAN library. It also uses lookup tables, but smaller
// byte-oriented ones, making it use a lot less flash space (but it is
// also about twice as slow as the original).
// #define USE_IDEETRON_AES