Skip to content

Commit e869b9d

Browse files
committed
Remove sdram related classes when sdram is not used
1 parent dce407f commit e869b9d

File tree

7 files changed

+49
-5
lines changed

7 files changed

+49
-5
lines changed

include/erb/SdramPtr.h

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1515

16+
#include "erb/config.h"
17+
18+
#if (erb_SDRAM_USE_FLAG)
19+
1620

1721

1822
namespace erb
@@ -95,4 +99,8 @@ SdramPtr <T> make_sdram (Args &&... args);
9599

96100

97101

102+
#endif // erb_SDRAM_USE_FLAG
103+
104+
105+
98106
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

include/erb/detail/Sdram.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1515

16-
#include "erb/detail/MonotonicMemoryPool.h"
17-
1816
#include "erb/config.h"
17+
#if (erb_SDRAM_USE_FLAG)
18+
19+
#include "erb/detail/MonotonicMemoryPool.h"
1920

2021
#include <atomic>
2122

@@ -95,4 +96,8 @@ class Sdram
9596

9697

9798

99+
#endif // erb_SDRAM_USE_FLAG
100+
101+
102+
98103
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

include/erb/detail/fnc.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313

1414
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1515

16+
#include "erb/config.h"
17+
1618
#include "erb/detail/Sram.h"
17-
#include "erb/detail/Sdram.h"
19+
#if (erb_SDRAM_USE_FLAG)
20+
#include "erb/detail/Sdram.h"
21+
#endif
1822

1923
#include <algorithm>
2024

@@ -35,10 +39,12 @@ void * allocate_bytes_auto (std::size_t size)
3539
{
3640
void * ptr = Sram::allocate_bytes_nullptr_on_error (size);
3741

42+
#if (erb_SDRAM_USE_FLAG)
3843
if (ptr == nullptr)
3944
{
4045
ptr = Sdram::allocate_bytes_nullptr_on_error (size);
4146
}
47+
#endif
4248

4349
if (ptr == nullptr)
4450
{

include/erb/erb.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1515

16+
#include "erb/config.h"
17+
1618
#include "erb/AudioIn.h"
1719
#include "erb/AudioInJackDetection.h"
1820
#include "erb/AudioOut.h"
@@ -34,7 +36,10 @@
3436
#include "erb/LedRgb.h"
3537
#include "erb/Persistent.h"
3638
#include "erb/Pot.h"
37-
#include "erb/SdramPtr.h"
39+
#if (erb_SDRAM_USE_FLAG)
40+
#include "erb/SdramPtr.h"
41+
#endif
42+
#include "erb/SramPtr.h"
3843
#include "erb/Switch.h"
3944

4045
#include "erb/detail/fnc.h"

include/erb/vcvrack/ModuleBoard.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
#include "erb/config.h"
1717
#include "erb/detail/Sram.h"
18-
#include "erb/detail/Sdram.h"
18+
#if (erb_SDRAM_USE_FLAG)
19+
#include "erb/detail/Sdram.h"
20+
#endif
1921

2022
#include <array>
2123

@@ -51,7 +53,9 @@ class ModuleBoard
5153
current ();
5254

5355
Sram & sram ();
56+
#if (erb_SDRAM_USE_FLAG)
5457
Sdram & sdram ();
58+
#endif
5559

5660

5761

@@ -75,11 +79,15 @@ class ModuleBoard
7579

7680
std::array <uint8_t, erb_SRAM_MEM_POOL_SIZE>
7781
_sram_memory_pool_storage;
82+
#if (erb_SDRAM_USE_FLAG)
7883
std::array <uint8_t, erb_SDRAM_MEM_POOL_SIZE>
7984
_sdram_memory_pool_storage;
85+
#endif
8086

8187
Sram _sram;
88+
#if (erb_SDRAM_USE_FLAG)
8289
Sdram _sdram;
90+
#endif
8391

8492
static thread_local ModuleBoard *
8593
_current_ptr;

src/detail/Sdram.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "erb/detail/Sdram.h"
1313

14+
#if (erb_SDRAM_USE_FLAG)
15+
1416
#if defined (erb_TARGET_VCV_RACK)
1517
#include "erb/vcvrack/ModuleBoard.h"
1618
#endif
@@ -143,4 +145,8 @@ void * Sdram::allocate_raw_nullptr_on_error (size_t alignment, size_t size)
143145

144146

145147

148+
#endif // erb_SDRAM_USE_FLAG
149+
150+
151+
146152
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

src/vcvrack/ModuleBoard.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ Name : ctor
3232

3333
ModuleBoard::ModuleBoard ()
3434
: _sram_memory_pool_storage ()
35+
#if (erb_SDRAM_USE_FLAG)
3536
, _sdram_memory_pool_storage ()
37+
#endif
3638
, _sram (&_sram_memory_pool_storage [0])
39+
#if (erb_SDRAM_USE_FLAG)
3740
, _sdram (&_sdram_memory_pool_storage [0])
41+
#endif
3842
{
3943
}
4044

@@ -74,10 +78,12 @@ Name : sdram
7478
==============================================================================
7579
*/
7680

81+
#if (erb_SDRAM_USE_FLAG)
7782
Sdram & ModuleBoard::sdram ()
7883
{
7984
return _sdram;
8085
}
86+
#endif
8187

8288

8389

0 commit comments

Comments
 (0)