fix saving

This commit is contained in:
Vitalii 2026-02-12 23:59:21 +02:00
parent 4c8dbfe92f
commit 6c5abf43a7
Signed by: SymbX
GPG Key ID: FF51F4E4BCE459EE
1 changed files with 4 additions and 1 deletions

View File

@ -157,7 +157,7 @@ bind_interrupts!(struct AdcIrqs {
SAADC => saadc::InterruptHandler;
});
const DATA_POINT: u32 = 0x000F9800 - 4096;
const DATA_POINT: u32 = 0xf8000;
#[embassy_executor::main]
async fn main(spawner: Spawner) {
@ -293,6 +293,9 @@ async fn storage_task(flash: Flash, initial_text_type: TextLightType, initial_te
let h_color: [u8; 2] = heart_color.to_le_bytes();
let data = [0b01010101u8, 0b10101010u8, text_type.into(), heart_type.into(), t_color[0], t_color[1], h_color[0], h_color[1], 0xFF, 0xFF, 0xFF, 0xFF];
info!("Saving data: {:?}", data);
if let Err(e) = flash.as_mut().erase(DATA_POINT, DATA_POINT + 4096).await {
error!("Error erasing flash page: {}", e);
}
if let Err(e) = flash.as_mut().write(DATA_POINT, &data).await {
error!("Error writing to flash: {}", e);
}