-
Posts
1,307 -
Joined
-
Last visited
-
Days Won
4
Content Type
Forums
Store
Downloads
Blogs
Everything posted by inmarket
-
The problem here is a physical one that can't be overcome in software. There are 2 fundamental issues: SPI flash is SLOW SPI flash is not memory addressable by the CPU Yes, I know that some CPU's support memory addressing of SPI flash and in those the uGFX code works unchanged however the speed considerations are still a problem for practical use. So, how to make SPI work for storage of fonts... Treat the SPI flash as a disk and connect it with the GFILE module Use the dynamic loading font mechanism to load the font you want into memory. Whilst this still uses RAM for the font you have loaded, the advantage here is that it can be unloaded when not needed and potentially a different font can then be loaded from your SPI flash. So, not a full solution but instead a work around. Unfortunately it is the only way to get around what is a physical hardware limitation.
-
The function might be called sprintg or something like that (I am off-computer presently so can't see the proper function name). It is the ugfx equivalent of sprintf. Note: sprintf from the c library won't work as it is also not utf8 aware at all. Sprintg (the ugfx equivalent) may work when you use %s to include the character (obviously as part of a string). I don't expect it to work with %c or as part of the format string itself. Note: this is a work around that should work but there are no guarantees. To be fixed properly this requires substantial changes to the printf engine in ugfx. The extra complexity is the whole reason very few sprintf implementations support it except on desktop systems like Windows or Linux.
-
Also check you are not running X. If it is running it will take over the framebuffer device and then ugfx will not be able to set the video mode.
-
It looks like the "failed to set video mode" was correct. When you turn off USE_SET_MODE it assumes that the video mode has been set correctly before the ugfx application starts. This is obviously not true in your situation. I am surprised it was able to display anything at all. Whilst I haven't had a look at the code recently, from memory it tries to auto-detect the correct mode by looking for a framebuffer mode that matches the pixel format. Some questions here that might help you find the problem: 1. The original pi project was against an early pi hardware model. What model are you using? 2. What Linux variant are you using? Is it the same as the sample project? I suspect not given the differences in compiler flags. Your compiler obviously does not support the flags required by the original pi. 3. Check if the kernel you are using even has the Linux framebuffer compiled into it and what modes it supports. This is the most likely reason it is not working for you.
-
I have had a decent look at this. Unfortunately it is not easy to fix. The issue is that gwinPrintf is processing the string byte by byte rather than utf8 character by utf8 character. This is completely consistent with the original C standard printf but definitely not what you need. To get around this in the short term gsprintf it into a text buffer and then string print that. Note: even with this, %c will not work for utf8 extended chars but %s will. I am currently deep in implementing generic rotation for text drawing for ugfx v3 so it will probably be a while before I can come back to solve this properly.
-
Some adjustments are made by the window manager for things like borders. There is also a difference between inner and outer dimensions. The particular details I can't remember off the top of my head. Have a look through the code to see.
-
Sorry, I have been away and unable to respond. I will be back this coming weekend and will have a good look as soon as I can. The most likely reason is gwinPrintf is processing byte by byte rather than character by character.
-
A simple way is to just add a timeout value of x seconds instead of gDelayNone. If you get a NULL response then you have a timeout and the screen can be turned off. A non-NULL response can turn the screen back on if it was off.
-
Hmm. Without looking at the code, it looks like a utf8 encoding problem. The reason I have this suspicion is that for the label you are getting a single character output, for the console you are getting a two character output. I suspect that while the two strings look the same they are actually encoded differently. Both the console and the label use the same underlying font routines so the only way they would give different output for the same input is if perhaps the console is printing byte by byte instead of character by character or string print. Try putting the string into a variable and then using that variable to print both the label and the console. If you get the same result let me know and I will go digging.
-
Mixing licenses is not usually a problem unless one of the licenses is expansive i.e. it tries to govern source code not explicitly licensed under its own license. The most obvious example here is GPL which says you need to publish source code for the entire project (not just the GPL portion) if you distribute a binary. This is called "copy-left" and is incredibly restrictive particularly for commercial applications or when other source code in the system has intellectual property considerations. LGPL however is perfectly fine. Somewhere on the ugfx site or in the documentation is a good explanation of this particularly with regard to GPL. As always when mixing licenses you need to meet the conditions on each license.
-
That screen needs to include the directory that has that stm header file. Your start up file, your compiler is complaining that it doesn't understand the assembly language. These are both problems relating to your ide and compiler. While we try to help here, we are not experts on those tools, we are ugfx experts. If the clues above don't help you, you will need to get help on a forum that understands your ide and compiler rather than here.
-
with regard to your 2nd screen, that looks like you are using the wrong assembly language variant to compile that start up file. Use the start up file that matches your ide compiler, or alternatively, some ide's allow you to specify the assembler you use.
-
Most likely cause for this is that the include directories path is not correct. I am not sure how to specify these in your ide, probably in the compiler options. These end up as -I directives in the compiler arguments. The -I directives must include the directory containing those stm header files.
-
BTW, a native image in ugfx terminology is a image that has the same pixel format that the ugfx system uses in an unpacked pixel arrangement (maximum of 1 pixel per byte, word or dword depending on the number of the pixel bits)
-
You can use the BMP image handling in ugfx. BMP images support a 1 bit per pixel format. The only thing you may need to do is to fabricate a BMP header. Because BMP also support RLE encoded formats you may also be able to compress your 1 bit images and so save rom/ram. Writing a bitblit routine for your driver to handle your "special format" image is probably not the best way to handle this. Similarly with your alpha request, use the image processing support built into ugfx. For example, ugfx handles transparent gif's. It also handles PNG images with an alpha channel although alpha blending is supported to varying degrees based on your display controller.
-
Ginput handles mouse or touch events and any other input such as keyboard.
-
It sounds like something is going on with your memory allocator. The uGFX logo is actually not an image. It is a series of rectangles drawn on the screen. It is therefore possible that this call is the first call to the memory allocator. That is something you can test and debug. The other possibility is that the image is corrupt somehow. This is easy to check by looking at the parameters that are going to be used by the palette allocation and seeing if they are reasonable. Another possibility is that you have stack checking turned on in your compile. Many memory allocators are assumed to be single threaded and will hard-fault if running on a thread on a stack other than the main threads. Given you are running FreeRTOS which is multi-thread aware you can assume that its allocator is multi-thread capable however still check that you are compiling without stack checking turned on.
-
Last I tested that was sufficient.
-
Generally you would read the analog input in the dial driver directly. GADC is designed for when you have a single ADC device with multiple inputs, some of which you want to use for high speed sampling e.g. for audio, and some for low speed sampling such as dial devices. There is currently only one GADC driver, for the SAM7 cpu which has a single ADC that reads 8 input lines simultaneously. GADC is then required to pick off samples at low frequency from sampling that is occurring much faster say for the purpose of GAUDIO. If you are not in such a circumstance GADC is probably overkill and the dial input analog input can be read directly in the dial driver.
-
I have finally had a chance to check the line in question. That line is never used - it is a comment put in for use by the documentation system doxygen. You can see the corresponding conditional compilation on line 132. The line that actually gets used is the block of macros between line 304 and 313 for true color pixel formats. So, in a proper compile it will correctly generate the color mapping.
-
Need an elegant button press event (for press and hold)
inmarket replied to hyperspherical's topic in Support
If you want to create a latched button use the checkbox instead with a button draw routine instead of the normal checkbox draw routine. The draw routine already exists and the checkbox provides the latched button state and events you are after. -
Glad to be able to help.
-
Each display driver creates a GDisplay object to hold its run-time data. The first display in the system gets assigned to the GDISP pointer. All drivers, of any type, are maintained in a GDriver list. In your case because the init process is not happening correctly GDISP is totally invalid.
-
This looks like GDISP is set to some random value in flash. It is certainly not valid. The GDISP variable is not initialised until after the first display driver is initialised so don't expect it to be valid until after that. With regard to eclipse - I don't use it but I know there are many in the community that do. Personally I much prefer the make system - just create a makefile (I can't remember off the top of my head where the master example one is) and it does everything for you.
-
The problem here is a build problem. GDISP builds in 2 possible modes - single display and multiple display. Which it uses is a complex combination of include paths, variables in gfxconf.h and linking. The build results in quite different code for the two options. If your gdisp_lld_init is not being called it means you have this process wrong. First GDISP_TOTAL_DISPLAYS, GDISP_DRIVER_LIST and GDISP_PIXEL_FORMAT should not be defined at all in your gfxconf.h for a single display. Instead the specific driver directory you want to use should be on your compiler INCLUDE path and the specific driver files should be included in the build. Also, the various _options.h files should not be altered. All your customizations should be in your gfxconf.h file. See the example demo programs and the provided gfx.conf.example file in the top directory. In general look carefully at the provided build files and the wiki if you have any questions.