Commit Graph
55 Commits
Author SHA1 Message Date
BlackMarkandClaude Opus 5 2cdf56f8d6 ide: the whole project in Solution Explorer, and a path Studio can resolve
Three things the solution got wrong, all found by opening it in the GUI rather
than building it headlessly.

The project listed only main.cpp, so none of the headers could be opened from
Solution Explorer. Every source and header is listed now, with <Link> mirroring
the on-disk src/ layout, which is what master's project did.

Neither configuration compiled in the GUI: libavr was found through
$(LIBAVR_ROOT), and a variable exported in a shell is not visible to Studio
launched from the Start menu. Release only looked healthy because its objects
were already up to date from a headless build. The path is now anchored to the
project directory, which also side-steps a second trap: a plain relative include
is resolved against the generated makefile's own directory, the configuration's
output directory, not the project's. Pinning libavr as a submodule would remove
the assumption that the two sit side by side, and is on libavr's task list.

Both configurations verified with LIBAVR_ROOT deliberately unset, Release still
byte-identical to the CMake build and the flag gate still green. Debug's own
translation unit carries DWARF-4 as intended.

Studio's per-user state under ide/.vs/ and the build logs are ignored.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 19:19:20 +02:00
BlackMarkandClaude Opus 5 00849d25d5 ide: the Atmel Studio solution master has, on the libavr port
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 <noreply@anthropic.com>
2026-07-27 18:37:56 +02:00
BlackMarkandClaude b7a2e50506 Keep the curve and thermistor comments timeless
Both headers described the port transformation ("legacy cubic becomes",
"no hand-rolled series needed") rather than what the code is. State the
cubic and the __builtin_log rationale directly.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-18 10:10:47 +02:00
BlackMarkandClaude f17ebd17e5 Use libavr flash_table and __builtin_log
The thermistor Beta curve and the fan cubic move onto avr::flash_table
instead of hand-rolled [[gnu::progmem]] arrays with raw pgm_read, and
the compile-time logarithm uses __builtin_log (which constant-folds on
the AVR backend) instead of a hand-rolled series. Same 11284 B, still
byte-identical across libavr modes.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-18 08:03:42 +02:00
BlackMarkandClaude ab78d94872 Rewrite on libavr
Same controller: thermistor on ADC0 averaged over 1000 free-running
conversions, 50 kHz fan PWM on OC0B, 115200 Bd console with the full
command set, EEPROM temperature histogram, watchdog-reset path into the
boot section. The Steinhart-Hart math and the libm log are gone — the
Beta equation and the cubic fan curve are consteval-evaluated into
flash tables; the firmware never does floating point. Byte-identical
.text in both libavr modes. Legacy stays on master.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-18 04:37:26 +02:00
BlackMark 76d6b1583b Indicate auto/manual fan speed 2021-02-12 17:12:56 +01:00
BlackMark 5ec4a5441a Implement setting fan speed manually 2021-02-12 16:38:41 +01:00
BlackMark 7aa98a8ebd Replace sprintf with dtostrf to save about 1.5k of flash 2020-04-13 01:13:44 +02:00
BlackMark 64d6df256d Fix string being located in RAM 2020-04-13 00:54:44 +02:00
BlackMark 16ebed63c2 Change to stk500v2 compatible bootloader 2020-04-13 00:49:21 +02:00
BlackMark eee2e6172a Fix rounding of percentage calculation 2020-04-10 17:21:39 +02:00
BlackMark d6269952a6 Add saving to EEPROM on bootloader entry 2020-04-09 13:21:53 +02:00
BlackMark 6a7213de60 Add statistics reset command 2020-04-08 13:45:14 +02:00
BlackMark ed2fddc427 Fix handling of statistics before data is available and fix normalization factor 2020-04-08 13:44:54 +02:00
BlackMark 1694e3bbab Change histogram to only print from min to max 2020-04-08 12:58:59 +02:00
BlackMark 02565c9396 Add percentages to histogram 2020-04-08 12:41:53 +02:00
BlackMark 00082617d1 Make help messages consistent 2020-04-08 09:52:39 +02:00
BlackMark b8a40aed17 Implement eeprom stored persistent histogram 2020-04-08 02:17:34 +02:00
BlackMark cae18b98e7 Reduce code duplication 2020-04-07 21:54:15 +02:00
BlackMark 6ba4a2ce3d Add eeprom saved statistics 2020-04-07 21:09:27 +02:00
BlackMark ea6a6bd218 Add check to prevent printing data before it's available 2020-04-07 21:05:40 +02:00
BlackMark f3cf12db3b Refactor terminal callback 2020-04-06 22:17:32 +02:00
BlackMark 34428b76dd Add uptime command 2020-04-06 22:12:11 +02:00
BlackMark 9ef4d2a737 Add millis timer for timekeeping 2020-04-06 21:36:47 +02:00
BlackMark e29ee8c11f Fix commands being accepted in monitor mode 2020-04-06 19:53:46 +02:00
BlackMark dd42aebb16 Make adc sampling interrupt driven 2020-04-06 19:43:32 +02:00
BlackMark 8db7bde6e5 Remove bootloader countdown and change timeout to 3s 2020-04-06 17:50:17 +02:00
BlackMark 508f139f47 Refactor substring comparison 2020-04-06 17:46:10 +02:00
BlackMark 45a79adc56 Fix leaking details into global namespace 2020-04-06 17:05:48 +02:00
BlackMark 67559642a3 Change boot-up message to include version 2020-04-06 16:36:33 +02:00
BlackMark 9ab76f4ce5 Add version number 2020-04-06 16:33:57 +02:00
BlackMark 07be559e94 Add tsb bootloader support 2020-04-01 19:04:27 +02:00
BlackMark 04bcb76382 Change echo of backspace to be compatible with more terminals 2020-04-01 15:33:48 +02:00
BlackMark 6003ea6603 Add monitor command to continuously show measurements 2020-04-01 05:21:56 +02:00
BlackMark d6fa78ae5f Change temperature curve to cubic 2020-04-01 05:07:30 +02:00
BlackMark aab90f0fc0 Add ctrl + c handler 2020-04-01 05:07:12 +02:00
BlackMark 7f62961757 Add printing of temperature curve 2020-04-01 04:59:11 +02:00
BlackMark c0235bfcf0 Refactor magic numbers to have constants 2020-04-01 04:36:22 +02:00
BlackMark 45eafd9fc3 Improve printing further 2020-04-01 04:07:50 +02:00
BlackMark db2d8f6931 Improve measurement output 2020-04-01 04:00:59 +02:00
BlackMark 48cfdea11d Add handling of unknown commands 2020-04-01 03:58:44 +02:00
BlackMark 9d639cd955 Remove unnecessary undefs 2020-04-01 03:55:08 +02:00
BlackMark 2999fbcbcc Fix global flash strings to compile to one instance instead of one per function 2020-04-01 03:54:01 +02:00
BlackMark 226d1ba6c9 Refactor code from main to controller class 2020-04-01 03:11:03 +02:00
BlackMark a33a764b1d Add parsing and handling of help command 2020-04-01 02:41:09 +02:00
BlackMark af35388505 Add basic terminal 2020-04-01 02:27:28 +02:00
BlackMark ed4972c87e Fix submodules 2020-03-30 19:53:04 +02:00
BlackMark 7175193561 Rename project to fantemp 2020-03-30 19:45:33 +02:00
BlackMark 094e61a7c1 Add fan control according to temperature 2020-03-30 19:38:24 +02:00
BlackMark eee348d851 Refactor thermistor code into static class 2020-03-30 17:01:48 +02:00