Added speed management. Fixed precision bug in trig_sincos

This commit is contained in:
claudio 2015-05-31 14:07:00 -04:00
parent 9be7634cb8
commit 8ac6dda431
4 changed files with 10 additions and 6 deletions

View file

@ -105,6 +105,7 @@ void busy_handler()
// PREVENT HIGH SPEED UNDER LOW BATTERY CONDITION
halSetNotification(N_HOURGLASS,0xf);
halFlags|=HAL_HOURGLASS;
halBusyEvent=-1;
if(halFlags&HAL_SLOWLOCK) return;
cpu_setspeed(192000000);
halFlags|=HAL_FASTMODE;
@ -115,6 +116,6 @@ void halSetBusyHandler()
{
if(!(halFlags&HAL_FASTMODE)) {
// START THE EVENT AGAIN
halBusyEvent=tmr_eventcreate(&busy_handler,500,0);
if(halBusyEvent<=0) halBusyEvent=tmr_eventcreate(&busy_handler,500,0);
}
}

View file

@ -444,7 +444,7 @@ BINT endCmdLineAndCompile()
return 0;
}
BINT endCmdLine()
void endCmdLine()
{
// END ALPHA MODE
halSwapCmdLineMode(0);
@ -1506,6 +1506,7 @@ void halOuterLoop()
do {
halRedrawAll(&scr);
keymsg=halWaitForKey();
halSetBusyHandler();
} while(!halProcessKey(keymsg));
}

View file

@ -385,9 +385,8 @@ if(rplSkipOb(CmdLineCurrentLine)!=TempObEnd) {
// FINALLY, WE HAVE THE ORIGINAL LINE AT THE END OF TEMPOB, AND ENOUGH MEMORY ALLOCATED TO MAKE THE MOVE
BINT tailchars=rplStrSize(CmdLineCurrentLine)-halScreen.CursorPosition;
BINT delbytes=0;
BYTEPTR delete_start=((BYTEPTR)CmdLineCurrentLine)+4+halScreen.CursorPosition;
BYTEPTR delete_end=utf8nskip(delete_start,delete_start+tailchars,length);
BYTEPTR delete_end=(BYTEPTR) utf8nskip((char *)delete_start,(char *)delete_start+tailchars,length);
// MOVE THE TAIL TO THE END

View file

@ -521,6 +521,7 @@ void trig_sincos(mpd_t *angle)
if(startexp>=savedprec) {
// VERY SMALL ANGLES
Context.prec=savedprec;
if(swap) {
// COS = 1
@ -581,13 +582,15 @@ void trig_sincos(mpd_t *angle)
mpd_add(&RReg[6],&RReg[5],&RReg[4],&Context);
}
// RESTORE PREVIOUS PRECISION
Context.prec-=MPD_RDIGITS;
}
if(negcos) RReg[6].flags|=MPD_NEG;
if(negsin) RReg[7].flags|=MPD_NEG;
// RESTORE PREVIOUS PRECISION
Context.prec-=MPD_RDIGITS;
}