2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file flash_main.h
|
|
|
|
* @brief
|
|
|
|
*
|
|
|
|
* @date Sep 19, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-11-14 21:00:13 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-03-25 15:16:26 -07:00
|
|
|
void readFromFlash();
|
2021-04-21 11:28:48 -07:00
|
|
|
void initFlash();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Because of hardware-related issues, stm32f4 chip is totally
|
|
|
|
* frozen while we are writing to internal flash. Writing the configuration takes
|
|
|
|
* about 1-2 seconds, we cannot afford to do that while the engine is
|
|
|
|
* running so we postpone the write until the engine is stopped.
|
|
|
|
*/
|
2023-09-06 14:46:00 -07:00
|
|
|
void writeToFlashNow();
|
|
|
|
void setNeedToWriteConfiguration();
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @return true if an flash write is pending
|
|
|
|
*/
|
2023-09-06 14:46:00 -07:00
|
|
|
bool getNeedToWriteConfiguration();
|
|
|
|
void writeToFlashIfPending();
|