Skip to content

Commit

Permalink
Fix python3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Conroy committed Jun 14, 2020
1 parent bfe6eb3 commit 907ace4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ $(SELF_EXECUTABLE): $(SELF_OBJECTS)
-T$(SELF_LINKER_SCRIPT) \
-Wl,-Map,$(BUILD_PATH)/update-$(NAME).map -o $(BUILD_PATH)/update-$(NAME).elf $(SELF_OBJECTS)
arm-none-eabi-objcopy -O binary $(BUILD_PATH)/update-$(NAME).elf $(BUILD_PATH)/update-$(NAME).bin
python2 lib/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $(BUILD_PATH)/update-$(NAME).bin
python3 lib/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $(BUILD_PATH)/update-$(NAME).bin

$(BUILD_PATH)/%.o: src/%.c $(wildcard inc/*.h boards/*/*.h) $(BUILD_PATH)/uf2_version.h
echo "$<"
Expand All @@ -180,7 +180,7 @@ $(BUILD_PATH)/%.o: $(BUILD_PATH)/%.c
$(CC) $(CFLAGS) $(BLD_EXTA_FLAGS) $(INCLUDES) $< -o $@

$(BUILD_PATH)/selfdata.c: $(EXECUTABLE) scripts/gendata.py src/sketch.cpp
python2 scripts/gendata.py $(BOOTLOADER_SIZE) $(EXECUTABLE)
python3 scripts/gendata.py $(BOOTLOADER_SIZE) $(EXECUTABLE)

clean:
rm -rf build
Expand Down
2 changes: 1 addition & 1 deletion scripts/gendata.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def update_crc(new_byte, current_crc):
"__attribute__ ((aligned (4))) = {\n")
crcs = []
crc = 0
for row in range(bootloader_size / 16):
for row in range(bootloader_size // 16):
# Save the crc every 1k.
if row % (1024 / 16) == 0 and row > 0:
crcs.append(crc)
Expand Down

0 comments on commit 907ace4

Please sign in to comment.