From 00849d25d5769a11c39b56e43e3bcad6bff77177 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Mon, 27 Jul 2026 18:37:56 +0200 Subject: [PATCH] ide: the Atmel Studio solution master has, on the libavr port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit master opens in Studio, so this branch should too. One project, the port's own chip, flags mirrored by hand against the CMake build — and the acceptance is not that it builds but that it builds the same firmware: .text (7094 B) and .data (336 B) come out byte-identical to the CMake output from the same sources. libavr is found through $(LIBAVR_ROOT), the variable the CMake build already uses, so no machine path is committed; Studio expands it from the environment. The toolchain is named by flavour only, since nothing Studio ships can compile -std=c++26 and the path to one that can is per-machine state. The componentinfo file the project cannot load without is generated by libavr's tools/atmelstudio/componentinfo.py and ignored here, as are Studio's output directories. Release is what the flag gate compares, the presets defining no debug build; Debug carries the -Og -gdwarf-4 pair libavr's own debug preset uses. Co-Authored-By: Claude Opus 5 --- .gitignore | 5 +++ README.md | 25 ++++++++++++ ide/fantemp.atsln | 22 +++++++++++ ide/fantemp.cppproj | 96 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 ide/fantemp.atsln create mode 100644 ide/fantemp.cppproj diff --git a/.gitignore b/.gitignore index a4fb4fb..bbbc34e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ build/ .cache/ + +# Atmel Studio: generated per machine, and its build outputs +ide/*.componentinfo.xml +ide/Debug/ +ide/Release/ diff --git a/README.md b/README.md index 7b0fbab..fb36b4d 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,29 @@ LIBAVR_ROOT=/path/to/libavr cmake --preset atmega328p-generated cmake --build --preset atmega328p-generated ``` +## Atmel Studio + +`master` carries a Studio solution, so this branch does too: `ide/fantemp.atsln` +builds the same firmware — byte-identical `.text` and `.data` to the CMake +build — from the same sources, with the flags mirrored by hand. Studio finds +libavr through `$(LIBAVR_ROOT)`, the same environment variable the CMake build +uses, and needs a GCC 16.1 toolchain registered as flavour `avr-g++-16.1.0`; +nothing older can compile `-std=c++26`. + +One generated file is required before the project will load, and one command +checks the flags have not drifted (both from libavr's `tools/atmelstudio/`): + +```sh +python $LIBAVR_ROOT/tools/atmelstudio/componentinfo.py \ + ide/fantemp.componentinfo.xml --device ATmega328P +python $LIBAVR_ROOT/tools/atmelstudio/check-flags.py --solution ide/fantemp.atsln \ + --compile-commands build/atmega328p-generated/compile_commands.json \ + --log build/atmelstudio.log +``` + +CMake remains the build system; the solution is there so the project opens in +Studio as its predecessor did. Only the Release configuration is gated against +CMake — the presets define no debug build — and Debug carries the `-Og +-gdwarf-4` pair libavr's own debug preset uses. + Legacy (yazoalfa submodules) stays on `master`. diff --git a/ide/fantemp.atsln b/ide/fantemp.atsln new file mode 100644 index 0000000..26d33fc --- /dev/null +++ b/ide/fantemp.atsln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Atmel Studio Solution File, Format Version 11.00 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "fantemp", "fantemp.cppproj", "{4F0C1D92-6A5B-4E33-9A71-2C8F5B0D47AE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4F0C1D92-6A5B-4E33-9A71-2C8F5B0D47AE}.Debug|AVR.ActiveCfg = Debug|AVR + {4F0C1D92-6A5B-4E33-9A71-2C8F5B0D47AE}.Debug|AVR.Build.0 = Debug|AVR + {4F0C1D92-6A5B-4E33-9A71-2C8F5B0D47AE}.Release|AVR.ActiveCfg = Release|AVR + {4F0C1D92-6A5B-4E33-9A71-2C8F5B0D47AE}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ide/fantemp.cppproj b/ide/fantemp.cppproj new file mode 100644 index 0000000..3c44948 --- /dev/null +++ b/ide/fantemp.cppproj @@ -0,0 +1,96 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.CPP + 4f0c1d92-6a5b-4e33-9a71-2c8f5b0d47ae + ATmega328P + none + Executable + CPP + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + fantemp + fantemp + fantemp + avr-g++-16.1.0 + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 0 + 0 + + + + + + -mmcu=atmega328p + True + True + True + True + False + + + NDEBUG + + + + + $(LIBAVR_ROOT)\include + + + Optimize for size (-Os) + True + True + True + -std=c++26 -Wextra -mrelax -fno-exceptions -fno-rtti -fno-threadsafe-statics + True + -mrelax + + + + + + + -mmcu=atmega328p + True + True + True + True + False + + + DEBUG + + + + + $(LIBAVR_ROOT)\include + + + Optimize debugging experience (-Og) + True + True + True + -std=c++26 -Wextra -mrelax -fno-exceptions -fno-rtti -fno-threadsafe-statics -gdwarf-4 + True + -mrelax + + + + + + compile + + + +