build: the libavr pin advances past phase 6
The renames land (interrupt_guard, consume_reset_cause, set_duty), the sampler binds its input in the new converter shape (the input pack plus in<>::start() as free-running's one kick), and the console states .allow_baud_error = true for the 115200-at-16-MHz this board has always spoken - the receiver-tolerance table libavr now enforces is stricter than the rate's own +2.1 %. The loader probe reads through avr::flash_load instead of raw pgmspace, the terminal's line buffer is std::array with backspace and delete named, the tree is reformatted under InsertBraces, and the sources are ASCII. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "board.hpp"
|
||||
|
||||
// Temperature histogram: one uint32 bucket per °C 0..99, sampled once a
|
||||
// Temperature histogram: one uint32 bucket per C 0..99, sampled once a
|
||||
// second, written back to EEPROM every 30 minutes (update() only touches
|
||||
// changed bytes). Erased EEPROM reads back as 0xffffffff — treated as 0.
|
||||
// changed bytes). Erased EEPROM reads back as 0xffffffff - treated as 0.
|
||||
namespace app {
|
||||
|
||||
class statistics {
|
||||
@@ -34,9 +34,11 @@ class statistics {
|
||||
static void init()
|
||||
{
|
||||
histogram = stored::read();
|
||||
for (auto &bucket : histogram)
|
||||
if (bucket == 0xffffffff)
|
||||
for (auto &bucket : histogram) {
|
||||
if (bucket == 0xffffffff) {
|
||||
bucket = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void record(std::int8_t celsius)
|
||||
@@ -65,34 +67,41 @@ class statistics {
|
||||
|
||||
static std::uint8_t min_temperature()
|
||||
{
|
||||
for (std::uint8_t i = 0; i < range; ++i)
|
||||
if (histogram[i])
|
||||
for (std::uint8_t i = 0; i < range; ++i) {
|
||||
if (histogram[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return range;
|
||||
}
|
||||
|
||||
static std::uint8_t max_temperature()
|
||||
{
|
||||
for (std::uint8_t i = range; i > 0; --i)
|
||||
if (histogram[i - 1])
|
||||
for (std::uint8_t i = range; i > 0; --i) {
|
||||
if (histogram[i - 1]) {
|
||||
return i - 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static std::uint64_t total_samples()
|
||||
{
|
||||
std::uint64_t total = 0;
|
||||
for (auto bucket : histogram)
|
||||
for (auto bucket : histogram) {
|
||||
total += bucket;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
static std::uint32_t highest_bucket()
|
||||
{
|
||||
std::uint32_t highest = 0;
|
||||
for (auto bucket : histogram)
|
||||
if (bucket > highest)
|
||||
for (auto bucket : histogram) {
|
||||
if (bucket > highest) {
|
||||
highest = bucket;
|
||||
}
|
||||
}
|
||||
return highest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user