Jump to content

king2

Members
  • Posts

    117
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by king2

  1. JFYI: gdisp.c, assign sedge, eedge, startTen, endTan: Warning[Pa093]: implicit conversion from floating point to integer. (float) needs to be added before rvalue. gtimer.c: THREAD_RETURN(0) after while(1) raises Warning[Pe111]: statement is unreachable gwin.c: _gwinDrawEnd(gh) after return in gwinGetPixelColor - same warning
  2. Sorry for writing to this topic. but I have similar needs. I have two displays, one of them is ordinary display with RGB565, and second one - framebuffer with GRAYSCALE256 pixel format. I need to write text to this framebuffer, and after text will be drawn on it - set it as front framebuffer to be actually displayed at screen. I make my own draws in framebuffer (not using uGFX), then call gdispGDrawStringBox, then switch buffers. On screen I can see or normal (fully rendered) text, or incompletely rendered text, or even part of text with gray color, part of it with white color (why? it renders text twice?). I cannot use pixmaps because text should be drawn over pixels in framebuffer, not copied as rectangular area with pixmap background. I also want to be able to switch buffers only when I will be sure that everything is drawn on back framebuffer. Pixmaps is the only way to get synchronous draws in uGFX? Maybe there is a way to tell uGFX that some calls should be rendered immediately and in a synchronous way (do not return from function until it will draw everything requested)?
  3. This is a reason of smooth displaying. This display have its internal framebuffer, not loading MCU's bus for pixel reading (and as I understand, can prioritize pixel reads for itself). This is good reason for me to not use LTDC + external RAM next time
  4. I have complicated interface with imagebuttons, audio levels, memory settings, labels with live data from another devices and so on, and scope inside all this. If I will change framebuffers, I can get sutiation when uGFX from another thread changed text of label, and this change will be applied to current framerbuffer only, so I will get two framebuffers with different text, and will get label's text changing on screen 25 or 50 times per second, which is definitely not right Or I should copy data from current framebuffer to shadow one before I will write something new to shadow framebuffer, which is slow, as you mentioned. I'm already using single layer with RGB565 (turning 2nd layer causes flicker, RGB888 - then same), and I still near bandwidth limits. I have AT070TN92 display, and it should be configured for 60Hz refresh rate). Having USB limits me to 168MHz clock, and SDRAM works at 84MHz, this slows down thing a little bit more. I copied gdisp_lld_STM32LTDC.c to another place and modified it - removed replaced LayerOff with driverCfg.fglayer, filled up second layer definition with my data (707x145 pixels with L8). As uGFX cannot use different color schemes for two displays, my scope widget just uses framebuffer as piece of memory - draws points or lines by itself. So I have normal widget in main screen, that draws container box and ticks only once - when widget appears on screen. It is not important what will be inside - it covers with second (foreground) layer, where scope traces will appear. I use two framebuffers for scope located at different internal banks of SDRAM, and switch between them each second frame, so I got almost stable picture of graphs without flickering and similar effects. Also I have to disable second layer when switching pages and turn it back when returning to main page. All this was done by price of lowering LCD refresh rate to 1/2 of its minimal rate. It works, but looks not so cool than at normal rate. At this point I found that ChibiOS SDRAM example uses CAS3 and HCLK/3 as clock. I have reviewed all SDRAM parameters, changed clock to HCLK/2, and got everything working without framerate flickering. Buy I have a question: does uGFX draws everything immediately or it can just remember 'draw tasks' and do it later? I have an idea: increase vertical porch of LTDC to free up time where I can access to SDRAM without any interference with display, and call actual drawing in this time (in interrupt, for example)? Thanks!
  5. Thank you for clarification! I like idea with double buffering, but how can I control moment when I should rotate framebuffers? OK, I have primary framebuffer 1 and shadow framebuffer 2. I write to FB2, then switch it to be main. But I cannot write to ex-primary buffer, because it contains not current info, I should copy all 800x480 pixels from new primary to new shadow (ex-primary) buffer, and then I can draw something on it, isn't it? Or I will have two buffers each filled with half of my screen changes (because not only my Scope widget draws on screen, I have also other button, labels and other widgets which updated from another threads). Have you an example of such double buffering and some best practices how to do it with uGFX?
  6. Those demos uses redraw each time when new pixel was arrived, I receive data at frequency of 100Hz. As I do not know previous state of display, I cannot delete old trace, because: I use lines, not points pixel data can be shifted by more than one or two pixels My problem is: when using pixmaps, it is slow when using direct draw, it is flickers, because draws executing immediately and wi=rites directly to display buffer But maybe, i do not understand something. Where is a main difference between my approach and approach of gaudio demo? As I understand, I use 'area clear' when gaudio uses pixel-by-pixel deletion of old trace, and I do not know what is faster (because area fill should be inclredibly fast using DMA2D).
  7. Hi! I'm trying to implement oscilloscope widget on STM32F429 with LTDC screen 800x480 and SDRAM attached to it. I'm using ChibiOS as RTOS. I have tried to just draw traces on screen, but with relatively high refresh rate (~25fps) it start to flicker, because each time I draw changes on screen, I need to fill area with black, draw border, ticks and, finally, traces, so I can see my widget in different stages of this process (which looks like flickering). I have tried to use pixmaps, but pixmap for my oscilloscope area (709x150) requires ~212k of RAM, which is definitely does not fit to MCU SRAM. I have tried different things and found: Using pixmaps really helps against flicker Using pixmaps slows down refresh rate for 5 or even 10 times Using pixmaps with HEAP located on SDRAM slows down refresh rate for 10 to 30 times Slowing down things SO MUCH with pixmaps was really unexpected for me. Maybe I forgot to turn some defines or something like this? Pixmap init uses gfxAlloc, so I can use or heap on SDRAM, or does not use pixmaps at all (in my case). Maybe there is a way to use pixmaps on SDRAM while keeping system heap in SRAM? Here is part of code (init): gw->pixmap = gdispPixmapCreate(gw->w.g.width, gw->w.g.height); gw->surface = gdispPixmapGetBits(gs->pixmap); Usage: // draw fresh field for everything gdispGFillArea(gs->pixmap, 0, 0, gw->g.width, gw->g.height, gw->pstyle->background); // clear the area gdispGDrawBox(gs->pixmap, 0, 0, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_SYSENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge); // draw border for (unsigned short x = gw->g.x+SCOPE_PIXELS_PER_TICK; x < gw->g.x+gs->size_x; x += SCOPE_PIXELS_PER_TICK) { gdispGDrawLine(gs->pixmap, 1, gw->g.height-6, 1, gw->g.height-2, Gray); } ... loop for traces gdispGDrawLine(gs->pixmap, x, prev_pixel, x+1, y, scope_colors[trace]); ... end of loop gdispBlitArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gs->surface); Can you give me advice? Thanks!
  8. If somebody will met this problem with ChibiOS, you can see my post here: http://www.chibios.com/forum/viewtopic.php?f=16&t=3961&p=29188#p29188. It contains example of my ICF linker file, that was solved this problem.
  9. I found the problem. I got all my backups and have tried to find when it was failed. Indeed, this was stack overflow to memory area used by GIF decoder. I had IRQSTACK with size 0x400, placed at start of RAM_region (from 0x20000000 to 0x20000400, then variables, then HEAP. Everything was ok. After I was removed linker instruction to place IRQSTACK at start of memory (I needed start for another common variable with bootloader), it was placed just before HEAP (after variables), and here problems were started. I have tried also increase size of IRQSTACK, and it works even in new place, so it was really interrupt stack overflow (but i still cannot understand why it worked before at start and with old size). So, problem is found, and I go to read about sysheap, heap, different stacks, and how chibios works with all this. Thank you very much for helping me and sorry for disturbing you for a such dumb reason (but I think this thread can be helpful to other newbies like me).
  10. Hi, i'm backl I have returned to my old project and was found very strange behavior of one button - it displays in a very strange way (see attachments). First picture is a initial look of button, and second one was shot after I have pressed it once (sorry for so big and not sharp photos, but I have no better camera now). These diagonal lines should be just like in lower button - in gray color. I have tried to update uGFX to last one (2.5 -> 2.7) with no luck. I have tried to change order or image definitions - this was not changed anything. I have tried to load other picture in this button - other image was distorted like first 'button_usb_gray' image. This is my code (gdispImageOpenFile returns ERR_OK): gdispImageOpenFile(&button_usb_gray, "rsc/button_usb_gray.gif"); gdispImageOpenFile(&button_usb_green, "rsc/button_usb_green.gif"); gdispImageOpenFile(&button_usb_red, "rsc/button_usb_red.gif"); gdispImageOpenFile(&button_rec_gray, "rsc/button_rec_gray.gif"); gdispImageOpenFile(&button_rec_red, "rsc/button_rec_red.gif"); gdispImageOpenFile(&button_mic_gray, "rsc/button_mic_gray.gif"); gdispImageOpenFile(&button_mic_red, "rsc/button_mic_red.gif"); gdispImageOpenFile(&button_ruler, "rsc/button_ruler.gif"); But when I have tried to load images in different order - for example, place 'ruler' picture at first place, to be loaded first - I got 'ruler' button with bad image and 'usb_gray' image slightly distorted, so I know that distorted first one or two images that was loaded first. As I understand, if I'm not use caching, each redraw raises its own GIF 'read from flash and decode' process, using a little amount of memory for buffering, so this can be some ChibiOS issues or something else, that can rewrite SRAM pieces used in decoding process or something like this. I have tried to track what happens when image was redrawed, but was not able to see any errors returned, everything looks ok. Can you point me, what should I do next? What can I try with debugger to understand what is going on? Thank you in advance!
  11. Sorry to bring this thread up again, but I'm really started to write my own graph widget. As usual for me I want to use parts of existing graph widget, like its axis drawing routines, dotted lines and so on, but with my own modifications, mainly about taking data from app and autoscaling. I do not want to make widget from scratch, because Graph already have well-written optimized routines, that need not to be rewritten. I saw GADC example and its gwinosc widget, but it seems like it not uses Graph at all. Can I make widget that will use Graph as base class or something like this, but will use its own function for data preparing, will generate its own touch panel events and so on? How do to it if it is possible? Thanks!
  12. king2

    gWinContainer

    I have 7 windows already (2 or 3 more coming), with same background containing window header and static text on it with name of project; in one of that windows I wanted part of background to be clickable (tap on project name of main window should bring settings window on top). Which other way I can use to be absolutely compatible with µGFX developer's advices?
  13. king2

    gWinContainer

    You can make everything clickable just by placing a clear button over area you want to generate events:
  14. Sorry, but previous patch was a piece of junk. I was wrong modifying string 'in place', because it skips all rich text in all redraws except first one (I tested this on clock text, so everything looked ok). As this patch will be not included into main uGFX source code, I made another one, much simpler but still powerful, but it changes mcufont file. How it works: I use left-to-right rendering always, even with right justify it initializes default style at each rendering start it applies styles without transitions buffer and modifying source string, so it much simpler When initializing, you should use all as previous, but supplying transition buffer is not necessary, only styles description should be passed: rich_text_style_t rich_text_styles[] = { { Gray, 0, 0, 0, RT_CHANGE_TEXT_COLOR }, { Red, 0, 0, 0, RT_CHANGE_TEXT_COLOR }, { Gray, 0, 0, 0, RT_CHANGE_TEXT_COLOR|RT_STRIKETHROUGH }, { Blue, Yellow, 0, Red, RT_STRIKETHROUGH | RT_CHANGE_BG_COLOR } }; gdispRichTextSetStyles((rich_text_style_t *) &rich_text_styles, sizeof((rich_text_style_t *) rich_text_styles)); Patch file included. Feel free to ask questions, if you will have problems with it. rich_text_patch2.zip
  15. I tried to turn on text wrapping in uGFX and got text looking weird in some places. After little research I found a bug in gdisp.c, it uses mf_fillline_callback in function gdispGDrawStringBox(), but it should use mf_drawline_callback instead. I have changed callback name this way and now everything looks ok.
  16. I just decided to keep all files to be opened same way, with same type of variables and so on. Note that I'm telling about gdispImage type variables, generated by Studio for gui.c internal usage. It generates such variables for images that used in GUI, but not for additional ones (what I can understand, it do not knows what inside of such files, maybe not image at all). But I know for sure that I have only images there, so I made such hack for me. If you will make compressing, I still will define new gdispImage variables for additional files, and they still can be opened with: gdispImageOpenFile(<my generated gdispImage variable>, <ROMFS pathname>) I just take filename from romfs_files.h, change dashes to underscores and this is my new variable name. I add this variable into gui.c and into gui.h as extern, to be used in my main.c, just to keep all gdispImage variables definitions in one place (inside gui.c/gui.h). Sorry, if I misunderstood something.
  17. Thanks for answer! 2. You can get kickstarter edition IAR for free with 32k code size limitation, I think it can be enough for just a warnings testing. If not, it will still compile, and just not link, so you will see all warnings anyway What about line endings, please tell me where you are preparing uGFX files for distribution (i.e. archives for downloading and folder to be placed in Studio distribution), and I will write simple script for you, that will scan all files in folder and convert them into one type. Just tell me iа you want me to do this, which type do you want to be basic for all files and which OSs are you using in prepare process. 3 and 4. OK, I got it. So, if it was made this way for a reason, definitely it should be left as is, but it will be nice to make IAR not complaining about this. Maybe pragmas will help. If not, maybe it will be nice to document this behavior and make recommendations to users about which warning they can safely turn off in IAR (but this is worst case, because warning can be turned off only for entire project, this can produce false-negatives in source files not belonging to uGFX).
  18. I just copied guiCreate() that uses gdispImageOpenFile() to open images. Studio places additional files to romfs_files.h, but not declares variables to use these additional files. To place another one file into my firmware I do: place button somewhere in window assign new image file to it generate code in Studio copy generated .h file from rsc to my ../files folder add its name into "Additional files" section in Studio copy generated line with new file and gdispImageOpenFile() from gui.c to my main.c remove temporary button with its image re-generate code again use this new file in my firmware to replace another button's image (when, for example, I want to show user that recording was turned on) Using variables collected from romfs_files.h and defining them as extern in gui.c/gui.h allows me to keep all image variables in one place, and keep them intact (in fact, re-generate each time by prepare script) when re-generating code by Studio. So, I have only one place where all my files located on disk, and only one place where files are defined in sources and so on. I think it will be nice to add possibility to Studio to assign more than one image file some widgets (not touching uGFX code, but associate these files in Studio project with widget, just creating additional image variables and gdispImageOpenFile() calls). It will allow get 'spare' images for widgets if user wanted to replace images at runtime and it will delete all widget's images automatically if such widget will be deleted from Studio project.
  19. Just to keep things in one place.. I just tested 2.5. 1. It recognizes IAR as compiler #22, i.e. EDG, I have no idea why. I moved its detection to position upper than EDG, and it started to be #29, i.e. IAR. 2. Many non-native line ending warnings, in uGFX files and Studio generated files. I think it will be better to keep line endings or UNIX-like, or CRLF, but one standard for all files. 3. Also I have two warnings 'Warning[Pe301]: typedef name has already been declared (with same type)', it raises when compiling each file that uses header with structs: typedef struct point { coord_t x; /**< The x coordinate of the point. */ coord_t y; /**< The y coordinate of the point. */ } point, point_t; typedef struct GWindowObject { #if GWIN_NEED_WINDOWMANAGER // This MUST be the first member of the structure gfxQueueASyncItem wmq; /**< The next window (for the window manager) */ #endif const struct gwinVMT* vmt; /**< The VMT for this GWIN */ GDisplay * display; /**< The display this window is on */ coord_t x; /**< The position relative to the screen */ coord_t y; /**< The position relative to the screen */ coord_t width; /**< The width of this window */ coord_t height; /**< The height of this window */ color_t color; /**< The current foreground drawing color */ color_t bgcolor; /**< The current background drawing color */ uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */ #if GDISP_NEED_TEXT font_t font; /**< The current font */ #endif #if GWIN_NEED_CONTAINERS GHandle parent; /**< The parent window */ #endif } GWindowObject, * GHandle; I have no idea how to eliminate those warnings, I know C not so much, but its a most boring and repeating warnings 4. Warnings 'Warning[Pe083]: type qualifier specified more than once' about definitions like this: typedef const struct GDriverVMT const GDriverVMTList[1]; May be there is a reason to use const qualifier twice in same definition?
  20. When I saw uGFX and Studio for first time, Studio was just a example maker, i.e. you should start project in Studio, place widgets, see preview, generate code and.. that's all. If you need to shift some widget, change font or do something like this, you cannot, because you will lost all changes you made to sources. It is acceptable if you have small project and can do it manually by changing source code, but if your project is more complicated (like mine) or you want something special from uGFX (like me).. you simple cannot. Thanks to Tectu, he implemented some changes to Studio, so we can use Studio in all development process now! Mine process was more complicated at start, but I will describe below how I do this now. First of all, Studio can generate code for you. Lets see what we will get after code generation: functions that creates all windows for you (CreatePage*() in gui.c) guiShowPage() that will show selected window for you guiCreate() that will load all fonts and images, init defaults, create all pages and show default page (window) guiEventLoop() as example of events main loop main_sample.c as example of your main.c gfxconf.h with defines you selected in Studio header files with color styles, files and other resources You can take all these files and use in your project as is, but you can't change anything in output directory, because you will lost all your changes if you will re-generate source with Studio. So, I selected other way, I will use code generated by Studio, but with some modifications: main_sample.c not used I'm using more than one image per widget, to show status of hardware to user by icons guiCreate() copied from gui.c to my own application with little modifications, I'm not using supplied one (because I need specific startup with touch panel re-calibration by holding a key at start, and similar things) So, I need every resource to be defined as extern, CreatePage*() function as non-static and so on. Ok, lets accept this challenge! First, now we can generate header files with additional images, place them somewhere outside of output folder and set additional files in Settings->GFILE->Additional files. All these file will be included into romfs_files.h (but will not defined as variables). Second, we can use now post-generation script that will be called each time you pressed hammer icon in Studio just after all files were generated. You can do this by adding script to Settings->Generator->Scripts. You can use (or not) script for preview and for build actions. I wrote my own Perl script for post-build action. What is does: scans gui.c for handlers names like ah<something>_X or ah<something>_X_Y and converts them into array variables, like GHandle ahButton_dt[5] or GHandle ahLabel_mem[5][4], also adding them as extern into gui.h scans romfs_files.h for images, and adds them into gui.c as variables and to gui.h as extern variables (note again, additoinal files not defined as variables, so I should get them from this file) converts all CreatePage*() functions to non-static, to be called from my own main.c scans for fonts and also put them as extern into gui.h defines all widget styles as extern adds some custom defines into gfxconf.h, like GFX_USE_OS_CHIBIOS, GINPUT_TOUCH_USER_CALIBRATION_SAVE, GDISP_NEED_PIXELREAD, GFILE_MAX_GFILES and so on rewrites LoadMouseCalibration() definition as __weak (I'm using my own function). Note again, that I'm using my own version of guiCreate(), so I should have access to all fonts, images, widgetstyles and other resources from my own main.c. If you satisfied with default created guiCreate(), you can use sources as is, without using script at all (or make your own, depending on your needs). Now we can add window, some widget, add/change font or shift our labels, then press hammer icon in Studio, then compile and run our modified GUI in hardware just in couple of clicks! More important, we can use Studio in any step of our development, we can add some windows or widgets later, we can change everything even after firmware was finished. We are not limited by 'design GUI -> generate files -> develop firmware' sequence anymore!
  21. So, this define is not for indication that driver CAPABLE of reading pixels back, but for define that I WANT it to do such readings. Thanks you for clarifying this!
  22. I have tested this, it is not working. It recognizes as compiler #22, i.e. EDG, I have no idea why. I moved its detection to position upper than EDG, and it started to be #29, i.e. IAR. I suggest to make this change in uGFX repo. Then I compiled entire project, warnings I got follows: gdisp_lld_STM32LTDC.c Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\drivers\gdisp\STM32LTDC\gdisp_lld_STM32LTDC.c 1 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdisp\gdisp_driver.h 731 gfx_mk.c Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\src\gfx_mk.c 1 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 Warning[Pe1105]: #warning directive: "GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!" \ugfx\src\gos\gos_chibios.c 52 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdisp\gdisp.c 585 Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1728 Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1729 Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1855 Warning[Pa093]: implicit conversion from floating point to integer \ugfx\src\gdisp\gdisp.c 1856 Warning[Pe188]: enumerated type mixed with another type \ugfx\src\gdisp\gdisp.c 3308 Warning[Pe188]: enumerated type mixed with another type \ugfx\src\gdisp\gdisp.c 3368 Warning[Pe111]: statement is unreachable \ugfx\src\gtimer\gtimer.c 112 Warning[Pe111]: statement is unreachable \ugfx\src\gwin\gwin.c 330 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 91 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 110 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 121 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 122 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 122 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 123 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 124 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 127 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 128 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 134 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 169 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 235 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 235 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 294 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 327 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 474 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 499 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 545 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 549 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 549 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 612 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 613 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 650 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 672 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 677 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 697 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 703 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 703 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 762 Warning[Pe083]: type qualifier specified more than once \ugfx\src\ginput\ginput_mouse.c 798 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gfile\gfile.c 37 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gfile\gfile_fs_rom.c 37 gmouse_lld_FT5x06.c Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\drivers\ginput\touch\FT5x06\gmouse_lld_FT5x06.c 1 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60 Warning[Pe083]: type qualifier specified more than once \ugfx\src\gdriver\gdriver.h 90 Warning[Pe083]: type qualifier specified more than once \ugfx\drivers\ginput\touch\FT5x06\gmouse_lld_FT5x06.c 102 gui.c Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only issued once) \ugfx\gfx.h 1 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gdisp\gdisp.h 54 Warning[Pe301]: typedef name has already been declared (with same type) \ugfx\src\gwin\gwin.h 60
  23. I'm using now fresh driver and get same warning. What about GDISP_NEED_PIXELREAD, I just have no idea where I should use it. From one point of view, it is property of display driver, so it should be set in driver's header file. I have tried this but at moment compiler get into my board_STM32LTDC.h, GDISP_NEED_PIXELREAD already set by gfx_options.h and I get 'incompatible redefinition' warning. From other side, in examples it used in gfxconf.h, so I just added it to my prepare script, as I cannot add it directly from Studio. This works for me and warning about GDISP_NEED_PIXELREAD was disappeared.
  24. I needed to get a buttons with image and texts on it (see http://community.ugfx.org/files/file/11-%C2%B5gfx-studio/, first screenshot), but I wanted text to be placed not at default center, so I made custom draw routine for this: // structure with custom text positioning typedef struct { gdispImage* image; coord_t x; coord_t y; coord_t width; coord_t height; justify_t justify; } custom_button_t; // custom draw function void gwinButtonDraw_ImageText(GWidgetObject *gw, void *param) { coord_t sy; custom_button_t* params = (custom_button_t*)param; if (!params) { return; } const GColorSet* colors; if (!gwinGetEnabled((GHandle)gw)) { colors = &gw->pstyle->disabled; sy = 2 * gw->g.height; } else if ((gw->g.flags & GBUTTON_FLG_PRESSED)) { colors = &gw->pstyle->pressed; sy = gw->g.height; } else { colors = &gw->pstyle->enabled; sy = 0; } gdispGImageDraw(gw->g.display, params->image, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy); gdispGDrawStringBox(gw->g.display, gw->g.x+1+params->x, gw->g.y+1+params->y, params->width-2, params->height-2, gw->text, gw->g.font, colors->text, params->justify); } // define text positions and justify custom_button_t param_rec_gray = { &button_rec_gray, 0, 45, 86, 40, justifyCenter }; // usage gwinSetCustomDraw(ghButton_rec, gwinButtonDraw_ImageText, &param_rec_gray); This worked for me.
  25. Just place a ordinary button over everything that you want to turn into button. Than override draw routine of button with function that draws nothing. You're done. // define the function void gwinButtonDraw_Clean(GWidgetObject *gw, void *param) {} // draws a huge piece of best nothing we can get for free // use it gwinSetCustomDraw(ghButton_settings, gwinButtonDraw_Clean, NULL); Just receive events from this 'button' and do whatever you want to happen when user pressed, for example, a label.
×
×
  • Create New...