Re: [Emc-developers] LCD

2012-10-05 Thread andy pugh
On 5 October 2012 02:16, Dave Hylands wrote: > Kent mentioned this, but I thought I'd put it a bit more explicitly. > It works because do_div is a macro and not a function. Supplementary question, where the hell is it? Compiling in kernel mode it just worked, but trying to build with configure

Re: [Emc-developers] LCD

2012-10-04 Thread Kent A. Reed
On 10/4/2012 9:38 PM, andy pugh wrote: > But I thought C always passed by value. This is not the case here. Dave clarified exactly this point---do_div() is *not* a C function, it just looks like one syntactically, and hence evades the C-passes-by-value rule. Reading my first reply, I see I went

Re: [Emc-developers] LCD

2012-10-04 Thread andy pugh
On 5 October 2012 02:06, Kent A. Reed wrote: > That "in-place bit" you question refers to the black magic in do_div() > (which is actually a macro that generates asm code) that replaces the > dividend by the quotient during the computation and returns the > remainder as the value of the function.

Re: [Emc-developers] LCD

2012-10-04 Thread Dave Hylands
Hi Andy, On Thu, Oct 4, 2012 at 4:13 PM, andy pugh wrote: > On 4 October 2012 01:37, Dave Hylands wrote: > >> There is do_div (for all architectures) and div_u64_rem (for x86) in >> > > do_div appears to be almost perfect. But I really don't understand it. > > I can pull out the digits really e

Re: [Emc-developers] LCD

2012-10-04 Thread Kent A. Reed
On 10/4/2012 7:13 PM, andy pugh wrote: > On 4 October 2012 01:37, Dave Hylands wrote: > >> There is do_div (for all architectures) and div_u64_rem (for x86) in >> > do_div appears to be almost perfect. But I really don't understand it. > > I can pull out the digits really easily with > >

Re: [Emc-developers] LCD

2012-10-04 Thread sam sokolik
Man - that flicker is going to be annoying... ;) sam On 10/04/2012 07:43 PM, andy pugh wrote: > On 4 October 2012 17:26, Dave Hylands wrote: > >>> I found do_div, but missed div_u64_rem. > Using do_div I now have 20 digits available, which exceeds the > precision of the "double" datatype, so seem

Re: [Emc-developers] LCD

2012-10-04 Thread andy pugh
On 4 October 2012 17:26, Dave Hylands wrote: >> I found do_div, but missed div_u64_rem. Using do_div I now have 20 digits available, which exceeds the precision of the "double" datatype, so seems sufficient. as a bonus it is also faster. The test panel display now takes a max of 4.1uS to generat

Re: [Emc-developers] LCD

2012-10-04 Thread andy pugh
On 4 October 2012 01:37, Dave Hylands wrote: > There is do_div (for all architectures) and div_u64_rem (for x86) in > do_div appears to be almost perfect. But I really don't understand it. I can pull out the digits really easily with for (i = c ; i > 0 ; i--){

Re: [Emc-developers] LCD

2012-10-04 Thread Dave Hylands
Hi, On Thu, Oct 4, 2012 at 2:17 AM, andy pugh wrote: > On 4 October 2012 01:37, Dave Hylands wrote: > . >>> Using a U64 would allow me to support 19 digits, but there is no >>> 64-bit division or modulus in the kernel which makes it more tricky. >> >> There is do_div (for all architectures) and

Re: [Emc-developers] LCD

2012-10-04 Thread andy pugh
On 4 October 2012 01:37, Dave Hylands wrote: . >> Using a U64 would allow me to support 19 digits, but there is no >> 64-bit division or modulus in the kernel which makes it more tricky. > > There is do_div (for all architectures) and div_u64_rem (for x86) in > I found do_div, but missed div_u64

Re: [Emc-developers] LCD

2012-10-03 Thread Dave Hylands
Hi Andy, On Wed, Oct 3, 2012 at 5:07 PM, andy pugh wrote: > On 3 October 2012 19:26, Sebastian Kuzminsky wrote: > >> That looks great! > > Glad you think so. > I have a supplementary question. > > I can support an arbitrary precision and width by using a lot of > floating-point, i.e. a floating-

Re: [Emc-developers] LCD

2012-10-03 Thread andy pugh
On 3 October 2012 19:26, Sebastian Kuzminsky wrote: > That looks great! Glad you think so. I have a supplementary question. I can support an arbitrary precision and width by using a lot of floating-point, i.e. a floating-point / or * 10 for every digit in the floats. The example display takes 1

Re: [Emc-developers] LCD user interface

2007-01-24 Thread Eric H. Johnson
Jeff, Thanks for the input. For the first cut, I think straight C should be more than adequate because the functions already exist in emcsh.c to perform the needed operations (Estop off, Machine on, jog, start/pause/resume/stop, etc.) via a simple call to the associated function. As to the serial

Re: [Emc-developers] LCD user interface

2007-01-24 Thread Ray Henry
Hi Jeff On Tue, 2007-01-23 at 19:51 -0600, Jeff Epler wrote: > I wrote the python 'emc' interface with the idea that many programs > could use it to send and receive NML messages, not just the AXIS GUI. > It is GUI agnostic, and can also be used for commandline programs like > mdi.py and jdi.py <

Re: [Emc-developers] LCD user interface

2007-01-23 Thread Jeff Epler
I wrote the python 'emc' interface with the idea that many programs could use it to send and receive NML messages, not just the AXIS GUI. It is GUI agnostic, and can also be used for commandline programs like mdi.py and jdi.py . (however, there are probably some pa