wctltya Posted December 9, 2016 Report Share Posted December 9, 2016 Hi, I'm wondering what could be the reason that my touch screen is not polled? Actually, it is polled, but once at reset and then during gfxSleepMilliseconds() only. I'm sure, because I'm watching the low level interface with a logic analyzer. So, the driver is working properly and the data are delivered to the library trough GMOUSE_DRIVER_VMT get function. There is no OS, i.e. RAW32 is used. Because I don't see the big picture I don't know shall I init/manage somehow thread(s) and even shall I define GDISP_NEED_MULTITHREAD TRUE? Is there any additional info about how to implement properly RAW32? Link to comment Share on other sites More sharing options...
inmarket Posted December 9, 2016 Report Share Posted December 9, 2016 Touch polling occurs using a gtimer. Gtimer uses a second thread so the touch polling is reliant on the gtimer thread getting cpu time. Raw32 is a non-preemptive scheduler. That means it will only change threads when gfxYield() gets called. gfxYield is called within any gfx sleeping or waiting routine eg geventEventWait and gfxSleepMillseconds. So the behaviour you are seeing is expected. If you want it to touch poll while you are doing other cpu intensive things you will need to add gfxYield calls periodically in your code so that the gtimer thread has an opportunity to run. Yes GDISP_NEED_MULTITHREAD needs to be set to TRUE because you are running more than one thread. If you haven't explicitly set it in your gfxconf.h you will probably be getting a compile warning telling you that it is automatically turning itself on. There is a wiki article on implementing raw32. There are only two routines that need to be defined - it is very simple. Link to comment Share on other sites More sharing options...
wctltya Posted December 9, 2016 Author Report Share Posted December 9, 2016 Thank you very much for the quick replay inmarket. The GDISP_NEED_MULTITHREAD is defined TRUE. Actually I've used gfxSleepMillseconds accidentally, therefore I had a chance to see mouse poll during it. Because until now I didn't have the touch screen(delayed delivery), there is no events handling implemented so far. Although there is pe = geventEventWait(&glistener, 0), 'pe' is not used. Where I can see a RAW32 implementation/demo? Link to comment Share on other sites More sharing options...
inmarket Posted December 9, 2016 Report Share Posted December 9, 2016 Any of the ugfx demos will run under raw32 (or any other ugfx supported operating system). Thats the point of ugfx. It provides a portable environment for embedded displays. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 9, 2016 Report Share Posted December 9, 2016 5 hours ago, wctltya said: Where I can see a RAW32 implementation/demo? As @inmarket mentioned any µGFX demo will run on the RAW32 port. Regarding the implementation: All you need to do in order to run the RAW32 port is implementation two functions which is documented here: https://wiki.ugfx.io/index.php/BareMetal I'm not sure whether there has been a misunderstanding of some kind. Please don't hesitate to ask if you have still any questions left. Link to comment Share on other sites More sharing options...
inmarket Posted December 9, 2016 Report Share Posted December 9, 2016 Check the ugfx directory /demos/modules/gwin/widgets. This demo contains a full demo of the windowing system and widgets. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now