From b076f2c6379652e9691b5ccf57079fd8438a17e7 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Mon, 4 Mar 2024 12:37:04 +0100 Subject: [PATCH] message memories added --- src/settings.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/settings.h b/src/settings.h index de7154e..cd19270 100644 --- a/src/settings.h +++ b/src/settings.h @@ -2,18 +2,21 @@ #include "pico/flash.h" -const uint16_t MAGIC_NUMBER = 3; +const uint16_t MAGIC_NUMBER = 4; enum class Mode : uint8_t { IambicA = 0, IambicB, Straight }; struct Settings { - uint16_t magic_number {MAGIC_NUMBER}; // Bytes: 2 - Mode mode {Mode::IambicB}; // Bytes: 1 - uint8_t wpm {0}; // Bytes: 1 - uint8_t wpmPotiMin {5}; // Bytes: 1 - uint8_t wpmPotiMax {55}; // Bytes: 1 - uint8_t dummy[FLASH_PAGE_SIZE - 6] {0}; // Sum : 6 + uint16_t magic_number {MAGIC_NUMBER}; // Bytes: 2 + Mode mode {Mode::IambicB}; // Bytes: 1 + uint8_t wpm {0}; // Bytes: 1 + uint8_t wpmPotiMin {5}; // Bytes: 1 + uint8_t wpmPotiMax {55}; // Bytes: 1 + char message1[64] {0}; // Bytes: 64 + char message2[64] {0}; // Bytes: 64 + char message3[64] {0}; // Bytes: 64 + uint8_t dummy[FLASH_PAGE_SIZE - 198] {0}; // Sum :198 }; void store_settings(Settings &settings); -Settings read_settings(); \ No newline at end of file +Settings read_settings();