Allow modem define from makefile

This commit is contained in:
Mark Qvist 2024-02-10 13:49:41 +01:00
parent 252b11ab90
commit 1abe7a7273
3 changed files with 17 additions and 12 deletions

View File

@ -42,14 +42,16 @@
#define BOARD_GENERIC_NRF52 0x50 #define BOARD_GENERIC_NRF52 0x50
#define BOARD_RAK4630 0x51 #define BOARD_RAK4630 0x51
#if BOARD_MODEL == BOARD_RAK4630 #ifndef MODEM
#define MODEM SX1262 #if BOARD_MODEL == BOARD_RAK4630
#elif BOARD_MODEL == BOARD_RNODE_NG_22 #define MODEM SX1262
#define MODEM SX1262 #elif BOARD_MODEL == BOARD_RNODE_NG_22
#elif BOARD_MODEL == BOARD_GENERIC_NRF52 #define MODEM SX1262
#define MODEM SX1262 #elif BOARD_MODEL == BOARD_GENERIC_NRF52
#else #define MODEM SX1262
#define MODEM SX1276 #else
#define MODEM SX1276
#endif
#endif #endif
#endif #endif

View File

@ -63,6 +63,9 @@ firmware-mega2560:
firmware-tbeam: firmware-tbeam:
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\"" arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\""
firmware-tbeam_sx126x:
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\""
firmware-lora32_v10: firmware-lora32_v10:
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\"" arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
@ -73,7 +76,7 @@ firmware-lora32_v20:
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\"" arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\""
firmware-lora32_v21: firmware-lora32_v21:
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DMODEM=0x01\"" arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\""
firmware-lora32_v21_extled: firmware-lora32_v21_extled:
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DEXTERNAL_LEDS=true\"" arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DEXTERNAL_LEDS=true\""
@ -112,11 +115,11 @@ upload-mega2560:
arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:mega arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:mega
upload-tbeam: upload-tbeam:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:t-beam arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:t-beam
@sleep 1 @sleep 1
rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.t-beam/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.t-beam/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-lora32_v10: upload-lora32_v10:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32 arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32

Binary file not shown.