Browse Source

Make the uGFXMain() prototype always available

inmarket 3 years ago
parent
commit
7826664969
3 changed files with 12 additions and 5 deletions
  1. 12 0
      gfx.h
  2. 0 3
      src/gfx.c
  3. 0 2
      src/gos/gos_freertos.c

+ 12 - 0
gfx.h

@@ -229,6 +229,7 @@ extern "C" {
229 229
 	 * @note	If you define GFX_OS_EXTRA_DEINIT_FUNCTION in your gfxconf.h file the macro is the
230 230
 	 * 			name of a void function with no parameters that is called immediately before
231 231
 	 * 			operating system de-initialisation (as ugfx is exiting).
232
+	 * @note	If GFX_OS_CALL_UGFXMAIN is set uGFXMain() is called after all initialisation is complete.
232 233
 	 *
233 234
 	 * @api
234 235
 	 */
@@ -243,6 +244,17 @@ extern "C" {
243 244
 	 */
244 245
 	void gfxDeinit(void);
245 246
 
247
+	#if GFX_OS_CALL_UGFXMAIN || defined(__DOXYGEN__)
248
+		/**
249
+		 * @brief	The function containing all the user uGFX application code.
250
+		 *
251
+		 * @note	This is called by gfxInit() and is expected to never return.
252
+		 * 			It is defined by the user.
253
+		 *
254
+		 * @pre		GFX_OS_CALL_UGFXMAIN is GFXON
255
+		 */
256
+		void uGFXMain(void);
257
+	#endif
246 258
 #ifdef __cplusplus
247 259
 }
248 260
 #endif

+ 0 - 3
src/gfx.c

@@ -78,9 +78,6 @@ extern void _gosDeinit(void);
78 78
 	extern void _gtransInit(void);
79 79
 	extern void _gtransDeinit(void);
80 80
 #endif
81
-#if GFX_OS_CALL_UGFXMAIN
82
-	extern void uGFXMain(void);
83
-#endif
84 81
 
85 82
 void gfxInit(void)
86 83
 {

+ 0 - 2
src/gos/gos_freertos.c

@@ -38,8 +38,6 @@ void _gosInit(void)
38 38
 }
39 39
 
40 40
 #if !GFX_OS_NO_INIT && GFX_OS_CALL_UGFXMAIN
41
-	extern void uGFXMain(void);
42
-	
43 41
 	static DECLARE_THREAD_FUNCTION(startUGFX_FreeRTOS, p) {
44 42
 		(void) p;
45 43
 		uGFXMain();