Skip to content

Commit

Permalink
Merge pull request #326 from bitcraze/krichardsson/ai-deck-flashing
Browse files Browse the repository at this point in the history
Flashing of AI-deck
  • Loading branch information
krichardsson committed Mar 22, 2022
2 parents 7172e65 + 9879429 commit 9cd1b9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cflib/crazyflie/mem/deck_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, deck_memory_manager):

def contains(self, address):
max = self._base_address + self.MEMORY_MAX_SIZE
return address >= self._base_address and address <= max
return address >= self._base_address and address < max

def write(self, address, data, write_complete_cb, write_failed_cb=None, progress_cb=None):
"""Write a block of binary data to the deck"""
Expand Down Expand Up @@ -144,7 +144,7 @@ class DeckMemoryManager(MemoryElement):
SIZE_OF_VERSION = 1
SIZE_OF_INFO_SECTION = SIZE_OF_VERSION + MAX_NR_OF_DECKS * SIZE_OF_DECK_MEM_INFO
INFO_SECTION_ADDRESS = 0
SUPPORTED_VERSION = 1
SUPPORTED_VERSION = 2

def __init__(self, id, type, size, mem_handler):
"""Initialize deck memory manager"""
Expand Down Expand Up @@ -220,7 +220,7 @@ def _parse_info_section(self, data):

version = struct.unpack('<B', data[0:1])[0]
if version != self.SUPPORTED_VERSION:
logger.error('Version ' + version + ' not supported')
logger.error(f'Version {version} not supported')
else:
for i in range(self.MAX_NR_OF_DECKS):
deck_memory = DeckMemory(self)
Expand Down

0 comments on commit 9cd1b9b

Please sign in to comment.