Skip to content

Commit

Permalink
Merge branch 'Wii-attempt-#2' into Modern-Vintage-CNC
Browse files Browse the repository at this point in the history
  • Loading branch information
Domush committed Mar 15, 2022
2 parents 304756a + 59d5a12 commit 5dfa681
Show file tree
Hide file tree
Showing 112 changed files with 3,050 additions and 3,245 deletions.
6 changes: 3 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"marlinfirmware.auto-build",
"platformio.platformio-ide",
"MarlinFirmware.auto-build"
"MarlinFirmware.auto-build",
"marlinfirmware.auto-build",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
Expand Down
3 changes: 2 additions & 1 deletion mvCNC/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,8 @@
* Override with M201
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_ACCELERATION { 762, 762, 482 }
#define DEFAULT_MAX_ACCELERATION \
{ 600, 600, 300 }

#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
Expand Down
35 changes: 18 additions & 17 deletions mvCNC/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@
#if ENABLED(SHOW_BOOTSCREEN)
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
#if EITHER(HAS_MVCNCUI_U8GLIB, TFT_COLOR_UI)
#define BOOT_MVCNC_LOGO_SMALL // Show a smaller mvCNC logo on the Boot Screen (saving lots of flash)
// #define BOOT_MVCNC_LOGO_SMALL // Show a smaller mvCNC logo on the Boot Screen (saving lots of flash)
#endif
#endif

Expand Down Expand Up @@ -1363,7 +1363,7 @@
// LCD CNC Progress options
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
#if CAN_SHOW_REMAINING_TIME
//#define SHOW_REMAINING_TIME // Display estimated time to completion
#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME)
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
Expand Down Expand Up @@ -1410,7 +1410,7 @@
#define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls

#define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD CNC is finished
#define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep Z enabled so your bed stays in place
#define SD_FINISHED_RELEASECOMMAND "" // Use "M84XYE" to keep Z enabled so your bed stays in place

// Reverse SD sort to show "more recent" files first, according to the card's FAT.
// Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended.
Expand All @@ -1425,7 +1425,7 @@
//#define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu

#define EVENT_GCODE_SD_ABORT "G27" // G-code to run on SD Abort CNC (e.g., "G28XY" or "G27")
#define EVENT_GCODE_SD_ABORT "M5\nG0 Z70" // G-code to run on SD Abort CNC (e.g., "G28XY" or "G27")

#if ENABLED(PRINTER_EVENT_LEDS)
#define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
Expand Down Expand Up @@ -1516,7 +1516,7 @@
* This feature is enabled with 'M540 S1' or from the LCD menu.
* Endstops must be activated for this option to work.
*/
//#define SD_ABORT_ON_ENDSTOP_HIT
#define SD_ABORT_ON_ENDSTOP_HIT
//#define SD_REPRINT_LAST_SELECTED_FILE // On print completion open the LCD Menu and select the same file

Expand Down Expand Up @@ -1587,7 +1587,7 @@
//#define CONFIGURATION_EMBEDDING

// Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER
#define BINARY_FILE_TRANSFER

#if ENABLED(BINARY_FILE_TRANSFER)
// Include extra facilities (e.g., 'M20 F') supporting firmware upload via BINARY_FILE_TRANSFER
Expand Down Expand Up @@ -1636,7 +1636,7 @@
* NOTE: This method is less reliable as it can only catch hangups while
* interrupts are enabled.
*/
#define USE_WATCHDOG
// #define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
//#define WATCHDOG_RESET_MANUAL
#endif
Expand Down Expand Up @@ -1853,7 +1853,7 @@
//
// G60/G61 Position Save and Return
//
#define SAVED_POSITIONS 1 // Each saved position slot costs 12 bytes
#define SAVED_POSITIONS 5 // Each saved position slot costs 12 bytes

//
// G2/G3 Arc Support
Expand All @@ -1863,7 +1863,7 @@
#define MIN_ARC_SEGMENT_MM 0.1 // (mm) Minimum length of each arc segment
#define MAX_ARC_SEGMENT_MM 1.0 // (mm) Maximum length of each arc segment
#define MIN_CIRCLE_SEGMENTS 72 // Minimum number of segments in a complete circle
//#define ARC_SEGMENTS_PER_SEC 50 // Use the feedrate to choose the segment length
#define ARC_SEGMENTS_PER_SEC 50 // Use the feedrate to choose the segment length
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
//#define SF_ARC_FIX // Enable only if using SkeinForge with "Arc Point" fillet procedure
Expand Down Expand Up @@ -1900,7 +1900,7 @@
#endif

// Moves (or segments) with fewer steps than this will be joined with the next move
#define MIN_STEPS_PER_SEGMENT 6
#define MIN_STEPS_PER_SEGMENT 3

/**
* Minimum delay before and after setting the stepper DIR (in ns)
Expand Down Expand Up @@ -2029,7 +2029,7 @@
*
* - During Hold all Emergency Parser commands are available, as usual.
*/
// #define REALTIME_COMMANDS
#define REALTIME_COMMANDS

/**
* Send machine status updates to host (Useful for CNC/Laser)
Expand Down Expand Up @@ -3517,7 +3517,7 @@
/**
* Auto-report position with M154 S<seconds>
*/
// #define AUTO_REPORT_POSITION
#define AUTO_REPORT_POSITION

#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)

Expand Down Expand Up @@ -3557,9 +3557,9 @@
#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc.

// Enable and set a (default) feedrate for all G0 moves
#define G0_FEEDRATE (100 * 60) // (mm/min)
#define G0_FEEDRATE (30000) // (mm/min)
#ifdef G0_FEEDRATE
#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
// #define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
#endif

/**
Expand Down Expand Up @@ -3747,7 +3747,7 @@

#define EXPERIMENTAL_I2CBUS
#if ENABLED(EXPERIMENTAL_I2CBUS)
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
// #define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
#endif

/**
Expand Down Expand Up @@ -3787,9 +3787,10 @@
#if ENABLED(WII_NUNCHUCK)
// #define WII_NUNCHUCK_ENABLED // Enable nunchuck by default (Use M258 W[0/1] to disable/enable)
// #define WII_EN_PIN P0_10 // Pin sent HIGH when enabled via `M258 W1`
#define FAST_I2C // Most nunchucks use fast mode. Disable if yours doesn't respond.

// Pressing the C button enables full speed movements up to max_feed_rate for each respective axis
#define WII_SLOW_DIVISER 3 // Divide all speeds by value for slow (C unpressed) movements
#define WII_SLOW_DIVISER 4 // Divide all speeds by value for slow (C unpressed) movements

//#define INVERT_WII_X // Enable to reverse X axis jogging
//#define INVERT_WII_Y // Enable to reverse Y axis jogging
Expand Down Expand Up @@ -3935,7 +3936,7 @@
// A smaller font may be used on the Info Screen. Costs 2434 bytes of PROGMEM.
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
//#define USE_SMALL_INFOFONT
#define USE_SMALL_INFOFONT

/**
* ST7920-based LCDs can emulate a 16 x 4 character display using
Expand Down
2 changes: 1 addition & 1 deletion mvCNC/src/HAL/STM32/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define TIMER_INDEX_(T) TIMER##T##_INDEX // TIMER#_INDEX enums (timer_index_t) depend on TIM#_BASE defines.
#define TIMER_INDEX(T) TIMER_INDEX_(T) // Convert Timer ID to HardwareTimer_Handle index.

#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1kHz
#define TEMP_TIMER_FREQUENCY 1000 // Thermals::isr() is expected to be called at around 1kHz

// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
Expand Down
2 changes: 1 addition & 1 deletion mvCNC/src/core/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "utility.h"

#include "../mvCNCCore.h"
#include "../module/temperature.h"
#include "../module/pwm_temp_io.h"

void safe_delay(millis_t ms) {
while (ms > 50) {
Expand Down
10 changes: 5 additions & 5 deletions mvCNC/src/feature/bedlevel/ubl/ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ unified_bed_leveling ubl;
#include "../../../module/planner.h"
#include "../../../module/motion.h"
#include "../../../module/probe.h"
#include "../../../module/temperature.h"
#include "../../../module/pwm_temp_io.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h"
#endif

#include "math.h"
#include "math.h"

void unified_bed_leveling::echo_name() { SERIAL_ECHOPGM("Unified Bed Leveling"); }

Expand Down
2 changes: 1 addition & 1 deletion mvCNC/src/feature/controllerfan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "controllerfan.h"
#include "../module/stepper.h"
#include "../module/temperature.h"
#include "../module/pwm_temp_io.h"

ControllerFan controllerFan;

Expand Down
14 changes: 7 additions & 7 deletions mvCNC/src/feature/easythreed_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

#include "easythreed_ui.h"
#include "pause.h"
#include "../module/temperature.h"
#include "../module/jobcounter.h"
#include "../sd/cardreader.h"
#include "../gcode/queue.h"
#include "../module/motion.h"
#include "../module/planner.h"
#include "../mvCNCCore.h"
#include "../module/pwm_temp_io.h"
#include "../module/jobcounter.h"
#include "../sd/cardreader.h"
#include "../gcode/queue.h"
#include "../module/motion.h"
#include "../module/planner.h"
#include "../mvCNCCore.h"

EasythreedUI easythreed_ui;

Expand Down
6 changes: 3 additions & 3 deletions mvCNC/src/feature/fancheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#if HAS_FANCHECK

#include "fancheck.h"
#include "../module/temperature.h"
#include "../module/pwm_temp_io.h"

#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS)
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS)
bool FanCheck::measuring = false;
#endif
bool FanCheck::tacho_state[TACHO_COUNT];
Expand Down Expand Up @@ -128,7 +128,7 @@ void FanCheck::compute_speed(uint16_t elapsedTime) {
edge_counter[f] = 0;

// Check fan speed
constexpr int8_t max_extruder_fan_errors = TERN(HAS_PWMFANCHECK, 10000, 5000) / Temperature::fan_update_interval_ms;
constexpr int8_t max_extruder_fan_errors = TERN(HAS_PWMFANCHECK, 10000, 5000) / Thermals::fan_update_interval_ms;

if (rps[f] >= 20 || TERN0(HAS_AUTO_FAN, fanManager.autofan_speed[f] == 0))
errors_count[f] = 0;
Expand Down
8 changes: 4 additions & 4 deletions mvCNC/src/feature/hotend_idle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include "hotend_idle.h"
#include "../gcode/gcode.h"

#include "../module/temperature.h"
#include "../module/motion.h"
#include "../module/planner.h"
#include "../lcd/mvcncui.h"
#include "../module/pwm_temp_io.h"
#include "../module/motion.h"
#include "../module/planner.h"
#include "../lcd/mvcncui.h"

extern HotendIdleProtection hotend_idle;

Expand Down
2 changes: 1 addition & 1 deletion mvCNC/src/feature/leds/tempstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if ENABLED(TEMP_STAT_LEDS)

#include "tempstat.h"
#include "../../module/temperature.h"
#include "../../module/pwm_temp_io.h"

void handle_status_leds() {
static int8_t old_red = -1; // Invalid value to force LED initialization
Expand Down
36 changes: 18 additions & 18 deletions mvCNC/src/feature/mmu/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ MMU2 mmu2;
#include "../../lcd/mvcncui.h"
#include "../../libs/buzzer.h"
#include "../../libs/nozzle.h"
#include "../../module/temperature.h"
#include "../../module/planner.h"
#include "../../module/stepper.h"
#include "../../mvCNCCore.h"
#include "../../module/pwm_temp_io.h"
#include "../../module/planner.h"
#include "../../module/stepper.h"
#include "../../mvCNCCore.h"

#if ENABLED(HOST_PROMPT_SUPPORT)
#include "../../feature/host_actions.h"
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
#include "../../feature/host_actions.h"
#endif

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif

#define DEBUG_OUT ENABLED(MMU2_DEBUG)
#include "../../core/debug_out.h"
#define DEBUG_OUT ENABLED(MMU2_DEBUG)
#include "../../core/debug_out.h"

#define MMU_TODELAY 100
#define MMU_TIMEOUT 10
#define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0)
#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds
#define MMU_TODELAY 100
#define MMU_TIMEOUT 10
#define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0)
#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds

#define MMU2_COMMAND(S) tx_str(F(S "\n"))
#define MMU2_COMMAND(S) tx_str(F(S "\n"))

#if ENABLED(MMU_EXTRUDER_SENSOR)
#if ENABLED(MMU_EXTRUDER_SENSOR)
uint8_t mmu_idl_sens = 0;
static bool mmu_loading_flag = false;
#endif
Expand Down
Loading

0 comments on commit 5dfa681

Please sign in to comment.