mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #13646 from benpicco/BACKUP_RAM
cpu: add BACKUP_RAM attribute
This commit is contained in:
commit
4ac8f8df4c
@ -73,6 +73,20 @@ extern "C" {
|
||||
*/
|
||||
#define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".puf")))
|
||||
|
||||
#if CPU_HAS_BACKUP_RAM || DOXYGEN
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with 0 on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM __attribute__((section(".backup.bss")))
|
||||
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with user provided data on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM_DATA __attribute__((section(".backup.data")))
|
||||
#endif /* CPU_HAS_BACKUP_RAM */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -51,6 +51,18 @@ extern "C" {
|
||||
*/
|
||||
#define PRINTF_BUFSIZ 256
|
||||
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with 0 on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM __attribute__((section(".rtc.bss")))
|
||||
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with user provided data on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM_DATA __attribute__((section(".rtc.data")))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* CPU_CONF_H */
|
||||
|
@ -6,7 +6,6 @@
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CPU_CONF_H
|
||||
#define CPU_CONF_H
|
||||
|
||||
@ -127,6 +126,18 @@ extern "C" {
|
||||
*/
|
||||
#define NUM_HEAPS (4)
|
||||
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with 0 on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM __attribute__((section(".backup.bss")))
|
||||
|
||||
/**
|
||||
* @brief Memory marked with this attribute is retained during deep sleep
|
||||
* and initialized with user provided data on cold boot.
|
||||
*/
|
||||
#define BACKUP_RAM_DATA __attribute__((section(".backup.data")))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -39,7 +39,7 @@ int main(void)
|
||||
* counter anyway after wakeup, we did not sleep properly.
|
||||
*/
|
||||
static int counter_noinit __attribute__((section(".noinit")));
|
||||
static int counter __attribute__((section(".backup.bss")));
|
||||
static int counter BACKUP_RAM;
|
||||
|
||||
if (counter == 0) {
|
||||
puts("\nBackup RAM test\n");
|
||||
|
Loading…
Reference in New Issue
Block a user