Skip to content

Commit

Permalink
Release v5.1.0-alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
Prusa Research authored and dragomirecky committed Oct 19, 2023
1 parent 7508811 commit 7a6a46a
Show file tree
Hide file tree
Showing 1,009 changed files with 50,929 additions and 13,939 deletions.
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: true
AlignTrailingComments:
Kind: Never
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ a5f74b76a49ed2ce5a5c1627b749bbcd4a1d3303 # Migrate old eeprom to new config stor
54692f0d28cf4cfc007c6b4567193cdc7cfde4cb # Wrap marlin client in marlin_client namespace
aa7bb070e259fb73fba4d8f4ea46abc24abbced9 # Rename marlin_client members
2933bc5568ce0a1fd05e9221c1d8629a5a157329 # xl: Rename Dwarf::set_led() to Dwarf::set_cheese_led()
87bb1927f87520ce063069a178291295183e1597 # Set ClangFormat AlignTrailingComments: Kind: Never
bd27a08249dd1dc9919b547f4ca757258c779271 # Unify footer naming style with our dev guidelines
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ exclude: |
^lib/LiquidCrystal_I2C/|
^lib/CrashCatcher/|
^lib/libbgcode/|
^lib/cpp-std-extensions/|
^lib/heatshrink/
)
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include(ExternalProject)
include(cmake/Utilities.cmake)
include(cmake/GetGitRevisionDescription.cmake)
include(cmake/ProjectVersion.cmake)
include(cmake/CheckRemotes.cmake)
include(cmake/Littlefs.cmake)
include(cmake/Options.cmake)

Expand Down Expand Up @@ -48,6 +47,10 @@ set(CMAKE_CXX_STANDARD 20)

# enable all warnings (well, not all, but some)
add_compile_options(-Wall -Wsign-compare)

# make all paths stored inside firmware relative
add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.)

add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wno-register> $<$<COMPILE_LANGUAGE:CXX>:-Wno-volatile>
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
Expand Down Expand Up @@ -608,7 +611,7 @@ target_include_directories(
include/mbedtls
)

target_link_libraries(firmware PRIVATE BuddyHeaders Segger printf::printf)
target_link_libraries(firmware PRIVATE BuddyHeaders Segger printf::printf CrashCatcher)

if(BOARD MATCHES "BUDDY")
target_link_libraries(
Expand All @@ -628,6 +631,7 @@ if(BOARD MATCHES "BUDDY")
jsmn::jsmn
QR
Buddy::Lang
CppStdExtensions
printf::printf
sysbase
Segger
Expand All @@ -642,11 +646,9 @@ if(BOARD MATCHES "BUDDY")
heatshrink_decoder
)
elseif(BOARD STREQUAL "DWARF")
target_link_libraries(
firmware PRIVATE BuddyHeaders Marlin Arduino::Core Arduino::TMCStepper CrashCatcher
)
target_link_libraries(firmware PRIVATE BuddyHeaders Marlin Arduino::Core Arduino::TMCStepper)
elseif(BOARD STREQUAL "MODULARBED")
target_link_libraries(firmware PRIVATE BuddyHeaders CrashCatcher)
target_link_libraries(firmware PRIVATE BuddyHeaders)
endif()

set_property(
Expand Down
8 changes: 4 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "NO"
"value": "YES"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -104,7 +104,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "NO"
"value": "YES"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -171,7 +171,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "NO"
"value": "YES"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -238,7 +238,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "NO"
"value": "YES"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down
8 changes: 4 additions & 4 deletions ProjectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ set(PRINTERS_WITH_FILAMENT_SENSOR_BINARY "MINI" "MK3.5")
set(PRINTERS_WITH_FILAMENT_SENSOR_ADC "MK4" "XL" "iX")
set(PRINTERS_WITH_INIT_TRINAMIC_FROM_MARLIN_ONLY "MINI" "MK4" "MK3.5" "XL" "iX")
set(PRINTERS_WITH_ADVANCED_PAUSE "MINI" "MK4" "MK3.5" "iX" "XL")
set(PRINTERS_WITH_CRASH_DETECTION "MINI" "MK4" "XL") # this does require selftest to work
set(PRINTERS_WITH_POWER_PANIC "MK4" "XL") # this does require selftest and crash detection to work
set(PRINTERS_WITH_CRASH_DETECTION "MINI" "MK4" "MK3.5" "XL") # this does require selftest to work
set(PRINTERS_WITH_POWER_PANIC "MK4" "MK3.5" "XL") # this does require selftest and crash detection
# to work
set(PRINTERS_WITH_PRECISE_HOMING "MK4")
set(PRINTERS_WITH_PRECISE_HOMING_COREXY "XL")
# private MINI would not fit to 1MB so it has disabled selftest set(PRINTERS_WITH_SELFTEST "MINI"
Expand Down Expand Up @@ -581,8 +582,7 @@ else()
define_boolean_option(NETWORKING_BENCHMARK_ENABLED NO)
endif()

# asyncio causes speed regressions so let's disable it for now
define_boolean_option(USE_ASYNCIO NO)
define_boolean_option(USE_ASYNCIO YES)

# define enabled features

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Buddy
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMultibranch%2Fprivate&subject=private>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/private/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMultibranch%2Fmaster&subject=master>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/master/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FAuto-Pull-Master&subject=auto-update-master>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Auto-Pull-Master/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMerge-Master-To-Private&subject=merge-master-to-private-daily>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Merge-Master-To-Private/)
[![GitHub release](https://img.shields.io/github/release/prusa3d/Prusa-Firmware-Buddy.svg)](https://github.com/prusa3d/Prusa-Firmware-Buddy/releases)
[![Build Status](https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy%2FMultibranch%2Fmaster)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy/job/Multibranch/job/master/)

This repository includes source code and firmware releases for the Original Prusa 3D printers based on the 32-bit ARM microcontrollers.

Expand Down
47 changes: 0 additions & 47 deletions cmake/CheckRemotes.cmake

This file was deleted.

6 changes: 3 additions & 3 deletions include/buddy/fatfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ extern "C" {
#include "ff_gen_drv.h"
#include "usbh_diskio.h" /* defines USBH_Driver as external */

extern uint8_t retUSBH; /* Return value for USBH */
extern uint8_t retUSBH; /* Return value for USBH */
extern char USBHPath[4]; /* USBH logical drive path */
extern FATFS USBHFatFS; /* File system object for USBH logical drive */
extern FIL USBHFile; /* File object for USBH */
extern FATFS USBHFatFS; /* File system object for USBH logical drive */
extern FIL USBHFile; /* File object for USBH */

void MX_FATFS_Init(void);

Expand Down
4 changes: 2 additions & 2 deletions include/buddy/ffconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
/ memory for the working buffer, memory management functions, ff_memalloc() and
/ ff_memfree() exemplified in ffsystem.c, need to be added to the project. */

#define FF_LFN_UNICODE 0
#define FF_LFN_UNICODE 2
/* This option switches the character encoding on the API when LFN is enabled.
/
/ 0: ANSI/OEM in current CP (TCHAR = char)
Expand All @@ -133,7 +133,7 @@
/ When LFN is not enabled, this option has no effect. */

#define FF_LFN_BUF 255
#define FF_SFN_BUF 12
#define FF_SFN_BUF 34
/* This set of options defines size of file name members in the FILINFO structure
/ which is used to read out directory items. These values should be suffcient for
/ the file names to read. The maximum possible length of the read file name depends
Expand Down
4 changes: 2 additions & 2 deletions include/buddy/filename_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* MAXPATHNAMELENGTH (1 + (MAXDIRNAMELENGTH + 1) * (MAX_DIR_DEPTH) + 1 + FILENAME_LENGTH)
* */

#define MAX_DIR_DEPTH 10 // Maximum folder depth
#define MAXDIRNAMELENGTH 8 // DOS folder name size
#define MAX_DIR_DEPTH 10 // Maximum folder depth
#define MAXDIRNAMELENGTH 8 // DOS folder name size
#define _MAX_LFN (96 + 1 + 5 + 1) // Maximum LFN length to handle (12 to 255)

#ifdef _MAX_LFN
Expand Down
14 changes: 10 additions & 4 deletions include/buddy/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {
#include <stdint.h>

#define WITH_RTOS 1
#define MEM_LIBC_MALLOC 1
#define MEM_LIBC_MALLOC 0
#define CHECKSUM_BY_HARDWARE 0
#define LWIP_DHCP 1
#define MEM_ALIGNMENT 4
Expand All @@ -24,10 +24,11 @@ extern "C" {
#define TCP_SND_BUF (2 * TCP_MSS)
#define LWIP_WND_SCALE 0
#define TCP_RCV_SCALE 0
#define PBUF_POOL_SIZE 16
#define PBUF_POOL_SIZE 10
#define PBUF_POOL_SMALL_SIZE 12
#define IP_REASS_MAX_PBUFS 15
#define TCPIP_THREAD_STACKSIZE 1088
#define TCPIP_MBOX_SIZE 16
#define TCPIP_MBOX_SIZE PBUF_POOL_SIZE + PBUF_POOL_SMALL_SIZE

#define DEFAULT_UDP_RECVMBOX_SIZE TCPIP_MBOX_SIZE
#define DEFAULT_TCP_RECVMBOX_SIZE TCPIP_MBOX_SIZE
Expand All @@ -51,6 +52,9 @@ extern "C" {
#include "buddy/priorities_config.h"
#define TCPIP_THREAD_PRIO TASK_PRIORITY_TCPIP_THREAD

#define MEM_USE_POOLS 1
#define MEMP_USE_CUSTOM_POOLS 1

/*
* FIXME:
* Workaround:
Expand Down Expand Up @@ -88,6 +92,8 @@ extern "C" {
// Some attempts to "tune" it to use less memory in unstable network environment with many retries of new connections.
#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 5000 /* 5s for closing a connection must be enough... or let the other side time out */
#define TCP_OVERSIZE 128
#define LWIP_TCP_SACK_OUT 1
#define TCP_OOSEQ_MAX_PBUFS 3

#define LWIP_DNS 1
/*
Expand All @@ -106,7 +112,7 @@ extern "C" {

#define MEMP_NUM_UDP_PCB 5

#define MEMP_NUM_TCPIP_MSG_INPKT 16
#define MEMP_NUM_TCPIP_MSG_INPKT TCPIP_MBOX_SIZE

#ifdef __cplusplus
}
Expand Down
8 changes: 8 additions & 0 deletions include/buddy/lwippools.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define PBUF_POOL_SMALL_BUFSIZE LWIP_MEM_ALIGN_SIZE(40 + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN)
LWIP_MEMPOOL(PBUF_POOL_SMALL, PBUF_POOL_SMALL_SIZE, (LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf_custom)) + LWIP_MEM_ALIGN_SIZE(PBUF_POOL_SMALL_BUFSIZE)), "PBUF_POOL_SMALL")

LWIP_MALLOC_MEMPOOL_START
LWIP_MALLOC_MEMPOOL(6, 128)
LWIP_MALLOC_MEMPOOL(2, 512)
LWIP_MALLOC_MEMPOOL(1, 1512)
LWIP_MALLOC_MEMPOOL_END
5 changes: 3 additions & 2 deletions include/buddy/priorities_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern "C" {
#endif
#include "FreeRTOSConfig.h" // for configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
#include "cmsis_os.h" // for osPriorityXXX
#include "cmsis_os.h" // for osPriorityXXX
#ifdef __cplusplus
}
#endif
Expand Down Expand Up @@ -40,14 +40,15 @@ static_assert(configLIBRARY_LOWEST_INTERRUPT_PRIORITY == 15);
* Task priorities
*************************************************/
#define TASK_PRIORITY_PUPPY_TASK osPriorityRealtime
#define TASK_PRIORITY_USB_DEVICE osPriorityRealtime
#define TASK_PRIORITY_USB_DEVICE osPriorityNormal
#define TASK_PRIORITY_AC_FAULT osPriorityRealtime
#define TASK_PRIORITY_ESP osPriorityRealtime
#define TASK_PRIORITY_DEFAULT_TASK osPriorityHigh
#define TASK_PRIORITY_STARTUP osPriorityHigh
#define TASK_PRIORITY_MEDIA_PREFETCH osPriorityHigh
#define TASK_PRIORITY_METRIC_SYSTEM osPriorityAboveNormal
#define TASK_PRIORITY_USB_HOST osPriorityNormal
#define TASK_PRIORITY_USB_MSC_WORKER osPriorityRealtime
#define TASK_PRIORITY_DISPLAY_TASK osPriorityNormal
#define TASK_PRIORITY_MEASUREMENT_TASK osPriorityNormal
#define TASK_PRIORITY_ESP_UPDATE osPriorityNormal
Expand Down
3 changes: 2 additions & 1 deletion include/common/sheet.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once
#include <array>

inline constexpr size_t MAX_SHEET_NAME_LENGTH { 8 };

struct Sheet {
char name[MAX_SHEET_NAME_LENGTH]; //!< Can be null terminated, doesn't need to be null terminated
float z_offset; //!< Z_BABYSTEP_MIN .. Z_BABYSTEP_MAX = Z_BABYSTEP_MIN*2/1000 [mm] .. Z_BABYSTEP_MAX*2/1000 [mm]
float z_offset; //!< Z_BABYSTEP_MIN .. Z_BABYSTEP_MAX = Z_BABYSTEP_MIN*2/1000 [mm] .. Z_BABYSTEP_MAX*2/1000 [mm]
};

inline bool operator==(Sheet lhs, Sheet rhs) {
Expand Down
Loading

0 comments on commit 7a6a46a

Please sign in to comment.