Skip to content

Commit

Permalink
Release v5.0.0-alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
Prusa Research authored and dragomirecky committed Jun 21, 2023
1 parent 2e4ee66 commit 32617b1
Show file tree
Hide file tree
Showing 1,076 changed files with 20,643 additions and 14,850 deletions.
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: clang-format
name: clang-format
description: This hook automatically checks and reformats changed files using clang-format formatter.
entry: './.dependencies/clang-format-9.0.0-noext/clang-format'
entry: './.dependencies/clang-format-16-83817c2f/clang-format'
language: script
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
args: ['-i', '-style=file']
Expand Down Expand Up @@ -55,7 +55,8 @@ exclude: |
Marlin/src(/gcode)?/feature/input_shaper/|
Marlin/src(/gcode)?/feature/pressure_advance/|
Marlin/src(/gcode)?/feature/precise_stepping/|
Marlin/src/module/prusa/
Marlin/src/module/prusa/|
Marlin/src/gcode/calibrate/M958.cpp
)|
^lib/Prusa-Error-Codes/|
^lib/TMCStepper/|
Expand All @@ -79,5 +80,8 @@ exclude: |
^lib/Middlewares/Third_Party/CycloneTCP/|
^lib/Middlewares/Third_Party/mbedtls/|
^lib/liblightmodbus/|
^lib/QR/|
^lib/cthash/|
^lib/LiquidCrystal_I2C/|
^lib/CrashCatcher/
)
103 changes: 3 additions & 100 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"toolchainPrefix": "arm-none-eabi",
"device": "STM32F427ZI",
"rtos": "FreeRTOS",
"preRestartCommands": ["si"],
"breakAfterReset": false,
"preLaunchTask": "Backup current ELF",
"rttConfig": {
"enabled": true,
Expand Down Expand Up @@ -46,7 +46,6 @@
"toolchainPrefix": "arm-none-eabi",
"device": "STM32F427ZI",
"rtos": "FreeRTOS",
"preRestartCommands": ["si"],
"rttConfig": {
"enabled": true,
"address": "auto",
Expand Down Expand Up @@ -165,111 +164,15 @@
"rtos": "FreeRTOS",
},
{
"name": "Launch MINI Simulator",
"name": "Launch Simulator",
"type": "cortex-debug",
"servertype": "qemu",
"serverpath": "${workspaceRoot}/.dependencies/mini404-e72651a/qemu-system-buddy",
"serverpath": "${workspaceRoot}/.vscode/simulator_as_qemu.py",
"armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin",
"osx": {
"serverArgs": [
"-machine", "prusa-mini",
"-display", "cocoa",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}/build-vscode-buddy/simulator/usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}/build-vscode-buddy/simulator/xflash.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank1.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm",
"-append", "4x_flash",
"-semihosting-config", "enable=on,target=gdb,arg=firmware ./build-vscode-buddy/firmware.bbf",
],
},
"windows": {
"serverArgs": [
"-machine", "prusa-mini",
"-display", "sdl",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}\\build-vscode-buddy\\simulator\\usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}\\build-vscode-buddy\\simulator\\xflash.bin",
"-pflash", "${workspaceFolder}\\build-vscode-buddy\\simulator\\eeprom_bank1.bin",
"-pflash", "${workspaceFolder}\\build-vscode-buddy\\simulator\\eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm",
"-append", "4x_flash",
"-semihosting-config", "enable=on,target=gdb,arg=firmware ./build-vscode-buddy/firmware.bbf",
],
},
"linux": {
"serverArgs": [
"-machine", "prusa-mini",
"-display", "gtk",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}/build-vscode-buddy/simulator/usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}/build-vscode-buddy/simulator/xflash.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank1.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm",
"-append", "4x_flash",
"-semihosting-config", "enable=on,target=gdb,arg=firmware ./build-vscode-buddy/firmware.bbf",
],
},
"preLaunchTask": "Prepare Simulator State Directory",
"cwd": "${workspaceFolder}",
"executable": "${workspaceRoot}/build-vscode-buddy/firmware",
"request": "launch",
},
{
"name": "Launch MK4 Simulator",
"type": "cortex-debug",
"servertype": "qemu",
"serverpath": "${workspaceRoot}/.dependencies/mini403-0.5.4/qemu-system-buddy",
"armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin",
"osx": {
"serverArgs": [
"-machine", "prusa-mk4",
"-display", "cocoa",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}/build-vscode-buddy/simulator/usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}/build-vscode-buddy/simulator/xflash.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank1.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm"
],
},
"windows": {
"serverArgs": [
"-machine", "prusa-mk4",
"-display", "sdl",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}\\build-vscode-buddy\\simulator\\usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}\\build-vscode-buddy\\simulator\\xflash.bin",
"-pflash", "${workspaceFolder}\\build-vscode-buddy\\simulator\\eeprom_bank1.bin",
"-pflash", "${workspaceFolder}\\build-vscode-buddy\\simulator\\eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm"
],
},
"linux": {
"serverArgs": [
"-machine", "prusa-mk4",
"-display", "gtk",
"-drive", "id=usbstick,file=fat:rw:${workspaceFolder}/build-vscode-buddy/simulator/usbdir",
"-device", "usb-storage,drive=usbstick",
"-mtdblock", "${workspaceFolder}/build-vscode-buddy/simulator/xflash.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank1.bin",
"-pflash", "${workspaceFolder}/build-vscode-buddy/simulator/eeprom_bank2.bin",
"-nodefaults",
"-chardev", "stdio,id=stm32_itm"
],
},
"preLaunchTask": "Prepare Simulator State Directory",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build-vscode-buddy/firmware",
"request": "launch",
},
{
"name": "GDB (QEMU)",
"type": "gdb",
Expand Down
24 changes: 0 additions & 24 deletions .vscode/prepare_simulator_dir.py

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"task.allowAutomaticTasks": "on",
"clangd.arguments": [
"--query-driver=**/.dependencies/gcc-arm-none-eabi-*/*/arm-none-eabi-g*"
"--query-driver=**/.dependencies/gcc-arm-none-eabi-*/*/arm-none-eabi-g*",
"--header-insertion=never"
]
}
31 changes: 31 additions & 0 deletions .vscode/simulator_as_qemu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
from pathlib import Path


def options(args):
while args:
arg = args.pop(0)
assert arg.startswith('-')
option = [arg]
while args and not args[0].startswith('-'):
option.append(args.pop(0))
yield option


def simulator_args(qemu_args):
for option in options(qemu_args):
if option[0] in ('-machine', '-cpu', '-nographic',
'-semihosting-config', '-kernel'):
pass
else:
yield from option


project_root = Path(__file__).parent.parent
simulator_path = project_root / 'utils' / 'simulator'
extra_args = [f'-X' + arg for arg in simulator_args(sys.argv[1:])]

os.execv(sys.executable, [sys.executable, (simulator_path)] + extra_args)
8 changes: 0 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
"runOn": "folderOpen"
}
},
{
"label": "Prepare Simulator State Directory",
"type": "shell",
"command": "python3 ${workspaceFolder}/.vscode/prepare_simulator_dir.py ${workspaceFolder}/build-vscode-buddy ${workspaceFolder}/build-vscode-buddy/simulator",
"windows": {
"command": "python ${workspaceFolder}\\.vscode\\prepare_simulator_dir.py ${workspaceFolder}\\build-vscode-buddy ${workspaceFolder}\\build-vscode-buddy\\simulator"
}
},
{
"label": "Wait 1",
"type": "shell",
Expand Down
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ target_include_directories(
include/freertos
src/hw
src/common
src/configuration_store
src/guiconfig
src/lang
src/common/utils
${OPTIONS_INCLUDE_DIR}
)

Expand Down Expand Up @@ -116,6 +120,7 @@ target_link_libraries(BuddyHeaders INTERFACE FreeRTOS::FreeRTOS)

# Define printer type and version
set(PRINTER_VERSION "1") # default version
set(PRINTER_SUBVERSION "0") # default subversion

# The PRINTER_TYPE is (besides being used in the code) being stored in the .bbf and checked by the
# bootloader (which contains the same "enum" as below). Preferably do not use it on an interface
Expand All @@ -125,8 +130,9 @@ if(PRINTER STREQUAL "MK4")
set(PRINTER_VERSION "4")
set(PRINTER_CODE "13")
elseif(PRINTER STREQUAL "MK3.5")
set(PRINTER_TYPE "5")
set(PRINTER_VERSION "4")
set(PRINTER_TYPE "1")
set(PRINTER_VERSION "3")
set(PRINTER_SUBVERSION "5")
set(PRINTER_CODE "13")
elseif(PRINTER STREQUAL "MINI")
set(PRINTER_TYPE "2")
Expand Down Expand Up @@ -165,6 +171,7 @@ target_compile_definitions(
PRINTER_MODEL="${PRINTER}"
PRINTER_TYPE=${PRINTER_TYPE}
PRINTER_VERSION=${PRINTER_VERSION}
PRINTER_SUBVERSION=${PRINTER_SUBVERSION}
PRINTER_CODE=${PRINTER_CODE}
BOARD=BOARD_${BOARD}
BOARD_VERSION_MAJOR=${BOARD_VERSION_MAJOR}
Expand Down Expand Up @@ -385,15 +392,15 @@ add_subdirectory(lib)
# Build Puppy Firmwares
#

if(BOARD STREQUAL "XLBUDDY" AND HAS_PUPPIES_BOOTLOADER)
if(BOARD MATCHES ".*BUDDY" AND HAS_PUPPIES_BOOTLOADER)
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_lower)

if(PRINTER STREQUAL "XL" AND BOARD_VERSION VERSION_EQUAL "0.4.0")
set(dwarf_version_suffix "-04")
set(modular_bed_version_suffix "-06")
endif()

if(NOT DWARF_BINARY_PATH)
if(NOT DWARF_BINARY_PATH AND HAS_DWARF)
get_filename_component(
DWARF_BINARY_DIR "${DWARF_BINARY_DIR}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}"
)
Expand Down Expand Up @@ -628,7 +635,7 @@ if(BOARD MATCHES "BUDDY")
tinyusb::tinyusb
$<$<BOOL:${HAS_MMU2}>:MMU2::MMU2>
mbedTLS
$<$<STREQUAL:${PRINTER},XL>:lightmodbus>
$<$<BOOL:${HAS_PUPPIES}>:lightmodbus>
error_codes
error_codes_mmu # TODO once MMU is not necessary for the build, replace with:
# $<$<BOOL:${HAS_MMU2}>:error_codes_mmu>
Expand Down
16 changes: 0 additions & 16 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,6 @@
"type": "STRING",
"value": "0.2.7"
},
"PRESET_COMPILE_OPTIONS": {
"type": "STRING",
"value": "-DHAS_LDO_400_STEP -DHAS_PLANETARY_GEARBOX"
},
"BOOTLOADER": {
"type": "STRING",
"value": "YES"
Expand Down Expand Up @@ -866,10 +862,6 @@
"type": "STRING",
"value": "0.2.7"
},
"PRESET_COMPILE_OPTIONS": {
"type": "STRING",
"value": "-DHAS_LDO_400_STEP -DHAS_PLANETARY_GEARBOX"
},
"BOOTLOADER": {
"type": "STRING",
"value": "NO"
Expand Down Expand Up @@ -929,10 +921,6 @@
"type": "STRING",
"value": "0.2.7"
},
"PRESET_COMPILE_OPTIONS": {
"type": "STRING",
"value": "-DHAS_LDO_400_STEP -DHAS_PLANETARY_GEARBOX"
},
"BOOTLOADER": {
"type": "STRING",
"value": "YES"
Expand Down Expand Up @@ -992,10 +980,6 @@
"type": "STRING",
"value": "0.2.7"
},
"PRESET_COMPILE_OPTIONS": {
"type": "STRING",
"value": "-DHAS_LDO_400_STEP -DHAS_PLANETARY_GEARBOX"
},
"BOOTLOADER": {
"type": "STRING",
"value": "NO"
Expand Down
Loading

0 comments on commit 32617b1

Please sign in to comment.