From e7f52a331ea13e12854fbd7dd1148a88dcd80874 Mon Sep 17 00:00:00 2001 From: liu weikai Date: Thu, 1 Oct 2026 01:12:37 +0800 Subject: [PATCH] Prepare 0.1.51-alpha and remove redundant index root view --- CHANGELOG.md | Bin 122768 -> 122836 bytes .../geocaching/sd_index_root_reader.h | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f820227c450660e6a8b290a3b17ceb4f42de9eb3..f548a12fdf592257ddefed3d48a8c8940621f327 100644 GIT binary patch delta 44 zcmV+{0Mq}FzX#O62e8lrlOAgf0X37+lpzN(05AY805Fpg3loz*2o{6t0=Mb{0jAtr CArAEb delta 22 ecmcbzpMAo9_6--9Cf9LDHR~~N*JEZ}b_W1%s0hUX diff --git a/platform/esp/arduino_common/include/platform/esp/arduino_common/geocaching/sd_index_root_reader.h b/platform/esp/arduino_common/include/platform/esp/arduino_common/geocaching/sd_index_root_reader.h index 21858b96..ca89ae31 100644 --- a/platform/esp/arduino_common/include/platform/esp/arduino_common/geocaching/sd_index_root_reader.h +++ b/platform/esp/arduino_common/include/platform/esp/arduino_common/geocaching/sd_index_root_reader.h @@ -36,7 +36,7 @@ class SdIndexRootReader { out = {}; if (result_ != IndexRootReadStep::Ready) return false; - out = selected_; + out = roots_[selected_copy_]; return true; } int selectedCopy() const { return result_ == IndexRootReadStep::Ready ? selected_copy_ : -1; } @@ -71,8 +71,9 @@ class SdIndexRootReader return result_ = IndexRootReadStep::Invalid; if (copy == 1) { - if (!::geocaching::storage::selectIndexRoot(roots_[0], roots_[1], selected_)) return result_ = IndexRootReadStep::Invalid; - selected_copy_ = selected_.revision == roots_[0].revision ? 0 : 1; + ::geocaching::storage::IndexRootView selected; + if (!::geocaching::storage::selectIndexRoot(roots_[0], roots_[1], selected)) return result_ = IndexRootReadStep::Invalid; + selected_copy_ = selected.revision == roots_[0].revision ? 0 : 1; } ++phase_; return result_; @@ -82,7 +83,7 @@ class SdIndexRootReader ::geocaching::storage::VolumeInstance volume_; SdVolumeReadSession read_session_; ::geocaching::storage::IndexRootBytes* buffers_[2]{}; - ::geocaching::storage::IndexRootView roots_[2], selected_; + ::geocaching::storage::IndexRootView roots_[2]; uint8_t phase_ = 0, selected_copy_ = 0; IndexRootReadStep result_ = IndexRootReadStep::Idle; bool already_read_ = false;