Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement atomic writes for EEPROM emulation #871

Merged
merged 3 commits into from
Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions hal/inc/eeprom_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
/* Exported constants --------------------------------------------------------*/

/* Exported macros -----------------------------------------------------------*/
/* Internal Flash Page size = 1KByte */
/* Exported functions --------------------------------------------------------*/

#ifdef __cplusplus
Expand All @@ -46,9 +45,14 @@ extern "C" {


void HAL_EEPROM_Init(void);
uint8_t HAL_EEPROM_Read(uint32_t address);
void HAL_EEPROM_Write(uint32_t address, uint8_t data);
uint8_t HAL_EEPROM_Read(uint32_t index);
void HAL_EEPROM_Write(uint32_t index, uint8_t data);
void HAL_EEPROM_Get(uint32_t index, void *data, size_t length);
void HAL_EEPROM_Put(uint32_t index, const void *data, size_t length);
size_t HAL_EEPROM_Length();
void HAL_EEPROM_Clear();
bool HAL_EEPROM_Has_Pending_Erase();
void HAL_EEPROM_Perform_Pending_Erase();

#ifdef __cplusplus
}
Expand Down
6 changes: 6 additions & 0 deletions hal/inc/hal_dynalib.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ DYNALIB_FN(BASE_IDX + 12, hal, HAL_disable_irq, int(void))
DYNALIB_FN(BASE_IDX + 13, hal, HAL_enable_irq, void(int))
DYNALIB_FN(BASE_IDX + 14, hal, HAL_RTC_Cancel_UnixAlarm, void(void))

DYNALIB_FN(BASE_IDX + 15, hal,HAL_EEPROM_Get, void(uint32_t, void *, size_t))
DYNALIB_FN(BASE_IDX + 16, hal,HAL_EEPROM_Put, void(uint32_t, const void *, size_t))
DYNALIB_FN(BASE_IDX + 17, hal,HAL_EEPROM_Clear, void(void))
DYNALIB_FN(BASE_IDX + 18, hal,HAL_EEPROM_Has_Pending_Erase, bool(void))
DYNALIB_FN(BASE_IDX + 19, hal,HAL_EEPROM_Perform_Pending_Erase, void(void))

DYNALIB_END(hal)

#undef BASE_IDX
Loading