Skip to content

Commit

Permalink
the bool update
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasToka committed Jul 24, 2023
1 parent 5884496 commit 004eb2c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Marlin/src/lcd/rts/e3s1pro/lcd_rts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ void RTSSHOW::RTS_HandleData(void)
#if ENABLED(POWER_LOSS_RECOVERY)
if(recovery.recovery_flag && PoweroffContinue)
{
power_off_type_yes = 1;
power_off_type_yes = true;
Update_Time_Value = 0;
RTS_SndData(ExchangePageBase + 10, ExchangepageAddr);
change_page_font = 10;
Expand Down Expand Up @@ -4239,7 +4239,7 @@ void EachMomentUpdate(void)
{
#if ENABLED(POWER_LOSS_RECOVERY)
// print the file before the power is off.
if((power_off_type_yes == 0) && lcd_sd_status && (recovery.info.recovery_flag == true))
if(!power_off_type_yes && lcd_sd_status && recovery.recovery_flag)
{
rtscheck.RTS_SndData(ExchangePageBase, ExchangepageAddr);
if(startprogress < 100)
Expand All @@ -4250,7 +4250,7 @@ void EachMomentUpdate(void)
if((startprogress += 1) > 100)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
power_off_type_yes = 1;
power_off_type_yes = true;
for(uint16_t i = 0;i < CardRecbuf.Filesum;i ++)
{
if(!strcmp(CardRecbuf.Cardfilename[i], &recovery.info.sd_filename[1]))
Expand All @@ -4268,7 +4268,7 @@ void EachMomentUpdate(void)
#endif

#if ENABLED(POWER_LOSS_RECOVERY)
else if((power_off_type_yes == 0) && (recovery.info.recovery_flag == false))
else if(!power_off_type_yes && !recovery.recovery_flag)
{
rtscheck.RTS_SndData(ExchangePageBase, ExchangepageAddr);
if(startprogress < 100)
Expand All @@ -4279,7 +4279,7 @@ void EachMomentUpdate(void)
if((startprogress += 1) > 100)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
power_off_type_yes = 1;
power_off_type_yes = true;
Update_Time_Value = RTS_UPDATE_VALUE;
change_page_font = 1;
int16_t fileCnt = card.get_num_items();
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/lcd/rts/e3s1pro/lcd_rts.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "../../../inc/MarlinConfig.h"

extern bool power_off_type_yes;

// #pragma once
/*********************************/

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/rts/e3s1pro/lcd_rts_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ void RTSSHOW::RTS_HandleData_Laser(void)
#if ENABLED(POWER_LOSS_RECOVERY)
if(recovery.recovery_flag)
{
power_off_type_yes = 1;
power_off_type_yes = true;
Update_Time_Value = 0;
RTS_SndData(ExchangePageBase + 10, ExchangepageAddr);
change_page_font = 10;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ void EachMomentUpdateLaser(void)
{
#if ENABLED(POWER_LOSS_RECOVERY)
// print the file before the power is off.
if((power_off_type_yes == 0) && lcd_sd_status && (recovery.recovery_flag == true))
if(!power_off_type_yes && lcd_sd_status && (recovery.recovery_flag == true))
{
rtscheck.RTS_SndData(ExchangePageBase, ExchangepageAddr);
if(startprogress < 100)
Expand All @@ -1479,7 +1479,7 @@ void EachMomentUpdateLaser(void)
if((startprogress += 1) > 100)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
power_off_type_yes = 1;
power_off_type_yes = true;
for(uint16_t i = 0;i < CardRecbuf.Filesum;i ++)
{
if(!strcmp(CardRecbuf.Cardfilename[i], &recovery.info.sd_filename[1]))
Expand All @@ -1494,7 +1494,7 @@ void EachMomentUpdateLaser(void)
}
return;
}
else if((power_off_type_yes == 0) && (recovery.recovery_flag == false))
else if(!power_off_type_yes && (recovery.recovery_flag == false))
{
rtscheck.RTS_SndData(ExchangePageBase, ExchangepageAddr);
if(startprogress < 100)
Expand All @@ -1505,7 +1505,7 @@ void EachMomentUpdateLaser(void)
if((startprogress += 1) > 100)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
power_off_type_yes = 1;
power_off_type_yes = true;
Update_Time_Value = RTS_UPDATE_VALUE;

if(laser_device.is_laser_device()){
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/rts/e3s1pro/lcd_rts_laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extern bool StartPrint_flag;
extern float last_zoffset;
#endif

extern int power_off_type_yes;
extern bool power_off_type_yes;

//运动相关参数设置
// extern const float manual_feedrate_mm_m[];
Expand Down

0 comments on commit 004eb2c

Please sign in to comment.