Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
* development:
  added fix for windows file bug
  fixed optimization flag for clang on osx
  again 13% faster, tested and changed with highest optimization
  only wait for heating of bed in case temperature rises
  • Loading branch information
MaikStohn committed Apr 28, 2016
2 parents 04e80e4 + 1683921 commit f799b88
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions UP3DTRANSCODE/make.sh
Expand Up @@ -12,7 +12,7 @@ fi

if [[ "$OSTYPE" == "msys" ]]; then

$CC -std=c99 -O2 \
$CC -std=c99 -Ofast -fwhole-program -flto \
-I../UP3DCOMMON \
-o up3dtranscode.exe up3dconf.c hoststepper.c hostplanner.c gcodeparser.c ../UP3DCOMMON/up3ddata.c umcwriter.c up3dtranscode.c -lm

Expand All @@ -21,7 +21,7 @@ $STRIP up3dtranscode.exe
elif [[ "$OSTYPE" == "darwin"* ]]; then


$CC -std=c99 -O2 \
$CC -std=c99 -Ofast \
-I../UP3DCOMMON \
-framework IOKit \
-framework CoreFoundation \
Expand All @@ -31,9 +31,9 @@ $CC -std=c99 -O2 \
$STRIP up3dtranscode


elif [[ "$OSTYPE" == "linux-gnu" ]]; then
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then

$CC -std=c99 -O2 \
$CC -std=c99 -Ofast -fwhole-program -flto \
-I../UP3DCOMMON \
-o up3dtranscode up3dconf.c hoststepper.c hostplanner.c gcodeparser.c ../UP3DCOMMON/up3ddata.c umcwriter.c up3dtranscode.c -lm

Expand Down
12 changes: 8 additions & 4 deletions UP3DTRANSCODE/umcwriter.c
Expand Up @@ -32,6 +32,7 @@ static double umcwriter_Z;
static double umcwriter_Z_height;
static double umcwriter_print_time;
static char umcwriter_machine_type;
static int32_t umcwriter_bed_temp;

#ifdef X_REF_CALC
static double g_r0, g_r1, g_r2;
Expand All @@ -51,7 +52,8 @@ bool umcwriter_init(const char* filename, const double heightZ, const char machi
umcwriter_Z_height = heightZ;
umcwriter_print_time = 0;
umcwriter_machine_type = machine_type;

umcwriter_bed_temp = 0;

st_reset();
plan_reset();

Expand Down Expand Up @@ -163,11 +165,12 @@ void umcwriter_finish()
blk.pdat2.l = (time*100)/umcwriter_print_time;
change=true;
}

if( change )
{
fseek( umcwriter_file, -sizeof(UP3D_BLK), SEEK_CUR );
fwrite( &blk, sizeof(UP3D_BLK), 1, umcwriter_file );
fseek( umcwriter_file, 0, SEEK_CUR ); //workaround for windows bug
}
}
}
Expand Down Expand Up @@ -422,19 +425,20 @@ void umcwriter_set_bed_temp(int32_t temp, bool wait)
UP3D_PROG_BLK_SetParameter(&blk,PARA_HEATER_BED_ON,(temp)?1:0);
_umcwriter_write_file(&blk, 1);

if(wait)
if(wait && (temp>umcwriter_bed_temp) ) //only wait if new temperature is higher
{
UP3D_PROG_BLK_SetParameter(&blk,PARA_RED_BLUE_BLINK,400);
_umcwriter_write_file(&blk, 1);

uint32_t waitsec = (temp/settings.heatbed_wait_factor)*60;
uint32_t waitsec = ((temp-umcwriter_bed_temp)/settings.heatbed_wait_factor)*60;
umcwriter_pause(waitsec*1000);

UP3D_PROG_BLK_SetParameter(&blk,PARA_RED_BLUE_BLINK,200);
_umcwriter_write_file(&blk, 1);

umcwriter_set_report_data(-1,-1);
}
umcwriter_bed_temp = temp;
}

void umcwriter_set_report_data(int32_t layer, double height)
Expand Down
8 changes: 4 additions & 4 deletions UP3DTRANSCODE/up3dtranscode.c
Expand Up @@ -84,8 +84,8 @@ int main(int argc, char *argv[])
}

gcp_reset();
char line[1024];

char line[1024];
while( fgets(line,sizeof(line),fgcode) )
if( !gcp_process_line(line) )
return 0;
Expand All @@ -100,6 +100,6 @@ int main(int argc, char *argv[])
int m = print_time/60; printf("%02dm:",m); print_time -= m*60;
printf("%02ds",print_time);
printf(" / Nozzle Height: %.2fmm\n", nozzle_height);
return 0;

return 0;
}

0 comments on commit f799b88

Please sign in to comment.