| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- Import('RTT_ROOT')
- Import('rtconfig')
- from building import *
- import os
- # get current directory
- cwd = GetCurrentDir()
- if GetDepend(['PKG_USING_NRF5X_SDK']):
- if GetDepend('SOC_NRF52840') == True:
- source = cwd + r'\templete_project\pca10056\template.*'
- elif GetDepend('SOC_NRF52832') == True:
- source = cwd + r'\templete_project\pca10040\template.*'
- elif GetDepend('SOC_NRF52833') == True:
- source = cwd + r'\templete_project\pca10100\template.*'
- target = cwd + r'"\..\..\"'
- copy_command = 'copy "' + source + r'" "' + target + r'"'
- print(copy_command)
- os.system(copy_command)
- path = []
- CPPDEFINES = []
- NRF_BLE_SRC = Split('''
- ./components/ble/ble_db_discovery/ble_db_discovery.c
- ./components/ble/common/ble_advdata.c
- ./components/ble/common/ble_srv_common.c
- ./components/ble/common/ble_conn_state.c
- ./components/ble/nrf_ble_gatt/nrf_ble_gatt.c
- ./components/ble/nrf_ble_gq/nrf_ble_gq.c
- ./components/ble/nrf_ble_scan/nrf_ble_scan.c
- ./components/ble/nrf_ble_qwr/nrf_ble_qwr.c
- ./components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c
- ./components/ble/ble_advertising/ble_advertising.c
- ./rtt_adapter/ble_conn_params_rtt.c
- ./integration/nrfx/legacy/nrf_drv_clock.c
- ''')
- path += [cwd + '/components/ble/ble_db_discovery']
- path += [cwd + '/components/ble/common']
- path += [cwd + '/components/ble/nrf_ble_gatt']
- path += [cwd + '/components/ble/nrf_ble_gq']
- path += [cwd + '/components/ble/nrf_ble_scan']
- path += [cwd + '/components/ble/nrf_ble_qwr']
- path += [cwd + '/components/ble/ble_link_ctx_manager']
- path += [cwd + '/components/ble/ble_advertising']
- NRF_SOFTDEVICE_SRC = Split('''
- ./components/softdevice/common/nrf_sdh.c
- ./components/softdevice/common/nrf_sdh_ble.c
- ./components/softdevice/common/nrf_sdh_soc.c
- ''')
- path += [cwd + '/components/softdevice/common']
- NRF_LIBRARIES_SRC = Split('''
- ./components/libraries/util/app_error.c
- ./components/libraries/util/app_error_handler_keil.c
- ./components/libraries/util/app_error_weak.c
- ./components/libraries/scheduler/app_scheduler.c
- ./components/libraries/fifo/app_fifo.c
- ./components/libraries/util/app_util_platform.c
- ./components/libraries/hardfault/hardfault_implementation.c
- ./components/libraries/util/nrf_assert.c
- ./components/libraries/atomic/nrf_atomic.c
- ./components/libraries/atomic_fifo/nrf_atfifo.c
- ./components/libraries/atomic_flags/nrf_atflags.c
- ./components/libraries/balloc/nrf_balloc.c
- ./components/libraries/memobj/nrf_memobj.c
- ./components/libraries/queue/nrf_queue.c
- ./components/libraries/ringbuf/nrf_ringbuf.c
- ./components/libraries/experimental_section_vars/nrf_section_iter.c
- ./components/libraries/sortlist/nrf_sortlist.c
- ./components/libraries/strerror/nrf_strerror.c
- ./components/libraries/sensorsim/sensorsim.c
- ''')
- path += [cwd + '/components/libraries/util']
- path += [cwd + '/components/libraries/scheduler']
- path += [cwd + '/components/libraries/timer']
- path += [cwd + '/components/libraries/fifo']
- path += [cwd + '/components/libraries/hardfault']
- path += [cwd + '/components/libraries/atomic']
- path += [cwd + '/components/libraries/atomic_fifo']
- path += [cwd + '/components/libraries/atomic_flags']
- path += [cwd + '/components/libraries/balloc']
- path += [cwd + '/components/libraries/memobj']
- path += [cwd + '/components/libraries/queue']
- path += [cwd + '/components/libraries/ringbuf']
- path += [cwd + '/components/libraries/experimental_section_vars']
- path += [cwd + '/components/libraries/sortlist']
- path += [cwd + '/components/libraries/strerror']
- path += [cwd + '/components/libraries/log']
- path += [cwd + '/components/libraries/log/src']
- path += [cwd + '/components/libraries/sensorsim']
- # ./integration/nrfx/legacy/nrf_drv_clock.c
- NRF_NRFX_SRC = Split('''
- ''')
- path += [cwd + '/components/softdevice/common']
- if GetDepend('SOC_NRF52840') == True:
- path += [cwd + '/components/softdevice/s140/headers']
- path += [cwd + '/components/softdevice/s140/headers/nrf52']
- if GetDepend('SOC_NRF52832') == True:
- path += [cwd + '/components/softdevice/s132/headers']
- path += [cwd + '/components/softdevice/s132/headers/nrf52']
- if GetDepend('SOC_NRF52833') == True:
- path += [cwd + '/components/softdevice/s140/headers']
- path += [cwd + '/components/softdevice/s140/headers/nrf52']
- path += [cwd + '/integration/nrfx/legacy']
- CPPDEFINES = ['SOFTDEVICE_PRESENT', 'CONFIG_GPIO_AS_PINRESET']
-
- NRF_BLE_SERVICE_SRC = []
- if GetDepend('SD_BLE_APP_UART_C') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_uart_c.c
- ''')
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_nus_c/ble_nus_c.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_nus_c']
- if GetDepend('SD_BLE_APP_BEACON') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_beacon.c
- ''')
- if GetDepend('SD_BLE_APP_BLINKY') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_blinky.c
- ''')
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_lbs/ble_lbs.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_lbs']
- if GetDepend('SD_BLE_APP_UART') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_uart.c
- ''')
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_nus/ble_nus.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_nus']
- if GetDepend('SD_BLE_APP_HRS') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_hrs.c
- ''')
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_hrs/ble_hrs.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_hrs']
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_dis/ble_dis.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_dis']
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_bas/ble_bas.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_bas']
-
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_lbs/ble_lbs.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_lbs']
- if GetDepend('SD_BLE_APP_BAS') == True:
- NRF_BLE_SERVICE_SRC += Split('''
- ./rtt_adapter/ble_app_bas.c
- ''')
- NRF_BLE_SERVICE_SRC += Split('''
- ./components/ble/ble_services/ble_bas/ble_bas.c
- ''')
- path += [cwd + '/components/ble/ble_services/ble_bas']
-
- group = DefineGroup('nRF_NRFX', NRF_NRFX_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- group = DefineGroup('nRF_BLE', NRF_BLE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- group = DefineGroup('nRF_BLE_Services', NRF_BLE_SERVICE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- group = DefineGroup('nRF_SoftDevice', NRF_SOFTDEVICE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- group = DefineGroup('nRF_Libraries', NRF_LIBRARIES_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- else:
- NRF_NRFX_SRC = Split('''
- ''')
- NRF_BLE_SRC = Split('''
- ''')
- NRF_BLE_SERVICE_SRC = Split('''
- ''')
- NRF_SOFTDEVICE_SRC = Split('''
- ''')
- NRF_LIBRARIES_SRC = Split('''
- ''')
- group = DefineGroup('nRF_NRFX', NRF_NRFX_SRC, depend = [''])
- group = DefineGroup('nRF_BLE', NRF_BLE_SRC, depend = [''])
- group = DefineGroup('nRF_BLE_Services', NRF_BLE_SERVICE_SRC, depend = [''])
- group = DefineGroup('nRF_SoftDevice', NRF_SOFTDEVICE_SRC, depend = [''])
- group = DefineGroup('nRF_Libraries', NRF_LIBRARIES_SRC, depend = [''])
- Return('group')
|