Skip to content

Commit dce407f

Browse files
committed
Add precompiler flag to disable sdram usage
1 parent 733a771 commit dce407f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build-system/erbui/generators/daisy/code_template.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "erb/module_fnc.h"
1515

1616
#include "erb/def.h"
17+
#include "erb/config.h"
1718

1819
erb_DISABLE_WARNINGS_DAISY
1920
#include "daisy.h"
@@ -71,8 +72,8 @@ int main ()
7172

7273
system.Init (config);
7374

75+
#if (erb_SDRAM_USE_FLAG)
7476
// Init SDRAM
75-
7677
// When using the bootloader priori to v6, SDRAM has been already configured
7778

7879
if (
@@ -86,6 +87,7 @@ int main ()
8687
SdramHandle sdram;
8788
sdram.Init ();
8889
}
90+
#endif
8991

9092
//-------------------------------------------------------------------------
9193

include/erb/config.h

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717

1818
/*\\\ CONFIG \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1919

20+
// 'erb_SDRAM_USE_FLAG' activates the use of SDRAM. If a module doesn't
21+
// actually use SDRAM, turning this flag off allows to save costs when
22+
// the daisy board can be ordered without the SDRAM chip.
23+
// If not defined, it will activate the SDRAM.
24+
25+
#if !defined (erb_SDRAM_USE_FLAG)
26+
#define erb_SDRAM_USE_FLAG true
27+
#endif
28+
29+
2030
// 'erb_SDRAM_MEM_POOL_SIZE' represents the maximum amount of memory that can
2131
// be used for all combined usages of 'SdramPtr' for an entire module.
2232
// If not defined, it will take the entire Daisy SDRAM memory, so 64MB.

0 commit comments

Comments
 (0)