1
0
forked from me/IronOS

Save settings on change only / All builds OK (#1699) (#1704)

This commit is contained in:
Ivan Zorin
2023-06-18 07:31:05 +03:00
committed by GitHub
parent 4c5e885363
commit 4d7e4f41e3
11 changed files with 12 additions and 13 deletions

View File

@@ -168,3 +168,5 @@
#endif
#define FLASH_LOGOADDR (0x23000000 + (1022 * 1024))
#define FLASH_PAGE_SIZE (1024)
#define SETTINGS_START_PAGE (1023 * FLASH_PAGE_SIZE) // Hal auto offsets base addr

View File

@@ -10,10 +10,6 @@
#include "hal_flash.h"
#include "string.h"
#define FLASH_PAGE_SIZE (1024)
#define SETTINGS_START_PAGE (1023 * FLASH_PAGE_SIZE) // Hal auto offsets base addr
void flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
BL_Err_Type err = flash_erase(SETTINGS_START_PAGE, FLASH_PAGE_SIZE);
err = flash_write(SETTINGS_START_PAGE, buffer, length);