On 21 Mag, 18:33, Diego <jose.di...@[EMAIL PROTECTED]
> wrote:
> On May 20, 4:25 am, Albe <alberto_res...@[EMAIL PROTECTED]
> wrote:
>
> > I agree aku ankka, it doesn't benefit render faster than the refresh
> > rate of the display, I have to refresh only when a new data occours
> > but the WM_PAINT message is faster than the data. I have associated
> > the high CPU usage with the faster WM_PAINT message, I'm not sure that
> > it is correct, I tried to eliminate the WM_PAINT function in
> > OpenGLControl::OnPaint and the CPU usage decrease to 15-25%, I tried
> > to comment the code in OpenGLControl::OnPaint (I create the
> > openglwindows but I don't draw aniting) the CPU usage stay to 95-98%.
>
> > To USB I read a serial data composed to 10 bytes, the time betwenn two
> > samples is settable at 50 Hz, 100Hz, 400Hz and 1000Hz. My driver
> > maximum speed is 600 Hz (I have same problem when the device write at
> > 1000 Hz but is not my priority now).
>
> > Thank you for sup****t
>
> you must be pooling when reading from USB
> can you switch to a blocking I/O ? this will save CPU resources a lot
My problem is to control the WM_PAINT, this message arrives also when
the data is not available and this probably overload the CPU


|