Skip to content

Commit

Permalink
use python2 not python, cause python is python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Braunschweiger committed Aug 15, 2015
1 parent 40111c1 commit c6dd3b8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/esptool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
#
# ESP8266 ROM Bootloader Utility
# https://github.com/themadinventor/esptool
Expand All @@ -8,8 +8,8 @@
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
Expand Down Expand Up @@ -286,7 +286,7 @@ def flash_erase(self):
# It it on the other hand unlikely to fail.

class ESPFirmwareImage:

def __init__(self, filename = None):
self.segments = []
self.entrypoint = 0
Expand All @@ -296,11 +296,11 @@ def __init__(self, filename = None):
if filename is not None:
f = file(filename, 'rb')
(magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack('<BBBBI', f.read(8))

# some sanity check
if magic != ESPROM.ESP_IMAGE_MAGIC or segments > 16:
raise Exception('Invalid firmware image')

for i in xrange(segments):
(offset, size) = struct.unpack('<II', f.read(8))
if offset > 0x40200000 or offset < 0x3ffe0000 or size > 65536:
Expand Down Expand Up @@ -458,8 +458,8 @@ def arg_auto_int(x):
'make_image',
help = 'Create an application image from binary files')
parser_make_image.add_argument('output', help = 'Output image file')
parser_make_image.add_argument('--segfile', '-f', action = 'append', help = 'Segment input file')
parser_make_image.add_argument('--segaddr', '-a', action = 'append', help = 'Segment base address', type = arg_auto_int)
parser_make_image.add_argument('--segfile', '-f', action = 'append', help = 'Segment input file')
parser_make_image.add_argument('--segaddr', '-a', action = 'append', help = 'Segment base address', type = arg_auto_int)
parser_make_image.add_argument('--entrypoint', '-e', help = 'Address of entry point', type = arg_auto_int, default = 0)

parser_elf2image = subparsers.add_parser(
Expand Down

0 comments on commit c6dd3b8

Please sign in to comment.