- Posts: 4402
GUI
- PhracturedBlue
- Offline
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
My next step is a dialog box, as well as a method to 'disable' a gui object from interaction, so that when a dialog is up nothing else responds.
I think I will stick to the current idea of a fixed gui array, however I am going to change strings to pointers, this way the text can either come from a const, or ram depending on the need. A fixed array of mostly pointers is not going to impact the memory footprint so bad.
How did you come up with the memory footprint of my GUI system anyway? I was curious to figure that out myself, and on that what would you say is a limit of memory footprint the GUI can use?
For string tables perhaps we should have some sort of ability to grab this from library file or whatever resource we use so that multiple languages can easily be supported?
At either rate I will probably build a basic string table for now just to keep it organized until we can tackle that .
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I added LCD_SetFontColor()
I fixed the code to support large bmp files
I added a helper script that will show RAM and ROM usage when you run 'make' (but only if you compile for ARM)
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
so to go from your normal 24bit to 16bit color:
red(ff0000) -> f800
green(00ff00) -> 07e0
blue(0000ff) -> 001f
you can add this macro to target.h to make your life easier (untested):
#define RGB888_to_RGB565(r, g, b) (((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >>3))
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
There is a systick feature that can be used to trigger an interrupt/counter every millisec. I don't think I've got it turned on at the moment though.
I also would need to write something equivalent for the emulator. So at the moment there isn't anything available.
Here is something you can use until I have a properly abstracted solution (untested):
#include <sys/timeb.h>
uint32_t millitime()
{
struct timeb tp;
ftime(&tp);
return (tp.time * 1000) + tp.millitm;
}
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
timecheck = time();
... some code...
if ((time() - timecheck) >= 2000) { some code } // 2 second check
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
I am pretty sure if I check the memory usage of the GUI now it is MUCH smaller footprint then before, but I don't know exactly how much, I still need to install the arm toolchain to do a real compile, and I have no intention of installing a rom on my device until the FS is in place, it is my primary controller I fly with and I generally fly every day, and flashing roms multiple times a day is going to be a choir enough, let alone now when the possiblity of bricking it is higher then it will be down the road a little .
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Installing the arm chain is really simple.
use git to grab the summon-arm-toolchain (see the README) and then run the script. It will download everything you need and install it for you.
There is no risk of bricking your Tx. We now understand enough about the system to be entirely sure of that. There is also no reason for you to flash anything at the moment. I believe the emulator is sufficient for where we are now.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
1) Can you clean up all the compile warnings? We should keep the code warning free at all times
2) We need to decide on coding style. All thee code should have the same coding style. Specifically the following:
* Indent rules. Today I use 4 spaces, and you are using tabs
* block creation (where the {} go) I don't have a rule here, but generally I place {} on their own line for functions, and on the same line for conditionals/loops
I am not beholden to my rules, but to agree on a standard and stick to them. We could define indent or uncrustify rules but I'm not sure how constraining that would be. We should also setup some sort of lint rules as well. I tried splint, but it doesn't like the openocd headers. I'm not sure what it will take to get it working properly. Maybe something like clang would work better here.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
You can choose different fonts with LCD_SetFont(font) where 'font' is a number from 0 to 5) (I think font-6 is currently broken)
New fonts can be created using the GLCD font creator I think:
www.mikroe.com/eng/products/view/683/glcd-font-creator/
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.
- MatCat
- Topic Author
- Offline
- Posts: 168
Please Log in or Create an account to join the conversation.