Skip to content

Commit

Permalink
Merge pull request #4 from MaximumChungus/main
Browse files Browse the repository at this point in the history
Update 01-09-2021
  • Loading branch information
Guilouz authored Aug 31, 2021
2 parents 827cf89 + 80469e0 commit 3f3d043
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 242 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
// @section info

// Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "(Cyril Guislain, SuperRacer Nano V3)" // Who made the changes.
#define STRING_CONFIG_H_AUTHOR "(Cyril Guislain, Brandon Salahat, SuperRacer Nano V3)" // Who made the changes.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)

/**
Expand Down
8 changes: 5 additions & 3 deletions Marlin/src/HAL/STM32/eeprom_wired.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }

bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
uint8_t v = *value;

// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!

uint8_t * const p = (uint8_t * const)pos;
if (v != eeprom_read_byte(p)) {
//SKS Nano V3 AT24C32D EEPROM has 1M erase/write cycles! (https://www.microchip.com/en-us/product/at24c32d)
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
if (eeprom_read_byte(p) != v) {
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
Expand Down
54 changes: 31 additions & 23 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,53 +1269,61 @@ void setup() {

SETUP_LOG("setup() completed.");

if(Flsun_language == 1)//英语 新增
setFLSunLanguage(Flsun_language);
setFLSunHours(total_time);
print_thr_adress_string(0x13,0x40,"V1.2.1");//显示版本号
print_thr_adress_string(0x13,0x30,"Marlin 2.0.8");//显示版本号
if(recovery.exists())//新增
{
jump_to(04);
my_print_state = PAUSING;//暂停
}
else
{
jump_to(01);
}

}

void setFLSunHours(const millis_t time) {
char cmd[5] = {0};//新增
sprintf_P(cmd,"%ld",time/60);
print_thr_adress_string(0x17,0x00,cmd);
}

void setFLSunLanguage(const uint16_t lang) {
if(lang == 1)//英语 新增
{
change_en();
}
else if(Flsun_language == 2)//中文简体
else if(lang == 2)//中文简体
{
change_zh_CN();
}
else if(Flsun_language == 3)//中文繁体
else if(lang == 3)//中文繁体
{
change_zh_TW();
}
else if(Flsun_language == 4)//俄语
else if(lang == 4)//俄语
{
change_ru();
}
else if(Flsun_language == 5)//法语
else if(lang == 5)//法语
{
change_fr();
}
else if(Flsun_language == 6)//西班牙语
else if(lang == 6)//西班牙语
{
change_es();
}
else if(Flsun_language == 7)//德语
else if(lang == 7)//德语
{
change_de();
}
else if(Flsun_language == 8)//日语
else if(lang == 8)//日语
{
change_jp();
}
char cmd[5] = {0};//新增
sprintf_P(cmd,"%ld",total_time/60);
print_thr_adress_string(0x17,0x00,cmd);
print_thr_adress_string(0x13,0x40,"V1.2.1");//显示版本号
print_thr_adress_string(0x13,0x30,"Marlin 2.0.8");//显示版本号
if(recovery.exists())//新增
{
jump_to(04);
my_print_state = PAUSING;//暂停
}
else
{
jump_to(01);
}

}

/**
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/MarlinCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <stdlib.h>

void stop();
void setFLSunLanguage(const uint16_t lang);
void setFLSunHours(const millis_t time);

// Pass true to keep steppers from timing out
void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false));
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,6 @@
#endif
#endif

// If platform requires early initialization of watchdog to properly boot
#if ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)
#define EARLY_WATCHDOG 1
#endif

// Full Touch Screen needs 'tft/xpt2046'
#if EITHER(TOUCH_SCREEN, HAS_TFT_LVGL_UI)
#define HAS_TFT_XPT2046 1
Expand Down
10 changes: 4 additions & 6 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,10 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/
planner.e_factor[active_extruder] = 1.0f;
#endif

#if IS_KINEMATIC
if (is_fast)
prepare_fast_move_to_destination();
else
#endif
prepare_line_to_destination();
if (TERN0(IS_KINEMATIC, is_fast))
TERN(IS_KINEMATIC, prepare_fast_move_to_destination(), NOOP);
else
prepare_line_to_destination();

feedrate_mm_s = old_feedrate;
feedrate_percentage = old_pct;
Expand Down
Loading

0 comments on commit 3f3d043

Please sign in to comment.