diff --git a/.gitignore b/.gitignore index 86eeceb..1e220e4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store .vscode/ workspace.code-workspace +dist/ diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..2e4083d --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +set -x + +DATE=$(date +%Y%m%d) +VERSION="v1.1-$DATE" +mkdir -p dist + +for f in $(ls .pio/build/*/firmware.bin); do + NAME="BlueSCSI-$VERSION-$(echo $f | cut -d\/ -f3).bin" + cp $f dist/$NAME +done diff --git a/platformio.ini b/platformio.ini index 59e82b5..5a4b543 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,29 +18,65 @@ build_flags = -DARDUINO_ARCH_STM32 -DDEBUG_LEVEL=DEBUG_NONE -O2 + -D BUILD_TAGS="\"\"" build_unflags = -Os -DARDUINO_ARCH_STM32F1 upload_flags = -c set CPUTAPID 0 -[env:STM32F103C8] +[env:STM32F1] platform = ststm32 board = genericSTM32F103C8 board_build.mcu = stm32f103c8t6 board_build.core = maple -[env:APM32F103C8] +[env:STM32F1-XCVR] +extends = env:STM32F1 +build_flags = ${env.build_flags} + -DXCVR + -D BUILD_TAGS="\"-XCVR\"" + +[env:STM32F1-USB] +extends = env:STM32F1 +build_flags = ${env.build_flags} + -D BUILD_TAGS="\"-USB\"" + -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC + -D USBCON + -D USBD_VID=0x0483 + -D USB_MANUFACTURER="Unknown" + -D USB_PRODUCT="\"BLUEPILL_F103C8\"" + -D HAL_PCD_MODULE_ENABLED + +[env:STM32F1-USB-128MHZ] +extends = env:STM32F1 +board_build.f_cpu = 128000000L +build_flags = ${env.build_flags} + -D BUILD_TAGS="\"-USB-128MHZ\"" + +[env:APM32F1] # The APM32F1's default clock is 96MHz and runs unstable at 72MHz(STM32F1's default) -extends = env:STM32F103C8 +extends = env:STM32F1 # Explicilty define the multiplier as maple only handles a few cases. -build_flags = ${env.build_flags} -DBOARD_RCC_PLLMUL=RCC_PLLMUL_12 #96000000L +build_flags = ${env.build_flags} + -D BUILD_TAGS="\"-APM32\"" + -DBOARD_RCC_PLLMUL=RCC_PLLMUL_12 #96000000L + +[env:APM32F1-USB] +# The APM32F1's default clock is 96MHz and runs unstable at 72MHz(STM32F1's default) +extends = env:APM32F1 +# Explicilty define the multiplier as maple only handles a few cases. +build_flags = ${env.build_flags} + -D BUILD_TAGS="\"-APM32-USB\"" + -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC + -D USBCON + -D USBD_VID=0x0483 + -D USB_MANUFACTURER="Unknown" + -D USB_PRODUCT="\"BLUEPILL_F103C8\"" + -D HAL_PCD_MODULE_ENABLED + -DBOARD_RCC_PLLMUL=RCC_PLLMUL_12 #96000000L # Or go all out at 128Mhz, your call :) #board_build.f_cpu = 128000000L -[env:STM32F103C8-XCVR] -extends = env:STM32F103C8 -build_flags = ${env.build_flags} -DXCVR - ; [env:debug] ; build_type = debug ; debug_tool = stlink diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 62d40b3..affb5e0 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -673,7 +673,8 @@ void initFileLog(int success_mhz) { LOG_FILE = SD.open(LOG_FILENAME, O_WRONLY | O_CREAT | O_TRUNC); LOG_FILE.println("BlueSCSI <-> SD - https://github.com/erichelgeson/BlueSCSI"); LOG_FILE.print("VERSION: "); - LOG_FILE.println(VERSION); + LOG_FILE.print(VERSION); + LOG_FILE.println(BUILD_TAGS); LOG_FILE.print("DEBUG:"); LOG_FILE.print(DEBUG); LOG_FILE.print(" SDFAT_FILE_TYPE:");