X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=build_common%2Farduino%2FSConscript;h=dea95b95724b90ee2dd17a3db16d4932d5454c72;hb=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20230214.171546;hp=73e753e3e33f43e784512cafc782bc39c219773c;hpb=78d5cb6296c178dea7e6e9c10abf3ccd72002c1d;p=platform%2Fupstream%2Fiotivity.git diff --git a/build_common/arduino/SConscript b/build_common/arduino/SConscript index 73e753e..dea95b9 100644 --- a/build_common/arduino/SConscript +++ b/build_common/arduino/SConscript @@ -27,7 +27,7 @@ def __parse_config(f): def __get_boards(dict): boards = [] - keys = dict.keys() + keys = list(dict.keys()) for key in keys: idx = key.find('.name') if idx > 0: @@ -37,7 +37,7 @@ def __get_boards(dict): def __get_cpu(dict, board): cpus = [] - keys = dict.keys() + keys = list(dict.keys()) for key in keys: idx = key.find(board + '.menu.cpu.') start = len(board + '.menu.cpu.') @@ -190,13 +190,13 @@ def __upload(env, binary): port = '/dev/ttyACM0' upload_cmd = arduino_home + '/hardware/tools/avr/bin/avrdude -C' + arduino_home +'/hardware/tools/avr/etc/avrdude.conf -p' \ + mcu + ' -c' + protocol + ' -P' + port + ' -b' + speed + ' -D -Uflash:w:' + binary + ':i' - print "Upload command: %s" %upload_cmd + print("Upload command: %s" %upload_cmd) install_cmd = env.Command('install_cmd', None, upload_cmd) env.Default('install_cmd') elif target_arch == 'arm': port = 'ttyACM0' upload_cmd = 'stty -F /dev/' + port + ' speed 1200 cs8 -cstopb -parenb \n' + arduino_home + '/hardware/tools/bossac -i --port=' + port + ' -U false -e -w -b ' + binary + ' -R' - print "Upload command: %s" %upload_cmd + print("Upload command: %s" %upload_cmd) install_cmd = env.Command('install_cmd', None, upload_cmd) env.Default('install_cmd') @@ -234,7 +234,7 @@ target_arch = env.get('TARGET_ARCH') # installed. If not, get them and install them. SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'arduino', 'SConscript')) arduino_home = env.get('ARDUINO_HOME') -print 'ARDUINO_HOME = ' + env.get('ARDUINO_HOME') +print('ARDUINO_HOME = ' + env.get('ARDUINO_HOME')) # Overwrite suffixes and prefixes if env['HOST_OS'] == 'win32': @@ -259,6 +259,9 @@ if env.get('RELEASE'): else: env.AppendUnique(CCFLAGS = ['-g']) +# Force header presence defines +env.AppendUnique(CPPDEFINES = ['HAVE_ARDUINO_TIME_H']) + # BOARD / CPU option # Get IDE version @@ -266,12 +269,12 @@ if os.path.exists(os.path.join(arduino_home, 'lib', 'version.txt')): vf = open(os.path.join(arduino_home, 'lib', 'version.txt'), 'r') version = vf.readline().replace('.', '').strip() else: - print ''' + print(''' ************************************* Error *********************************** * Can't find version file (lib/version.txt), please check if (%s) * is arduino root directory. * ******************************************************************************* -''' % arduino_home +''' % arduino_home) Exit(1) if version[0:2] == '10': @@ -285,12 +288,12 @@ if version[0:2] == '10': env.Replace(LINK = 'avr-gcc') env.Replace(RANLIB = 'avr-ranlib') if target_arch != 'avr': - print ''' + print(''' ************************************* Error *********************************** * Arduino 1.0.x IDE only support 'avr', to support other arch at least 1.5.x * * is required. ******************************************************************************* -''' +''') Exit(1) else: is_1_0_x = False @@ -301,11 +304,11 @@ else: boards_info = __parse_config(os.path.join(arduino_home, 'hardware', 'arduino', 'sam', 'boards.txt')) platform_info = __parse_config(os.path.join(arduino_home, 'hardware', 'arduino', 'sam', 'platform.txt')) else: - print ''' + print(''' ************************************* Error *********************************** * CPU arch %s isn't supported currently. ******************************************************************************* -''' % target_arch +''' % target_arch) #Board option, let user to select the board boards = __get_boards(boards_info)