flipperzero-firmware/firmware/targets/f4/api-hal/api-hal-flash.c
あく 73ecc7cde6
Rename Irukagotchi to Dolphin. Add basic game state structures. (#268)
* Rename Irukagotchi to Dolphin. Add basic game state structures.
* Dolphin: state, counters, api. BT: shared access to flash. Flash: write api.
* add fake -1 deeds, example of changing icounter

Co-authored-by: coreglitch <mail@s3f.ru>
2020-12-19 02:15:29 +06:00

16 lines
480 B
C

#include <api-hal-flash.h>
#include <api-hal-bt.h>
#include <stm32wbxx.h>
void api_hal_flash_write_dword(size_t address, uint64_t data) {
api_hal_bt_lock_flash();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address, data);
api_hal_bt_unlock_flash();
}
void api_hal_flash_write_row(size_t address, size_t source_address) {
api_hal_bt_lock_flash();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address, source_address);
api_hal_bt_unlock_flash();
}