diff --git a/firmware/hal_battery.c b/firmware/hal_battery.c index 2fd7dc5..e8dcb75 100644 --- a/firmware/hal_battery.c +++ b/firmware/hal_battery.c @@ -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); } } diff --git a/firmware/hal_keyboard.c b/firmware/hal_keyboard.c index 5b0b2b0..fddad1a 100644 --- a/firmware/hal_keyboard.c +++ b/firmware/hal_keyboard.c @@ -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)); } diff --git a/firmware/ui_cmdline.c b/firmware/ui_cmdline.c index 400bf74..aadfb9a 100644 --- a/firmware/ui_cmdline.c +++ b/firmware/ui_cmdline.c @@ -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 diff --git a/newrpl/transcendentals.c b/newrpl/transcendentals.c index 0d514d0..fb999cb 100644 --- a/newrpl/transcendentals.c +++ b/newrpl/transcendentals.c @@ -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; }