Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ram_arch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Gautier Hattenberger and Alexandre Bustico
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
43 #ifndef RAM_ARCH_H
44 #define RAM_ARCH_H
45 
46 #if defined STM32F1
47 #define STD_SECTION ".ram0"
48 #define FAST_SECTION ".ram0"
49 #define DMA_SECTION ".ram0"
50 #elif defined STM32F3
51 #define STD_SECTION ".ram0"
52 #define FAST_SECTION ".ram4"
53 #define DMA_SECTION ".ram0"
54 #elif defined STM32F4
55 #define STD_SECTION ".ram0"
56 #define FAST_SECTION ".ram4"
57 #define DMA_SECTION ".ram0"
58 #elif defined STM32F7
59 #define STD_SECTION ".ram0"
60 #define FAST_SECTION ".ram0"
61 #define DMA_SECTION ".ram3"
62 #else
63 #error "section defined only for STM32F1, STM32F4 and STM32F7"
64 #endif
65 
66 #define IN_STD_SECTION_NOINIT(var) var __attribute__ ((section(STD_SECTION), aligned(8)))
67 #define IN_STD_SECTION_CLEAR(var) var __attribute__ ((section(STD_SECTION "_clear"), aligned(8)))
68 #define IN_STD_SECTION(var) var __attribute__ ((section(STD_SECTION "_init"), aligned(8)))
69 
70 #define IN_FAST_SECTION_NOINIT(var) var __attribute__ ((section(FAST_SECTION), aligned(8)))
71 #define IN_FAST_SECTION_CLEAR(var) var __attribute__ ((section(FAST_SECTION "_clear"), aligned(8)))
72 #define IN_FAST_SECTION(var) var __attribute__ ((section(FAST_SECTION "_init"), aligned(8)))
73 
74 #define IN_DMA_SECTION_NOINIT(var) var __attribute__ ((section(DMA_SECTION), aligned(8)))
75 #define IN_DMA_SECTION_CLEAR(var) var __attribute__ ((section(DMA_SECTION "_clear"), aligned(8)))
76 #define IN_DMA_SECTION(var) var __attribute__ ((section(DMA_SECTION "_init"), aligned(8)))
77 
78 #endif
79