2024-02-16 21:05:25 +01:00
|
|
|
#pragma once
|
2024-02-06 22:11:58 +01:00
|
|
|
|
2024-02-09 12:20:30 +01:00
|
|
|
#include "pico/flash.h"
|
2024-02-06 22:11:58 +01:00
|
|
|
|
2024-02-07 11:25:38 +01:00
|
|
|
const uint16_t MAGIC_NUMBER = 2;
|
|
|
|
|
2024-02-16 20:56:03 +01:00
|
|
|
enum class Mode : uint8_t {
|
2024-02-07 11:15:41 +01:00
|
|
|
IAMBIC_A = 0,
|
2024-02-06 22:11:58 +01:00
|
|
|
IAMBIC_B,
|
|
|
|
};
|
|
|
|
|
2024-02-16 20:56:03 +01:00
|
|
|
struct Settings {
|
2024-02-19 12:10:42 +01:00
|
|
|
uint16_t magic_number {MAGIC_NUMBER}; // Bytes: 2
|
|
|
|
Mode mode {Mode::IAMBIC_B}; // Bytes: 1
|
|
|
|
uint8_t wpm {18}; // Bytes: 1
|
|
|
|
uint8_t dummy[FLASH_PAGE_SIZE - 4] {0}; // Sum : 4
|
2024-02-06 22:11:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void store_settings(Settings &settings);
|
2024-02-16 21:05:25 +01:00
|
|
|
Settings read_settings();
|