Import('src_env')

# Enable common components for FRDM-K64F running MbedRTOS
src_env['crypto'] = True
src_env['external_sha2'] = True
src_env['malloc'] = True
src_env['freertos'] = False
src_env['mbedrtos'] = True
src_env['wsl'] = True
src_env['nvram'] = False

# Target source
targ_files = [Glob('*.c'),
              Glob('*.cpp')]

# Mbed, Mbed-rtos, SDFileSystem and FATFileSystem source
mbed_files = [Glob(src_env['MBED_DIR'] + '/mbed-rtos/rtx/TARGET_M3/TOOLCHAIN_GCC/*.s'),
              Glob(src_env['MBED_DIR'] + '/mbed-rtos/rtx/*.c'),
              Glob(src_env['MBED_DIR'] + '/mbed-rtos/rtos/*.cpp'),
              Glob(src_env['MBED_DIR'] + '/FATFileSystem/*.cpp'),
              Glob(src_env['MBED_DIR'] + '/FATFileSystem/ChaN/*.cpp'),
              Glob(src_env['MBED_DIR'] + '/SDFileSystem/*.cpp')]

src_env['srcs'].extend([targ_files, mbed_files])
