; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = AzulSCSIv1_0, AzulSCSIv1_1

; Example platform to serve as a base for porting efforts
[env:template]
platform = ststm32
framework = arduino
board = bluepill_f103c8
build_flags =
    -Os -Isrc
    -DLOGBUFSIZE=512
    -DPREFETCH_BUFFER_SIZE=0
    -DMAX_SECTOR_SIZE=2048
    -DSCSI2SD_BUFFER_SIZE=4096
lib_deps =
    SdFat=https://github.com/greiman/SdFat
    minIni
    AzulSCSI_platform_template
    SCSI2SD

; AzulSCSI V1.0 hardware platform with GD32F205 CPU.
[env:AzulSCSIv1_0]
platform = https://github.com/CommunityGD32Cores/platform-gd32.git
board = genericGD32F205VC
board_build.mcu = gd32f205vct6
board_build.core = gd32
board_build.ldscript = lib/AzulSCSI_platform_GD32F205/azulscsi_gd32f205.ld
ldscript_bootloader = lib/AzulSCSI_platform_GD32F205/azulscsi_gd32f205_btldr.ld
framework = spl
lib_compat_mode = off
lib_deps =
    SdFat_NoArduino
    minIni
    AzulSCSI_platform_GD32F205
    SCSI2SD
upload_protocol = stlink
platform_packages = 
    toolchain-gccarmnoneeabi@1.60301.0
    framework-spl-gd32@https://github.com/CommunityGD32Cores/gd32-pio-spl-package.git
extra_scripts = src/build_bootloader.py
build_flags = 
     -Os -Wall -Wno-sign-compare -ggdb -g3 -Isrc
     -D__SYSTEM_CLOCK_120M_PLL_IRC8M=120000000
     -DSPI_DRIVER_SELECT=3
     -DSD_CHIP_SELECT_MODE=2
     -DENABLE_DEDICATED_SPI=1
     -DAZULSCSI_V1_0

; AzulSCSI V1.1 hardware platform, similar to V1.0 but with improved performance.
[env:AzulSCSIv1_1]
extends = env:AzulSCSIv1_0
build_flags = 
     -Os -Wall -Wno-sign-compare -ggdb -g3 -Isrc
     -D__SYSTEM_CLOCK_120M_PLL_IRC8M=120000000
     -DSPI_DRIVER_SELECT=3
     -DSD_CHIP_SELECT_MODE=2
     -DENABLE_DEDICATED_SPI=1
     -DHAS_SDIO_CLASS
     -DAZULSCSI_V1_1
