Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing of AI-deck #326

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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