I use mikroC for PIC32.
I wish the code generated by VTFT had better style - according to C standards.
I use many additional source code files and header files. It would be very simpler to prevent multiple definitions (duplicity) if all header files (mainly ..._objects.h) contained
a guard (= preprocessor condition) like:
Code: Select all
#ifndef TEST_H_INCLUDED
#define TEST_H_INCLUDED
...
extern int tester1;
void test(void);
...
#endif
I would like to have the variable TScreen* CurrentScreen available for external use. It is very useful variable when you want to change some object (button with dynamic text) but only on the current screen. I don't want to see the data (e.g. from a sensor) to be drawn on every screen.
I usually use:
Code: Select all
if(CurrentScreen == &Screen2)
{... do something ...
DrawButton(&BtnAScr2);...
}
Now I have all my extern(s) declared in my header file but extern TScreen* CurrentScreen I must have in ..._events_code.c (because ..._objects.h is rewritten by V-TFT).
Even if the CurrentScreen variable will not be used by user, the (extern) declaration doesn't take any additional program space.
Best regards
VT