Generated files style

Post your requests and ideas on the future development of Visual TFT Software.
Post Reply
Author
Message
vt23
Posts: 44
Joined: 17 Jun 2014 10:36

Generated files style

#1 Post by vt23 » 05 Aug 2015 08:56

Hello,

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
Another wish:
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);... 
}
So variable TScreen* CurrentScreen should be declared extern (extern TScreen* CurrentScreen). And accroding to C standards we should declare extern variables in a header file (.h) not in .c file. Thus declaration extern TScreen* CurrentScreen should be placed in ..._objects.h file.
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

User avatar
viktor.milovanovic
Posts: 240
Joined: 08 Jun 2015 10:09

Re: Generated files style

#2 Post by viktor.milovanovic » 06 Aug 2015 11:10

Hello,

Thank you for the suggestions, I will pass this on to our software development team which is currently working on the vTFT.

Best regards,

Viktor Milovanovic

Post Reply

Return to “Visual TFT Wish List”