Skip to content

Commit

Permalink
Merge pull request #688 from ohmtech-rdi/erbb-use-fatfs-support
Browse files Browse the repository at this point in the history
Add fatfs support
  • Loading branch information
ohmtech-rdi authored Dec 6, 2024
2 parents 83c21af + 4df45e8 commit 5249209
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build-system/erbb/generators/daisy/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions build-system/erbb/generators/fuzz/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions build-system/erbb/generators/perf/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions build-system/erbb/generators/simulator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions build-system/erbb/generators/vcvrack/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions build-system/erbb/generators/vscode/c_cpp_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5249209

Please sign in to comment.