Apply pointer formatting
This commit is contained in:
@ -51,10 +51,10 @@ class SDFileTransferProtocol {
|
||||
private:
|
||||
struct Packet {
|
||||
struct [[gnu::packed]] Open {
|
||||
static bool validate(char* buffer, size_t length) {
|
||||
static bool validate(char *buffer, size_t length) {
|
||||
return (length > sizeof(Open) && buffer[length - 1] == '\0');
|
||||
}
|
||||
static Open& decode(char* buffer) {
|
||||
static Open& decode(char *buffer) {
|
||||
data = &buffer[2];
|
||||
return *reinterpret_cast<Open*>(buffer);
|
||||
}
|
||||
@ -67,7 +67,7 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
static bool file_open(char* filename) {
|
||||
static bool file_open(char *filename) {
|
||||
if (!dummy_transfer) {
|
||||
card.mount();
|
||||
card.openFileWrite(filename);
|
||||
@ -79,7 +79,7 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool file_write(char* buffer, const size_t length) {
|
||||
static bool file_write(char *buffer, const size_t length) {
|
||||
#if ENABLED(BINARY_STREAM_COMPRESSION)
|
||||
if (compression) {
|
||||
size_t total_processed = 0, processed_count = 0;
|
||||
@ -150,7 +150,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void process(uint8_t packet_type, char* buffer, const uint16_t length) {
|
||||
static void process(uint8_t packet_type, char *buffer, const uint16_t length) {
|
||||
transfer_timeout = millis() + TIMEOUT;
|
||||
switch (static_cast<FileTransfer>(packet_type)) {
|
||||
case FileTransfer::QUERY:
|
||||
|
@ -205,7 +205,7 @@ void MeatPack::handle_rx_char(const uint8_t c, const serial_index_t serial_ind)
|
||||
handle_rx_char_inner(c); // Other characters are passed on for MeatPack decoding
|
||||
}
|
||||
|
||||
uint8_t MeatPack::get_result_char(char* const __restrict out) {
|
||||
uint8_t MeatPack::get_result_char(char * const __restrict out) {
|
||||
uint8_t res = 0;
|
||||
if (char_out_count) {
|
||||
res = char_out_count;
|
||||
|
@ -109,7 +109,7 @@ public:
|
||||
* @param out [in] Output pointer for unpacked/processed data.
|
||||
* @return Number of characters returned. Range from 0 to 2.
|
||||
*/
|
||||
uint8_t get_result_char(char* const __restrict out);
|
||||
uint8_t get_result_char(char * const __restrict out);
|
||||
|
||||
void reset_state();
|
||||
void report_state();
|
||||
|
@ -362,7 +362,7 @@ bool MMU2::rx_start() {
|
||||
/**
|
||||
* Check if the data received ends with the given string.
|
||||
*/
|
||||
bool MMU2::rx_str_P(const char* str) {
|
||||
bool MMU2::rx_str_P(const char *str) {
|
||||
uint8_t i = strlen(rx_buffer);
|
||||
|
||||
while (MMU2_SERIAL.available()) {
|
||||
@ -394,7 +394,7 @@ bool MMU2::rx_str_P(const char* str) {
|
||||
/**
|
||||
* Transfer data to MMU, no argument
|
||||
*/
|
||||
void MMU2::tx_str_P(const char* str) {
|
||||
void MMU2::tx_str_P(const char *str) {
|
||||
clear_rx_buffer();
|
||||
uint8_t len = strlen_P(str);
|
||||
LOOP_L_N(i, len) MMU2_SERIAL.write(pgm_read_byte(str++));
|
||||
@ -404,7 +404,7 @@ void MMU2::tx_str_P(const char* str) {
|
||||
/**
|
||||
* Transfer data to MMU, single argument
|
||||
*/
|
||||
void MMU2::tx_printf_P(const char* format, int argument = -1) {
|
||||
void MMU2::tx_printf_P(const char *format, int argument = -1) {
|
||||
clear_rx_buffer();
|
||||
uint8_t len = sprintf_P(tx_buffer, format, argument);
|
||||
LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]);
|
||||
@ -414,7 +414,7 @@ void MMU2::tx_printf_P(const char* format, int argument = -1) {
|
||||
/**
|
||||
* Transfer data to MMU, two arguments
|
||||
*/
|
||||
void MMU2::tx_printf_P(const char* format, int argument1, int argument2) {
|
||||
void MMU2::tx_printf_P(const char *format, int argument1, int argument2) {
|
||||
clear_rx_buffer();
|
||||
uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2);
|
||||
LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]);
|
||||
@ -511,7 +511,7 @@ static void mmu2_not_responding() {
|
||||
* Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
|
||||
* Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
|
||||
*/
|
||||
void MMU2::tool_change(const char* special) {
|
||||
void MMU2::tool_change(const char *special) {
|
||||
if (!enabled) return;
|
||||
|
||||
set_runout_valid(false);
|
||||
@ -598,7 +598,7 @@ static void mmu2_not_responding() {
|
||||
* Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
|
||||
* Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
|
||||
*/
|
||||
void MMU2::tool_change(const char* special) {
|
||||
void MMU2::tool_change(const char *special) {
|
||||
if (!enabled) return;
|
||||
|
||||
set_runout_valid(false);
|
||||
@ -692,7 +692,7 @@ static void mmu2_not_responding() {
|
||||
* Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
|
||||
* Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
|
||||
*/
|
||||
void MMU2::tool_change(const char* special) {
|
||||
void MMU2::tool_change(const char *special) {
|
||||
if (!enabled) return;
|
||||
|
||||
set_runout_valid(false);
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
static void reset();
|
||||
static void mmu_loop();
|
||||
static void tool_change(const uint8_t index);
|
||||
static void tool_change(const char* special);
|
||||
static void tool_change(const char *special);
|
||||
static uint8_t get_current_tool();
|
||||
static void set_filament_type(const uint8_t index, const uint8_t type);
|
||||
|
||||
@ -56,10 +56,10 @@ public:
|
||||
static bool eject_filament(const uint8_t index, const bool recover);
|
||||
|
||||
private:
|
||||
static bool rx_str_P(const char* str);
|
||||
static void tx_str_P(const char* str);
|
||||
static void tx_printf_P(const char* format, const int argument);
|
||||
static void tx_printf_P(const char* format, const int argument1, const int argument2);
|
||||
static bool rx_str_P(const char *str);
|
||||
static void tx_str_P(const char *str);
|
||||
static void tx_printf_P(const char *format, const int argument);
|
||||
static void tx_printf_P(const char *format, const int argument1, const int argument2);
|
||||
static void clear_rx_buffer();
|
||||
|
||||
static bool rx_ok();
|
||||
|
@ -106,7 +106,7 @@ class TFilamentMonitor : public FilamentMonitorBase {
|
||||
|
||||
// Handle a block completion. RunoutResponseDelayed uses this to
|
||||
// add up the length of filament moved while the filament is out.
|
||||
static inline void block_completed(const block_t* const b) {
|
||||
static inline void block_completed(const block_t * const b) {
|
||||
if (enabled) {
|
||||
response.block_completed(b);
|
||||
sensor.block_completed(b);
|
||||
@ -273,7 +273,7 @@ class FilamentSensorBase {
|
||||
}
|
||||
|
||||
public:
|
||||
static inline void block_completed(const block_t* const b) {
|
||||
static inline void block_completed(const block_t * const b) {
|
||||
// If the sensor wheel has moved since the last call to
|
||||
// this method reset the runout counter for the extruder.
|
||||
if (TEST(motion_detected, b->extruder))
|
||||
@ -307,7 +307,7 @@ class FilamentSensorBase {
|
||||
}
|
||||
|
||||
public:
|
||||
static inline void block_completed(const block_t* const) {}
|
||||
static inline void block_completed(const block_t * const) {}
|
||||
|
||||
static inline void run() {
|
||||
LOOP_L_N(s, NUM_RUNOUT_SENSORS) {
|
||||
@ -368,7 +368,7 @@ class FilamentSensorBase {
|
||||
runout_mm_countdown[extruder] = runout_distance_mm;
|
||||
}
|
||||
|
||||
static inline void block_completed(const block_t* const b) {
|
||||
static inline void block_completed(const block_t * const b) {
|
||||
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
|
||||
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
|
||||
const uint8_t e = b->extruder;
|
||||
@ -403,7 +403,7 @@ class FilamentSensorBase {
|
||||
return runout_flags;
|
||||
}
|
||||
|
||||
static inline void block_completed(const block_t* const) { }
|
||||
static inline void block_completed(const block_t * const) { }
|
||||
|
||||
static inline void filament_present(const uint8_t extruder) {
|
||||
runout_count[extruder] = runout_threshold;
|
||||
|
Reference in New Issue
Block a user