|
From: Matthias T. <mt...@we...> - 2010-08-07 11:56:33
|
Hi Pito, it took quite a while, sorry for that > However with 2variable "seconds" definition: > > decimal > 2variable ticker > 2variable seconds > 262144. 2constant clkpi ( clk per interrupt = 256*prescaler ) > 1. ticker 2! > 0. seconds 2! > \ overflow2 interupt service routine > \ ! not optimised yet > : tick_isr > ticker 2@ clkpi d- ticker 2! > ticker 2@ clkpi d< if f_cpu ticker 2@ d+ ticker 2! > 1. seconds 2@ d+ seconds 2! > then ; > > it crashes in such a way I have to reflash rom to get access to system. > What is the trick here? well, a small bug leads to the error: amforth does not compile double cell numbers into the colon words, only single cell constants. I have no fix yet (still working on it). A workaround is a definition like : double1 1. ; and use of the double1 instead of 1. ... double1 seconds 2@ d+ seconds 2! ... that works for me with your code (without crash and increasing seconds after many tick_isr calls). Matthias |