[FL-1994] Add Saved Struct (#804)
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
17
firmware/targets/f7/furi-hal/furi-hal-lock.c
Normal file
17
firmware/targets/f7/furi-hal/furi-hal-lock.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "furi-hal-lock.h"
|
||||
#include <stm32wbxx_ll_rtc.h>
|
||||
|
||||
#define FLIPPER_LOCKED_VALUE 0x5432FAFA
|
||||
|
||||
bool furi_hal_lock_get() {
|
||||
return FLIPPER_LOCKED_VALUE == LL_RTC_BAK_GetRegister(RTC, LL_RTC_BKP_DR3);
|
||||
}
|
||||
|
||||
void furi_hal_lock_set(bool locked) {
|
||||
if (locked) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR3, FLIPPER_LOCKED_VALUE);
|
||||
} else {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR3, 0);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user