-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatformio.ini
81 lines (74 loc) · 5.41 KB
/
platformio.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
; PlatformIO Project Configuration File
; ======================================
; This file defines the configuration for the PlatformIO project for the Universal IR Blaster (UIRB).
; It includes general project settings, environment-specific configurations, and custom scripts.
;
; Configurations Overview:
; - A default environment for building and uploading firmware to the UIRB hardware with the urboot bootloader.
; - Simulation and debugging using SimAVR.
; - Serial debugging environment with avr-stub.
; - Programming the UIRB using USBasp.
;
; EEPROM Management Targets:
; - `backupeep`: Backup EEPROM data in binary format.
; - `archiveeep`: Archive all EEPROM backups into a ZIP file.
; - `cleaneep`: Remove empty EEPROM backup directories.
[platformio]
name = UIRB Example Project ; Name of the project, shown in PlatformIO
description = Example project demonstrating the setup and use of the Universal IR Blaster (UIRB) with PlatformIO
default_envs = uirb-v02 ; Default environment for building and uploading firmware
; Common settings shared across all environments
[env]
platform = atmelavr ; Specifies the Atmel AVR platform (used for ATmega microcontrollers)
framework = arduino ; Utilizes the Arduino framework for development
lib_deps =
djordjemandic/UIRBcorelib @ ^1.2.3 ; UIRBcore library for Universal IR Blaster (GitHub: https://github.com/DjordjeMandic/UIRBcorelib)
monitor_speed = 1000000 ; Serial monitor baud rate (1M)
monitor_filters = default, time, colorize ; Serial monitor: default output, timestamps, and colorized text
build_src_flags =
-DMONITOR_SPEED=${env.monitor_speed} ; Define monitor speed as a preprocessor macro
; Default environment for the UIRB V0.2 board with urboot bootloader
[env:uirb-v02]
board = uirb-v02-atmega328p ; Board configuration for UIRB V0.2 hardware (ATmega328P).
; Configuration details are defined in ./boards/uirb-v02-atmega328p.json.
build_type = release ; Specifies release build type
; upload_speed = 57600 ; Uncomment if bootloader has issues with the default upload speed
; upload_port = COM6 ; Uncomment and set this to specify a fixed upload port.
; Ports are automatically detected using hardware IDs (hwids).
; This is optional unless debugging with avr-stub, where it must be manually set.
; See issue: https://github.com/platformio/platform-atmelavr/issues/253
extra_scripts =
./scripts/pio/backup_eeprom.py ; Custom script to handle EEPROM backup operations:
; - Adds the `backupeep` target for backing up EEPROM data.
; - Adds the `archiveeep` target for archiving EEPROM backups to a ZIP file.
; - Adds the `cleaneep` target for removing empty EEPROM backup directories.
; Environment for the UIRB V0.2 board using USBasp as the programmer
[env:uirb-v02-usbasp]
extends = env:uirb-v02 ; Inherit settings from the default UIRB V0.2 environment
upload_protocol = usbasp ; Use USBasp for uploading firmware
upload_flags = ; Additional configuration for USBasp:
-PUSB ; Specify USB as the upload port
-B8 ; Set SPI clock speed (divide by 8) for stable uploads
; Environment for the UIRB V0.2 board for debugging with default options
[env:uirb-v02-dbg]
extends = env:uirb-v02 ; Inherit settings from the default UIRB V0.2 environment
build_type = debug ; Specify debug build type
debug_svd_path = ./svd/atmega328p.svd ; Path to the SVD file for ATmega328P (used for debugging)
; build_unflags = -Os ; Uncomment to remove optimization from regular builds
; debug_build_flags = -O0 ; Uncomment to remove optimization from debug builds
; Environment for the UIRB V0.2 board for simulation and debugging using SimAVR
[env:uirb-v02-dbg-simavr]
extends = env:uirb-v02-dbg ; Inherit settings from the debug environment
debug_tool = simavr ; Use SimAVR for hardware simulation and debugging
; Environment for the UIRB V0.2 board for serial debugging with avr-stub
[env:uirb-v02-dbg-avrstub]
extends = env:uirb-v02-dbg ; Inherit settings from the debug environment
debug_tool = avr-stub ; Use avr-stub for serial debugging
debug_port = ${env:uirb-v02-dbg.upload_port} ; Set debug port to match upload port (required for avr-stub).
; See issue: https://github.com/platformio/platform-atmelavr/issues/253
build_flags =
${env:uirb-v02-dbg.build_flags} ; Inherit build flags from the debug environment
-DAVR_DEBUG ; Define macro to indicate avr-stub is enabled (required by UIRBcore)
lib_deps =
${env:uirb-v02-dbg.lib_deps} ; Inherit libraries from the debug environment
jdolinay/avr-debugger @ ^1.5 ; Add AVR Debugger library for advanced debugging capabilities