🎨 Misc. code cleanup
This commit is contained in:
@@ -73,18 +73,18 @@ void install_min_serial() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if DISABLED(DYNAMIC_VECTORTABLE)
|
#if DISABLED(DYNAMIC_VECTORTABLE)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__attribute__((naked)) void JumpHandler_ASM() {
|
__attribute__((naked)) void JumpHandler_ASM() {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"b CommonHandler_ASM\n"
|
"b CommonHandler_ASM\n"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) HardFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) BusFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) UsageFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) MemManage_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) NMI_Handler();
|
||||||
}
|
}
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) HardFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) BusFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) UsageFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) MemManage_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) NMI_Handler();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // POSTMORTEM_DEBUGGING
|
#endif // POSTMORTEM_DEBUGGING
|
||||||
|
@@ -33,18 +33,18 @@ static void TX(char c) { _DBC(c); }
|
|||||||
void install_min_serial() { HAL_min_serial_out = &TX; }
|
void install_min_serial() { HAL_min_serial_out = &TX; }
|
||||||
|
|
||||||
#if DISABLED(DYNAMIC_VECTORTABLE)
|
#if DISABLED(DYNAMIC_VECTORTABLE)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__attribute__((naked)) void JumpHandler_ASM() {
|
__attribute__((naked)) void JumpHandler_ASM() {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"b CommonHandler_ASM\n"
|
"b CommonHandler_ASM\n"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) HardFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) BusFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) UsageFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) MemManage_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"))) NMI_Handler();
|
||||||
}
|
}
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) HardFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) BusFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) UsageFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) MemManage_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"))) NMI_Handler();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // POSTMORTEM_DEBUGGING
|
#endif // POSTMORTEM_DEBUGGING
|
||||||
|
@@ -135,18 +135,18 @@ void install_min_serial() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if NONE(DYNAMIC_VECTORTABLE, STM32F0xx, STM32G0xx) // Cortex M0 can't jump to a symbol that's too far from the current function, so we work around this in exception_arm.cpp
|
#if NONE(DYNAMIC_VECTORTABLE, STM32F0xx, STM32G0xx) // Cortex M0 can't jump to a symbol that's too far from the current function, so we work around this in exception_arm.cpp
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__attribute__((naked)) void JumpHandler_ASM() {
|
__attribute__((naked)) void JumpHandler_ASM() {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"b CommonHandler_ASM\n"
|
"b CommonHandler_ASM\n"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) HardFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) BusFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) UsageFault_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) MemManage_Handler();
|
||||||
|
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) NMI_Handler();
|
||||||
}
|
}
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) HardFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) BusFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) UsageFault_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) MemManage_Handler();
|
|
||||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) NMI_Handler();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // POSTMORTEM_DEBUGGING
|
#endif // POSTMORTEM_DEBUGGING
|
||||||
|
@@ -445,7 +445,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
|
|||||||
// Wait for buffered blocks to complete
|
// Wait for buffered blocks to complete
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
|
|
||||||
#if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN
|
#if BOTH(ADVANCED_PAUSE_FANS_PAUSE, HAS_FAN)
|
||||||
thermalManager.set_fans_paused(true);
|
thermalManager.set_fans_paused(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -191,13 +191,13 @@ class FilamentSensorBase {
|
|||||||
public:
|
public:
|
||||||
static void setup() {
|
static void setup() {
|
||||||
#define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0);
|
#define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0);
|
||||||
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN)
|
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN);
|
||||||
REPEAT_1(NUM_RUNOUT_SENSORS, INIT_RUNOUT_PIN);
|
REPEAT_1(NUM_RUNOUT_SENSORS, INIT_RUNOUT_PIN)
|
||||||
#undef INIT_RUNOUT_PIN
|
#undef INIT_RUNOUT_PIN
|
||||||
|
|
||||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||||
#define INIT_MOTION_PIN(N) _INIT_RUNOUT_PIN(FIL_MOTION##N##_PIN, FIL_MOTION##N##_STATE, FIL_MOTION##N##_PULLUP, FIL_MOTION##N##_PULLDOWN)
|
#define INIT_MOTION_PIN(N) _INIT_RUNOUT_PIN(FIL_MOTION##N##_PIN, FIL_MOTION##N##_STATE, FIL_MOTION##N##_PULLUP, FIL_MOTION##N##_PULLDOWN);
|
||||||
REPEAT_1(NUM_MOTION_SENSORS, INIT_MOTION_PIN);
|
REPEAT_1(NUM_MOTION_SENSORS, INIT_MOTION_PIN)
|
||||||
#undef INIT_MOTION_PIN
|
#undef INIT_MOTION_PIN
|
||||||
#endif
|
#endif
|
||||||
#undef _INIT_RUNOUT_PIN
|
#undef _INIT_RUNOUT_PIN
|
||||||
@@ -212,9 +212,9 @@ class FilamentSensorBase {
|
|||||||
|
|
||||||
// Return a bitmask of runout flag states (1 bits always indicates runout)
|
// Return a bitmask of runout flag states (1 bits always indicates runout)
|
||||||
static uint8_t poll_runout_states() {
|
static uint8_t poll_runout_states() {
|
||||||
#define _OR_RUNOUT(N) | (FIL_RUNOUT##N##_STATE ? 0 : _BV(N - 1))
|
#define _INVERT_BIT(N) | (FIL_RUNOUT##N##_STATE ? 0 : _BV(N - 1))
|
||||||
return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_RUNOUT));
|
return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _INVERT_BIT));
|
||||||
#undef _OR_RUNOUT
|
#undef _INVERT_BIT
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||||
|
@@ -99,7 +99,7 @@ PGM_P GCodeQueue::injected_commands_P; // = nullptr
|
|||||||
*/
|
*/
|
||||||
char GCodeQueue::injected_commands[64]; // = { 0 }
|
char GCodeQueue::injected_commands[64]; // = { 0 }
|
||||||
|
|
||||||
void GCodeQueue::RingBuffer::commit_command(bool skip_ok
|
void GCodeQueue::RingBuffer::commit_command(const bool skip_ok
|
||||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
||||||
) {
|
) {
|
||||||
commands[index_w].skip_ok = skip_ok;
|
commands[index_w].skip_ok = skip_ok;
|
||||||
@@ -113,7 +113,7 @@ void GCodeQueue::RingBuffer::commit_command(bool skip_ok
|
|||||||
* Return true if the command was successfully added.
|
* Return true if the command was successfully added.
|
||||||
* Return false for a full buffer, or if the 'command' is a comment.
|
* Return false for a full buffer, or if the 'command' is a comment.
|
||||||
*/
|
*/
|
||||||
bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/
|
bool GCodeQueue::RingBuffer::enqueue(const char *cmd, const bool skip_ok/*=true*/
|
||||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
|
||||||
) {
|
) {
|
||||||
if (*cmd == ';' || length >= BUFSIZE) return false;
|
if (*cmd == ';' || length >= BUFSIZE) return false;
|
||||||
|
@@ -79,11 +79,11 @@ public:
|
|||||||
|
|
||||||
void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }
|
void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }
|
||||||
|
|
||||||
void commit_command(bool skip_ok
|
void commit_command(const bool skip_ok
|
||||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
||||||
);
|
);
|
||||||
|
|
||||||
bool enqueue(const char *cmd, bool skip_ok = true
|
bool enqueue(const char *cmd, const bool skip_ok=true
|
||||||
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1066,7 +1066,7 @@ namespace ExtUI {
|
|||||||
TPShowStatus = false;
|
TPShowStatus = false;
|
||||||
ZERO(ChangeMaterialbuf);
|
ZERO(ChangeMaterialbuf);
|
||||||
ChangeMaterialbuf[1] = ChangeMaterialbuf[0] = 10;
|
ChangeMaterialbuf[1] = ChangeMaterialbuf[0] = 10;
|
||||||
RTS_SndData(10 * ChangeMaterialbuf[0], FilamentUnit1); // It's ChangeMaterialbuf for show,instead of current_position[E_AXIS] in them.
|
RTS_SndData(10 * ChangeMaterialbuf[0], FilamentUnit1); // It's ChangeMaterialbuf for show, instead of current_position.e in them.
|
||||||
RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2);
|
RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2);
|
||||||
RTS_SndData(getActualTemp_celsius(H0), NozzleTemp);
|
RTS_SndData(getActualTemp_celsius(H0), NozzleTemp);
|
||||||
RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat);
|
RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat);
|
||||||
@@ -1381,7 +1381,7 @@ namespace ExtUI {
|
|||||||
case 0xF0: // not to cancel heating
|
case 0xF0: // not to cancel heating
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
RTS_SndData(10 * ChangeMaterialbuf[0], FilamentUnit1); // It's ChangeMaterialbuf for show,instead of current_position[E_AXIS] in them.
|
RTS_SndData(10 * ChangeMaterialbuf[0], FilamentUnit1); // It's ChangeMaterialbuf for show, instead of current_position.e in them.
|
||||||
RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2);
|
RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2);
|
||||||
}
|
}
|
||||||
else if (recdat.addr == FilamentUnit1) {
|
else if (recdat.addr == FilamentUnit1) {
|
||||||
|
@@ -31,9 +31,10 @@
|
|||||||
*
|
*
|
||||||
* ***************************************/
|
* ***************************************/
|
||||||
|
|
||||||
#include "string.h"
|
|
||||||
#include "../ui_api.h"
|
#include "../ui_api.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/*********************************/
|
/*********************************/
|
||||||
#define FHONE (0x5A)
|
#define FHONE (0x5A)
|
||||||
#define FHTWO (0xA5)
|
#define FHTWO (0xA5)
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#if HAS_TFT_LVGL_UI
|
#if HAS_TFT_LVGL_UI
|
||||||
|
|
||||||
#include "string.h"
|
|
||||||
#include "draw_ui.h"
|
#include "draw_ui.h"
|
||||||
#include "pic_manager.h"
|
#include "pic_manager.h"
|
||||||
#include "draw_ready_print.h"
|
#include "draw_ready_print.h"
|
||||||
@@ -34,6 +33,8 @@
|
|||||||
#include "../../../sd/cardreader.h"
|
#include "../../../sd/cardreader.h"
|
||||||
#include "../../../MarlinCore.h"
|
#include "../../../MarlinCore.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
extern uint16_t DeviceCode;
|
extern uint16_t DeviceCode;
|
||||||
|
|
||||||
#if HAS_MEDIA
|
#if HAS_MEDIA
|
||||||
|
0
buildroot/share/PlatformIO/variants/MARLIN_F103Rx/PeripheralPins.c
Executable file → Normal file
0
buildroot/share/PlatformIO/variants/MARLIN_F103Rx/PeripheralPins.c
Executable file → Normal file
@@ -27,4 +27,4 @@
|
|||||||
#ifdef USBCON
|
#ifdef USBCON
|
||||||
USB_DM = PA_11,
|
USB_DM = PA_11,
|
||||||
USB_DP = PA_12,
|
USB_DP = PA_12,
|
||||||
#endif
|
#endif
|
||||||
|
@@ -413,7 +413,7 @@ const PinMap PinMap_USB_OTG_HS[] = {
|
|||||||
*/
|
*/
|
||||||
{NC, NP, 0}
|
{NC, NP, 0}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAL_SD_MODULE_ENABLED
|
#ifdef HAL_SD_MODULE_ENABLED
|
||||||
WEAK const PinMap PinMap_SD[] = {
|
WEAK const PinMap PinMap_SD[] = {
|
||||||
@@ -430,4 +430,3 @@ WEAK const PinMap PinMap_SD[] = {
|
|||||||
{NC, NP, 0}
|
{NC, NP, 0}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user