def __init__(self, target, flash_algo):
        self.target = target
        self.flash_algo = flash_algo
        self.flash_algo_debug = False
        if flash_algo is not None:
            self.end_flash_algo = flash_algo['load_address'] + len(flash_algo) * 4
            self.begin_stack = flash_algo['begin_stack']
            self.begin_data = flash_algo['begin_data']
            self.static_base = flash_algo['static_base']
            self.min_program_length = flash_algo.get('min_program_length', 0)

            # Check for double buffering support.
            if flash_algo.has_key('page_buffers'):
                self.page_buffers = flash_algo['page_buffers']
            else:
                self.page_buffers = [self.begin_data]

            self.double_buffer_supported = len(self.page_buffers) > 1

        else:
            self.end_flash_algo = None
            self.begin_stack = None
            self.begin_data = None
            self.static_base = None
dataset/ETHPy150Open mbedmicro/pyOCD/pyOCD/flash/flash.py/Flash.__init__/original