rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
backup_ram.cpp File Reference

Detailed Description

Date
Dec 19, 2017

Definition in file backup_ram.cpp.

Functions

uint32_t backupRamLoad (backup_ram_e idx)
 
void backupRamSave (backup_ram_e idx, uint32_t value)
 
void backupRamFlush (void)
 
BackupSramDatagetBackupSram ()
 

Variables

static BKUP_RAM_NOINIT BackupSramData backupSramData
 

Function Documentation

◆ backupRamFlush()

void backupRamFlush ( void  )

Definition at line 43 of file backup_ram.cpp.

43 {
44 // nothing to do here, in STM32 all data is saved instantaneously
45}
Here is the call graph for this function:

◆ backupRamLoad()

uint32_t backupRamLoad ( backup_ram_e  idx)

Definition at line 9 of file backup_ram.cpp.

9 {
10#if HAL_USE_RTC
11 switch (idx) {
13 return RTCD1.rtc->BKP0R & 0xffff;
15 return (RTCD1.rtc->BKP0R >> 16) & 0xff;
16 default:
17 criticalError("Invalid backup ram idx %d", (int)idx);
18 return 0;
19 }
20#else
21 return 0;
22#endif /* HAL_USE_RTC */
23}

Referenced by PrimeController::getKeyCycleCounter(), and StepperMotorBase::loadStepperPos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ backupRamSave()

void backupRamSave ( backup_ram_e  idx,
uint32_t  value 
)

Definition at line 25 of file backup_ram.cpp.

25 {
26#if HAL_USE_RTC
27 switch (idx) {
29 RTCD1.rtc->BKP0R = (RTCD1.rtc->BKP0R & ~0x0000ffff) | (value & 0xffff);
30 break;
32 RTCD1.rtc->BKP0R = (RTCD1.rtc->BKP0R & ~0x00ff0000) | ((value & 0xff) << 16);
33 break;
34 default:
35 criticalError("Invalid backup ram idx %d, value %lx", (int)idx, value);
36 break;
37 }
38#endif /* HAL_USE_RTC */
39}

Referenced by PrimeController::onSlowCallback(), StepperMotorBase::saveStepperPos(), and PrimeController::setKeyCycleCounter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBackupSram()

BackupSramData * getBackupSram ( )

Definition at line 52 of file backup_ram.cpp.

52 {
53 return &backupSramData;
54}
static BKUP_RAM_NOINIT BackupSramData backupSramData

Referenced by chDbgPanic3(), errorHandlerInit(), firmwareErrorV(), and logHardFault().

Here is the caller graph for this function:

Variable Documentation

◆ backupSramData

BKUP_RAM_NOINIT BackupSramData backupSramData
static

Definition at line 50 of file backup_ram.cpp.

Referenced by getBackupSram().

Go to the source code of this file.