diff --git a/build-system/erbb/generators/daisy/make.py b/build-system/erbb/generators/daisy/make.py index ccad2208..088b0c37 100755 --- a/build-system/erbb/generators/daisy/make.py +++ b/build-system/erbb/generators/daisy/make.py @@ -134,6 +134,7 @@ def replace_defines (self, template, module, defines): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in defines: @@ -210,12 +211,23 @@ def dep_name (path): else: return '$(CONFIGURATION)' + path + '.d' + use_fatfs = False + for define in module.defines: + if define.key == 'erb_USE_FATFS' and define.value == '1': + use_fatfs = True + source_extra_paths = [] source_extra_paths.append (os.path.abspath (os.path.join (PATH_LIBDAISY, 'core', 'startup_stm32h750xx.c'))) cmsis_dsp_src_path = os.path.abspath (os.path.join (PATH_LIBDAISY, 'Drivers', 'CMSIS', 'DSP', 'Source')) source_extra_paths.append (os.path.join (cmsis_dsp_src_path, 'CommonTables', 'arm_common_tables.c')) source_extra_paths.append (os.path.join (cmsis_dsp_src_path, 'FastMathFunctions', 'arm_cos_f32.c')) source_extra_paths.append (os.path.join (cmsis_dsp_src_path, 'FastMathFunctions', 'arm_sin_f32.c')) + if use_fatfs: + fatfs_src_path = os.path.abspath (os.path.join (PATH_LIBDAISY, 'Middlewares', 'Third_Party', 'FatFs', 'src')) + source_extra_paths.append (os.path.join (fatfs_src_path, 'diskio.c')) + source_extra_paths.append (os.path.join (fatfs_src_path, 'ff.c')) + source_extra_paths.append (os.path.join (fatfs_src_path, 'ff_gen_drv.c')) + source_extra_paths.append (os.path.join (fatfs_src_path, 'option', 'ccsbcs.c')) objects = ' '.join (map (lambda x: object_name (x), source_paths)) objects += ' ' + ' '.join (map (lambda x: object_name (x), source_extra_paths)) diff --git a/build-system/erbb/generators/fuzz/make.py b/build-system/erbb/generators/fuzz/make.py index 6d4e6afe..f8c848e2 100755 --- a/build-system/erbb/generators/fuzz/make.py +++ b/build-system/erbb/generators/fuzz/make.py @@ -134,6 +134,7 @@ def replace_defines (self, template, module, defines): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in defines: diff --git a/build-system/erbb/generators/perf/make.py b/build-system/erbb/generators/perf/make.py index 2069d109..f27a176d 100755 --- a/build-system/erbb/generators/perf/make.py +++ b/build-system/erbb/generators/perf/make.py @@ -134,6 +134,7 @@ def replace_defines (self, template, module, defines): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in defines: diff --git a/build-system/erbb/generators/simulator/make.py b/build-system/erbb/generators/simulator/make.py index c39b828d..83b39876 100755 --- a/build-system/erbb/generators/simulator/make.py +++ b/build-system/erbb/generators/simulator/make.py @@ -108,6 +108,7 @@ def replace_defines (self, template, module, defines): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in defines: diff --git a/build-system/erbb/generators/vcvrack/project.py b/build-system/erbb/generators/vcvrack/project.py index d51d3555..a9ea675e 100755 --- a/build-system/erbb/generators/vcvrack/project.py +++ b/build-system/erbb/generators/vcvrack/project.py @@ -175,6 +175,7 @@ def replace_defines (self, template, defines): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in defines: diff --git a/build-system/erbb/generators/vscode/c_cpp_properties.py b/build-system/erbb/generators/vscode/c_cpp_properties.py index 42ba17b7..2f1234fa 100755 --- a/build-system/erbb/generators/vscode/c_cpp_properties.py +++ b/build-system/erbb/generators/vscode/c_cpp_properties.py @@ -98,6 +98,7 @@ def generate_module_defines (self, module): define_map = { 'erb_BUFFER_SIZE': '48', 'erb_SAMPLE_RATE': '48014', + 'erb_USE_FATFS': '0', } for define in module.defines: