Skip to content

Commit

Permalink
Release v4.7.0
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 4e1f4c5 commit 415f74a
Show file tree
Hide file tree
Showing 1,269 changed files with 36,937 additions and 14,978 deletions.
5 changes: 4 additions & 1 deletion .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 @@ -77,5 +77,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
46 changes: 18 additions & 28 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 @@ -124,13 +129,18 @@ if(PRINTER STREQUAL "MK4")
set(PRINTER_TYPE "1")
set(PRINTER_VERSION "4")
set(PRINTER_CODE "13")
elseif(PRINTER STREQUAL "MK3.5")
set(PRINTER_TYPE "1")
set(PRINTER_VERSION "3")
set(PRINTER_SUBVERSION "5")
set(PRINTER_CODE "13")
elseif(PRINTER STREQUAL "MINI")
set(PRINTER_TYPE "2")
set(PRINTER_CODE "12")
elseif(PRINTER STREQUAL "XL")
set(PRINTER_TYPE "3")
set(PRINTER_CODE "17")
elseif(PRINTER STREQUAL "IXL")
elseif(PRINTER STREQUAL "iX")
set(PRINTER_TYPE "4")
set(PRINTER_CODE "16")
else()
Expand Down Expand Up @@ -161,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 @@ -291,8 +302,9 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(MCU MATCHES "STM32F40"
OR MCU MATCHES "STM32G0"
OR PRINTER STREQUAL "MK4"
OR PRINTER STREQUAL "MK3.5"
OR PRINTER STREQUAL "XL"
OR PRINTER STREQUAL "IXL"
OR PRINTER STREQUAL "iX"
)
add_compile_options(-Og)
else()
Expand Down Expand Up @@ -380,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 @@ -614,6 +626,7 @@ if(BOARD MATCHES "BUDDY")
inih::inih
$<$<BOOL:${WUI}>:WUI>
jsmn::jsmn
cthash::cthash
QR
Buddy::Lang
printf::printf
Expand All @@ -622,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 Expand Up @@ -654,29 +667,6 @@ set_property(
INIT_TRINAMIC_FROM_MARLIN_ONLY=$<BOOL:${INIT_TRINAMIC_FROM_MARLIN_ONLY}>
)

set_property(
SOURCE src/common/marlin_server.cpp
src/gui/guimain.cpp
src/gui/MItem_menus.cpp
src/gui/screen_splash.cpp
src/gui/screen_home.cpp
src/gui/screen_menu_settings.cpp
src/gui/screen_menu_hw_setup.cpp
src/gui/test/screen_menu_test.cpp
src/gui/dialogs/DialogHandler.cpp
src/marlin_stubs/G163.cpp
src/marlin_stubs/M997.cpp
src/gui/MItem_basic_selftest.cpp
src/gui/ScreenSelftest.cpp
src/gui/MItem_loadcell.cpp
src/common/marlin_client.cpp
src/gui/screen_menu_tools.cpp
src/guiapi/src/window_tool_action_box.cpp
src/gui/screen_menu_selftest_snake.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS HAS_SELFTEST=$<BOOL:${HAS_SELFTEST}>
)

set_property(
SOURCE src/buddy/main.cpp
src/mmu2_mmu2_log.cpp
Expand Down
Loading

0 comments on commit 415f74a

Please sign in to comment.