summaryrefslogtreecommitdiff
path: root/arduino.scons
blob: 43297753eb137022e27dd353c7697376feeac214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#******************************************************************
#
# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
##
# This script includes arduino specific config for oic-resource
##
Import('env')

# Add 'SHIELD' build option, let user select board network connection type
vars = Variables()
if 'IP' in env.get('TARGET_TRANSPORT'):
	vars.Add(EnumVariable('SHIELD', 'Network connection type', 'WIFI', ['ETH', 'WIFI']))
elif 'BLE' in env.get('TARGET_TRANSPORT'):
	vars.Add(EnumVariable('SHIELD', 'Network connection type', 'RBL_NRF8001', ['RBL_NRF8001']))
vars.Update(env)
Help(vars.GenerateHelpText(env))

env.ImportLib('SPI')
if 'ETH' in env.get('SHIELD'):
	env.ImportLib('Ethernet')
	env.AppendUnique(CPPDEFINES = ['ARDUINOETH'])
if 'WIFI' in env.get('SHIELD'):
	env.ImportLib('WiFi')
	env.AppendUnique(CPPDEFINES = ['ARDUINOWIFI'])
if 'RBL_NRF8001' in env.get('SHIELD'):
	env.ImportLib('BLE')
	env.ImportLib('RBL_nRF8001')

env.ImportLib('Time/Time')
# we have variety of macros for arduino!!
env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO', '__ARDUINO__'])
# Set device name to __OIC_DEVICE_NAME__
env.AppendUnique(CPPDEFINES = ['-D__OIC_DEVICE_NAME__=' + "\'\"" + env.get('DEVICE_NAME') + "\"\'"])
if env.get('LOGGING'):
	env.AppendUnique(CPPDEFINES = ['TB_LOG'])