Remove a bit of unused code which is disabled at compile time

Some of these have been used > 6 years and don't compile anymore.

Reason to want this removed is just to reduce the code we maintain
This commit is contained in:
gudnimg 2024-07-31 09:53:45 +00:00
parent 3f650a24aa
commit 2cbbdbacd5
13 changed files with 3 additions and 439 deletions

View File

@ -191,13 +191,6 @@ void dcode_3()
#include <avr/wdt.h>
#include "bootapp.h"
#if 0
extern float current_temperature_pinda;
extern float axis_steps_per_mm[NUM_AXIS];
#define LOG(args...) printf(args)
#endif //0
#define LOG(args...)
/*!

View File

@ -311,22 +311,7 @@ bool IR_sensor_analog::checkVoltage(uint16_t raw) {
puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected"));
return false;
}
/// newer IR sensor cannot normally produce 0-0.3V, this is considered a failure
#if 0 // Disabled as it has to be decided if we gonna use this or not.
if(IRsensor_Hopen_TRESHOLD <= raw && raw <= IRsensor_VMax_TRESHOLD) {
puts_P(PSTR("fsensor v0.4 in fault range 0.0-0.3V - wrong IR sensor"));
return false;
}
#endif
}
/// If IR sensor is "uknown state" and filament is not loaded > 1.5V return false
#if 0
#error "I really think this code can't be enabled anymore because we are constantly checking this voltage."
if((sensorRevision == SensorRevision::_Undef) && (raw > IRsensor_Lmax_TRESHOLD)) {
puts_P(PSTR("Unknown IR sensor version and no filament loaded detected."));
return false;
}
#endif
// otherwise the IR fsensor is considered working correctly
return true;
}

View File

@ -367,9 +367,6 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y);
#endif //HEATBED_ANALYSIS
float temp_comp_interpolation(float temperature);
#if 0
void show_fw_version_warnings();
#endif
uint8_t check_printer_version();
#ifdef PINDA_THERMISTOR

View File

@ -887,31 +887,6 @@ void factory_reset()
}
KEEPALIVE_STATE(IN_HANDLER);
}
#if 0
void show_fw_version_warnings() {
if (FW_DEV_VERSION == FW_VERSION_GOLD || FW_DEV_VERSION == FW_VERSION_RC) return;
switch (FW_DEV_VERSION) {
case(FW_VERSION_BETA): lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_BETA); break;
case(FW_VERSION_ALPHA):
case(FW_VERSION_DEVEL):
case(FW_VERSION_DEBUG):
lcd_update_enable(false);
lcd_clear();
#if (FW_DEV_VERSION == FW_VERSION_DEVEL || FW_DEV_VERSION == FW_VERSION_ALPHA)
lcd_puts_at_P(0, 0, PSTR("Development build !!"));
#else
lcd_puts_at_P(0, 0, PSTR("Debbugging build !!!"));
#endif
lcd_puts_at_P(0, 1, PSTR("May destroy printer!"));
lcd_puts_at_P(0, 2, PSTR("FW")); lcd_puts_P(PSTR(FW_VERSION_FULL));
lcd_puts_at_P(0, 3, PSTR("Repo: ")); lcd_puts_P(PSTR(FW_REPOSITORY));
lcd_wait_for_click();
break;
// default: lcd_show_fullscreen_message_and_wait_P(_i("WARNING: This is an unofficial, unsupported build. Use at your own risk!")); break;////MSG_FW_VERSION_UNKNOWN c=20 r=8
}
lcd_update_enable(true);
}
#endif
#if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING)
//! @brief try to check if firmware is on right type of printer
@ -1382,10 +1357,6 @@ void setup()
setup_photpin();
#if 0
servo_init();
#endif
// Reset the machine correction matrix.
// It does not make sense to load the correction matrix until the machine is homed.
world2machine_reset();
@ -1534,9 +1505,6 @@ void setup()
#if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING)
check_if_fw_is_on_right_printer();
#endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING)
#if 0
show_fw_version_warnings();
#endif
}
switch (hw_changed) {
@ -5036,66 +5004,6 @@ void process_commands()
gcode_G81_M420();
}
break;
#if 0
/*!
### G82: Single Z probe at current location - Not active <a href="https://reprap.org/wiki/G-code#G82:_Single_Z_probe_at_current_location">G82: Single Z probe at current location</a>
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
*/
case 82:
SERIAL_PROTOCOLLNPGM("Finding bed ");
int l_feedmultiply = setup_for_endstop_move();
find_bed_induction_sensor_point_z();
clean_up_after_endstop_move(l_feedmultiply);
SERIAL_PROTOCOLPGM("Bed found at: ");
SERIAL_PROTOCOL_F(current_position[Z_AXIS], 5);
SERIAL_PROTOCOLPGM("\n");
break;
/*!
### G83: Babystep in Z and store to EEPROM - Not active <a href="https://reprap.org/wiki/G-code#G83:_Babystep_in_Z_and_store_to_EEPROM">G83: Babystep in Z and store to EEPROM</a>
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
*/
case 83:
{
int babystepz = code_seen('S') ? code_value() : 0;
int BabyPosition = code_seen('P') ? code_value() : 0;
if (babystepz != 0) {
//FIXME Vojtech: What shall be the index of the axis Z: 3 or 4?
// Is the axis indexed starting with zero or one?
if (BabyPosition > 4) {
SERIAL_PROTOCOLLNPGM("Index out of bounds");
}else{
// Save it to the eeprom
babystepLoadZ = babystepz;
eeprom_update_word_notify((uint16_t*)EEPROM_BABYSTEP_Z0 + BabyPosition, babystepLoadZ);
// adjust the Z
babystepsTodoZadd(babystepLoadZ);
}
}
}
break;
/*!
### G84: UNDO Babystep Z (move Z axis back) - Not active <a href="https://reprap.org/wiki/G-code#G84:_UNDO_Babystep_Z_.28move_Z_axis_back.29">G84: UNDO Babystep Z (move Z axis back)</a>
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
*/
case 84:
babystepsTodoZsubtract(babystepLoadZ);
// babystepLoadZ = 0;
break;
/*!
### G85: Pick best babystep - Not active <a href="https://reprap.org/wiki/G-code#G85:_Pick_best_babystep">G85: Pick best babystep</a>
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
*/
case 85:
lcd_pick_babystep();
break;
#endif
/*!
### G86 - Disable babystep correction after home <a href="https://reprap.org/wiki/G-code#G86:_Disable_babystep_correction_after_home">G86: Disable babystep correction after home</a>
@ -5638,42 +5546,6 @@ void process_commands()
KEEPALIVE_STATE(IN_HANDLER);
break;
#endif //!TMC2130
#if 0
case 48: // M48: scan the bed induction sensor points, print the sensor trigger coordinates to the serial line for visualization on the PC.
{
// Disable the default update procedure of the display. We will do a modal dialog.
lcd_update_enable(false);
// Let the planner use the uncorrected coordinates.
mbl.reset();
// Reset world2machine_rotation_and_skew and world2machine_shift, therefore
// the planner will not perform any adjustments in the XY plane.
// Wait for the motors to stop and update the current position with the absolute values.
world2machine_revert_to_uncorrected();
// Move the print head close to the bed.
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40);
st_synchronize();
// Home in the XY plane.
set_destination_to_current();
int l_feedmultiply = setup_for_endstop_move();
home_xy();
int8_t verbosity_level = 0;
if (code_seen('V')) {
// Just 'V' without a number counts as V1.
char c = strchr_pointer[1];
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
}
bool success = scan_bed_induction_points(verbosity_level);
clean_up_after_endstop_move(l_feedmultiply);
// Print head up.
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS],current_position[Z_AXIS] , current_position[E_AXIS], homing_feedrate[Z_AXIS]/40);
st_synchronize();
lcd_update_enable(true);
break;
}
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
#ifdef Z_PROBE_REPEATABILITY_TEST
@ -10793,94 +10665,6 @@ void save_print_file_state() {
saved_printing_type = PowerPanic::PRINT_TYPE_NONE;
//not sd printing nor usb printing
}
#if 0
SERIAL_ECHOPGM("SDPOS_ATOMIC="); MYSERIAL.println(sdpos_atomic, DEC);
SERIAL_ECHOPGM("SDPOS="); MYSERIAL.println(card.get_sdpos(), DEC);
SERIAL_ECHOPGM("SDLEN_PLAN="); MYSERIAL.println(sdlen_planner, DEC);
SERIAL_ECHOPGM("SDLEN_CMDQ="); MYSERIAL.println(sdlen_cmdqueue, DEC);
SERIAL_ECHOPGM("PLANNERBLOCKS="); MYSERIAL.println(int(moves_planned()), DEC);
SERIAL_ECHOPGM("SDSAVED="); MYSERIAL.println(saved_sdpos, DEC);
//SERIAL_ECHOPGM("SDFILELEN="); MYSERIAL.println(card.fileSize(), DEC);
{
card.setIndex(saved_sdpos);
SERIAL_ECHOLNPGM("Content of planner buffer: ");
for (unsigned int idx = 0; idx < sdlen_planner; ++ idx)
MYSERIAL.print(char(card.get()));
SERIAL_ECHOLNPGM("Content of command buffer: ");
for (unsigned int idx = 0; idx < sdlen_cmdqueue; ++ idx)
MYSERIAL.print(char(card.get()));
SERIAL_ECHOLNPGM("End of command buffer");
}
{
// Print the content of the planner buffer, line by line:
card.setIndex(saved_sdpos);
int8_t iline = 0;
for (unsigned char idx = block_buffer_tail; idx != block_buffer_head; idx = (idx + 1) & (BLOCK_BUFFER_SIZE - 1), ++ iline) {
SERIAL_ECHOPGM("Planner line (from file): ");
MYSERIAL.print(int(iline), DEC);
SERIAL_ECHOPGM(", length: ");
MYSERIAL.print(block_buffer[idx].sdlen, DEC);
SERIAL_ECHOPGM(", steps: (");
MYSERIAL.print(block_buffer[idx].steps_x, DEC);
SERIAL_ECHOPGM(",");
MYSERIAL.print(block_buffer[idx].steps_y, DEC);
SERIAL_ECHOPGM(",");
MYSERIAL.print(block_buffer[idx].steps_z, DEC);
SERIAL_ECHOPGM(",");
MYSERIAL.print(block_buffer[idx].steps_e, DEC);
SERIAL_ECHOPGM("), events: ");
MYSERIAL.println(block_buffer[idx].step_event_count, DEC);
for (int len = block_buffer[idx].sdlen; len > 0; -- len)
MYSERIAL.print(char(card.get()));
}
}
{
// Print the content of the command buffer, line by line:
int8_t iline = 0;
union {
struct {
char lo;
char hi;
} lohi;
uint16_t value;
} sdlen_single;
int _bufindr = bufindr;
for (int _buflen = buflen; _buflen > 0; ++ iline) {
if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) {
sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1];
sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2];
}
SERIAL_ECHOPGM("Buffer line (from buffer): ");
MYSERIAL.print(int(iline), DEC);
SERIAL_ECHOPGM(", type: ");
MYSERIAL.print(int(cmdbuffer[_bufindr]), DEC);
SERIAL_ECHOPGM(", len: ");
MYSERIAL.println(sdlen_single.value, DEC);
// Print the content of the buffer line.
MYSERIAL.println(cmdbuffer + _bufindr + CMDHDRSIZE);
SERIAL_ECHOPGM("Buffer line (from file): ");
MYSERIAL.println(int(iline), DEC);
for (; sdlen_single.value > 0; -- sdlen_single.value)
MYSERIAL.print(char(card.get()));
if (-- _buflen == 0)
break;
// First skip the current command ID and iterate up to the end of the string.
for (_bufindr += CMDHDRSIZE; cmdbuffer[_bufindr] != 0; ++ _bufindr) ;
// Second, skip the end of string null character and iterate until a nonzero command ID is found.
for (++ _bufindr; _bufindr < sizeof(cmdbuffer) && cmdbuffer[_bufindr] == 0; ++ _bufindr) ;
// If the end of the buffer was empty,
if (_bufindr == sizeof(cmdbuffer)) {
// skip to the start and find the nonzero command.
for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ;
}
}
}
#endif
}
void restore_print_file_state() {

View File

@ -95,21 +95,6 @@ static const CustomCharacter Font[] PROGMEM = {
#define CUSTOM_CHARACTERS_CNT (sizeof(Font) / sizeof(Font[0]))
static void lcd_display(void);
#if 0
static void lcd_no_display(void);
static void lcd_no_cursor(void);
static void lcd_cursor(void);
static void lcd_no_blink(void);
static void lcd_blink(void);
static void lcd_scrollDisplayLeft(void);
static void lcd_scrollDisplayRight(void);
static void lcd_leftToRight(void);
static void lcd_rightToLeft(void);
static void lcd_autoscroll(void);
static void lcd_no_autoscroll(void);
#endif
static void lcd_print_custom(uint8_t c);
static void lcd_invalidate_custom_characters();
@ -278,14 +263,6 @@ void lcd_display(void)
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#if 0
void lcd_no_display(void)
{
lcd_displaycontrol &= ~LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#endif
#ifdef VT100 //required functions for VT100
// Turns the underline cursor on/off
void lcd_no_cursor(void)
@ -301,60 +278,6 @@ void lcd_cursor(void)
}
#endif
#if 0
// Turn on and off the blinking cursor
void lcd_no_blink(void)
{
lcd_displaycontrol &= ~LCD_BLINKON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
void lcd_blink(void)
{
lcd_displaycontrol |= LCD_BLINKON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
// These commands scroll the display without changing the RAM
void lcd_scrollDisplayLeft(void)
{
lcd_command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
}
void lcd_scrollDisplayRight(void)
{
lcd_command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
}
// This is for text that flows Left to Right
void lcd_leftToRight(void)
{
lcd_displaymode |= LCD_ENTRYLEFT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This is for text that flows Right to Left
void lcd_rightToLeft(void)
{
lcd_displaymode &= ~LCD_ENTRYLEFT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This will 'right justify' text from the cursor
void lcd_autoscroll(void)
{
lcd_displaymode |= LCD_ENTRYSHIFTINCREMENT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
// This will 'left justify' text from the cursor
void lcd_no_autoscroll(void)
{
lcd_displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
#endif
/// @brief set the current LCD row
/// @param row LCD row number, ranges from 0 to LCD_HEIGHT - 1
static void FORCE_INLINE lcd_set_current_row(uint8_t row)

View File

@ -22,19 +22,6 @@ extern void lcd_clear(void);
extern void lcd_home(void);
/*extern void lcd_no_display(void);
extern void lcd_display(void);
extern void lcd_no_blink(void);
extern void lcd_blink(void);
extern void lcd_no_cursor(void);
extern void lcd_cursor(void);
extern void lcd_scrollDisplayLeft(void);
extern void lcd_scrollDisplayRight(void);
extern void lcd_leftToRight(void);
extern void lcd_rightToLeft(void);
extern void lcd_autoscroll(void);
extern void lcd_no_autoscroll(void);*/
extern void lcd_set_cursor(uint8_t col, uint8_t row);
/// @brief Change the cursor column position while preserving the current row position

View File

@ -499,19 +499,6 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
}
#endif // SUPPORT_VERBOSITY
#if 0
if (result == BED_SKEW_OFFSET_DETECTION_PERFECT && fabs(a1) < bed_skew_angle_mild && fabs(a2) < bed_skew_angle_mild) {
#ifdef SUPPORT_VERBOSITY
if (verbosity_level > 0)
SERIAL_ECHOLNPGM("Very little skew detected. Disabling skew correction.");
#endif // SUPPORT_VERBOSITY
// Just disable the skew correction.
vec_x[0] = MACHINE_AXIS_SCALE_X;
vec_x[1] = 0.f;
vec_y[0] = 0.f;
vec_y[1] = MACHINE_AXIS_SCALE_Y;
}
#else
if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) {
#ifdef SUPPORT_VERBOSITY
if (verbosity_level > 0)
@ -583,7 +570,6 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
}
#endif // SUPPORT_VERBOSITY
}
#endif
// Invert the transformation matrix made of vec_x, vec_y and cntr.
{
@ -3101,11 +3087,7 @@ void count_xyz_details(float (&distanceMin)[2]) {
eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8);
eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8);
eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8);
#if 0
a2 = -1 * asin(vec_y[0] / MACHINE_AXIS_SCALE_Y);
a1 = asin(vec_x[1] / MACHINE_AXIS_SCALE_X);
angleDiff = fabs(a2 - a1);
#endif
for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) {
float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1];
distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH);

View File

@ -372,9 +372,6 @@ extern const char MSG_NEW_FIRMWARE_AVAILABLE [] PROGMEM_I1 = ISTR("New firmware
extern const char MSG_NEW_FIRMWARE_PLEASE_UPGRADE [] PROGMEM_I1 = ISTR("Please upgrade."); ////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20
extern const char MSG_FW_MK3_DETECTED [] PROGMEM_I1 = ISTR(PRINTER_NAME " firmware detected on " PRINTER_NAME_ALTERNATE " printer"); ////MSG_FW_MK3_DETECTED c=20 r=4
//not internationalized messages
#if 0
const char MSG_FW_VERSION_BETA[] PROGMEM_N1 = "You are using a BETA firmware version! It is in a development state! Use this version with CAUTION as it may DAMAGE the printer!"; ////MSG_FW_VERSION_BETA c=20 r=8
#endif
const char MSG_SPOOL_JOIN[] PROGMEM_N1 = "SpoolJoin"; ////MSG_SPOOL_JOIN c=13
const char MSG_FIRMWARE[] PROGMEM_N1 = "Firmware"; ////MSG_FIRMWARE c=8
const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[] PROGMEM_N1 = "FlashAir"; ////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY c=8

View File

@ -372,9 +372,6 @@ extern const char MSG_NEW_FIRMWARE_PLEASE_UPGRADE [];
extern const char MSG_FW_MK3_DETECTED [];
//not internationalized messages
#if 0
extern const char MSG_FW_VERSION_BETA[];
#endif
extern const char MSG_SPOOL_JOIN[];
extern const char MSG_FIRMWARE[];
extern const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[];

View File

@ -762,49 +762,8 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate
#endif // ENABLE_AUTO_BED_LEVELING
// Apply the machine correction matrix.
{
#if 0
SERIAL_ECHOPGM("Planner, current position - servos: ");
MYSERIAL.print(st_get_position_mm(X_AXIS), 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(st_get_position_mm(Y_AXIS), 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(st_get_position_mm(Z_AXIS), 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, target position, initial: ");
MYSERIAL.print(x, 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(y, 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, world2machine: ");
MYSERIAL.print(world2machine_rotation_and_skew[0][0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[0][1], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[1][0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_rotation_and_skew[1][1], 5);
SERIAL_ECHOLNPGM("");
SERIAL_ECHOPGM("Planner, offset: ");
MYSERIAL.print(world2machine_shift[0], 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(world2machine_shift[1], 5);
SERIAL_ECHOLNPGM("");
#endif
world2machine(x, y);
#if 0
SERIAL_ECHOPGM("Planner, target position, corrected: ");
MYSERIAL.print(x, 5);
SERIAL_ECHOPGM(", ");
MYSERIAL.print(y, 5);
SERIAL_ECHOLNPGM("");
#endif
}
// The target position of the tool in absolute steps
// Calculate target position in absolute steps
//this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow

View File

@ -1147,25 +1147,6 @@ FORCE_INLINE static void soft_pwm_core()
#endif
} else WRITE(HEATER_0_PIN,0);
}
#if defined(HEATER_BED_PIN) && HEATER_BED_PIN > -1
#if 0 // @@DR vypnuto pro hw pwm bedu
// tuhle prasarnu bude potreba poustet ve stanovenych intervalech, jinak nemam moc sanci zareagovat
// teoreticky by se tato cast uz vubec nemusela poustet
if ((pwm_count & ((1 << HEATER_BED_SOFT_PWM_BITS) - 1)) == 0)
{
soft_pwm_b = soft_pwm_bed >> (7 - HEATER_BED_SOFT_PWM_BITS);
# ifndef SYSTEM_TIMER_2
// tady budu krokovat pomalou frekvenci na automatu - tohle je rizeni spinani a rozepinani
// jako ridici frekvenci mam 2khz, jako vystupni frekvenci mam 30hz
// 2kHz jsou ovsem ve slysitelnem pasmu, mozna bude potreba jit s frekvenci nahoru (a tomu taky prizpusobit ostatni veci)
// Teoreticky bych mohl stahnout OCR0B citac na 6, cimz bych se dostal nekam ke 40khz a tady potom honit PWM rychleji nebo i pomaleji
// to nicemu nevadi. Soft PWM scale by se 20x zvetsilo (no dobre, 16x), cimz by se to posunulo k puvodnimu 30Hz PWM
//if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1); else WRITE(HEATER_BED_PIN,0);
# endif //SYSTEM_TIMER_2
}
#endif
#endif
#ifdef FAN_SOFT_PWM
if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0)
@ -1182,14 +1163,6 @@ FORCE_INLINE static void soft_pwm_core()
#endif
}
#if 0 // @@DR
#if defined(HEATER_BED_PIN) && HEATER_BED_PIN > -1
if (soft_pwm_b < (pwm_count & ((1 << HEATER_BED_SOFT_PWM_BITS) - 1))){
//WRITE(HEATER_BED_PIN,0);
}
//WRITE(HEATER_BED_PIN, pwm_count & 1 );
#endif
#endif
#ifdef FAN_SOFT_PWM
if (soft_pwm_fan < (pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1))) WRITE(FAN_PIN,0);
#endif

View File

@ -80,16 +80,6 @@ uint8_t xflash_rd_status_reg(void)
return val;
}
#if 0
void w25x20cl_wr_status_reg(uint8_t val)
{
_CS_LOW();
_SPI_TX(_CMD_WR_STATUS_REG); // send command 0x90
_SPI_TX(val); // send value
_CS_HIGH();
}
#endif
static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr)
{
_SPI_TX(cmd); // send command 0x03

View File

@ -30,9 +30,6 @@ extern int8_t xflash_init(void);
extern void xflash_enable_wr(void);
extern void xflash_disable_wr(void);
extern uint8_t xflash_rd_status_reg(void);
#if 0
extern void w25x20cl_wr_status_reg(uint8_t val);
#endif
extern void xflash_rd_data(uint32_t addr, uint8_t* data, uint16_t cnt);
extern void xflash_sector_erase(uint32_t addr);