Browse Source

gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE

inmarket 1 year ago
parent
commit
93da5a0578
65 changed files with 170 additions and 167 deletions
  1. 2 2
      boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h
  2. 1 1
      changelog.txt
  3. 1 1
      demos/3rdparty/notepad-2/notepadApp.c
  4. 1 1
      demos/applications/combo/main.c
  5. 1 1
      demos/modules/gadc/gwinosc.c
  6. 1 1
      demos/modules/gaudio/oscilloscope/gwinosc.c
  7. 2 2
      demos/modules/gaudio/play-vs1053/main.c
  8. 2 2
      demos/modules/gaudio/play-wave/main.c
  9. 2 2
      demos/modules/gdisp/images_animated/main.c
  10. 1 1
      demos/modules/ginput/keyboard/main.c
  11. 1 1
      demos/modules/gwin/button/main.c
  12. 1 1
      demos/modules/gwin/checkbox/main.c
  13. 1 1
      demos/modules/gwin/container_nested/main.c
  14. 1 1
      demos/modules/gwin/frame/main.c
  15. 1 1
      demos/modules/gwin/keyboard/main.c
  16. 1 1
      demos/modules/gwin/label/main.c
  17. 1 1
      demos/modules/gwin/list/main.c
  18. 1 1
      demos/modules/gwin/radio/main.c
  19. 1 1
      demos/modules/gwin/slider/main.c
  20. 1 1
      demos/modules/gwin/tabset/main.c
  21. 1 1
      demos/modules/gwin/textedit/main.c
  22. 1 1
      demos/modules/gwin/widgets/main.c
  23. 7 7
      demos/tools/touch_driver_test/main.c
  24. 1 1
      demos/tools/touch_raw_readings/main.c
  25. 1 1
      demos/tools/uGFXnetDisplay/main.c
  26. 2 2
      drivers/multiple/Win32/gdisp_lld_Win32.c
  27. 1 1
      drivers/multiple/Win32/ginput_lld_toggle_config.h
  28. 2 2
      drivers/multiple/uGFXnet/ginput_lld_mouse_config.h
  29. 2 2
      drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h
  30. 4 4
      src/gadc/gadc.c
  31. 3 3
      src/gaudio/gaudio.c
  32. 7 7
      src/gdisp/gdisp_image.h
  33. 1 1
      src/gdisp/gdisp_image_bmp.c
  34. 3 3
      src/gdisp/gdisp_image_gif.c
  35. 1 1
      src/gdisp/gdisp_image_jpg.c
  36. 1 1
      src/gdisp/gdisp_image_native.c
  37. 1 1
      src/gdisp/gdisp_image_png.c
  38. 2 2
      src/gevent/gevent.h
  39. 2 2
      src/ginput/ginput_driver_toggle.h
  40. 12 7
      src/gos/gos.h
  41. 8 8
      src/gos/gos_chibios.c
  42. 2 4
      src/gos/gos_chibios.h
  43. 3 3
      src/gos/gos_cmsis.h
  44. 3 3
      src/gos/gos_cmsis2.h
  45. 6 6
      src/gos/gos_ecos.c
  46. 2 2
      src/gos/gos_ecos.h
  47. 2 2
      src/gos/gos_freertos.h
  48. 8 8
      src/gos/gos_linux.c
  49. 3 3
      src/gos/gos_linux.h
  50. 6 6
      src/gos/gos_osx.c
  51. 3 3
      src/gos/gos_osx.h
  52. 2 2
      src/gos/gos_qt.h
  53. 1 1
      src/gos/gos_rawrtos.c
  54. 3 3
      src/gos/gos_rawrtos.h
  55. 2 2
      src/gos/gos_win32.c
  56. 3 3
      src/gos/gos_win32.h
  57. 10 10
      src/gos/gos_x_threads.c
  58. 2 2
      src/gos/gos_x_threads.h
  59. 2 2
      src/gos/gos_zephyr.h
  60. 1 1
      src/gqueue/gqueue.c
  61. 4 4
      src/gqueue/gqueue.h
  62. 5 5
      src/gtimer/gtimer.c
  63. 2 2
      src/gtimer/gtimer.h
  64. 2 2
      src/gwin/gwin_image.c
  65. 6 6
      src/gwin/gwin_wm.c

+ 2 - 2
boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h

@@ -84,9 +84,9 @@
84 84
 		uint8_t	data[2];											\
85 85
 		data[0] = 0;												\
86 86
 		data[1] = cmd;												\
87
-		i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, data, 2, 0, 0, TIME_INFINITE);	\
87
+		i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, data, 2, 0, 0, gDelayForever);	\
88 88
 	}
89
-	#define I2C_WRITEBYTES(pdata, len)		i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, pdata, length, 0, 0, TIME_INFINITE)
89
+	#define I2C_WRITEBYTES(pdata, len)		i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, pdata, length, 0, 0, gDelayForever)
90 90
 
91 91
 #else
92 92
 	#error "SSD1306 board file: Unsupported I2C method"

+ 1 - 1
changelog.txt

@@ -16,7 +16,7 @@ CHANGE:		Added GFX_RED, GFX_BLUE, GFX_GREEN etc to replace V2.x Red, Gree, Blue
16 16
 CHANGE:		Added GFXON/GFXOFF to replace V2.x TRUE/FALSE for configuration options.
17 17
 CHANGE:		Added types gI8, gU8 .. gI32, gU32 to replace V2.x int8_t etc
18 18
 CHANGE:		Added type gBool           to replace V2.x bool_t,        and values gTrue/gFalse to replace TRUE/FALSE
19
-CHANGE:		Added type gDelay          to replace V2.x delaytime_t
19
+CHANGE:		Added type gDelay          to replace V2.x delaytime_t    and values gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE
20 20
 CHANGE:		Added type gTicks          to replace V2.x systemticks_t
21 21
 CHANGE:		Added type gThreadreturn   to replace V2.x threadreturn_t
22 22
 CHANGE:		Added type gThreadpriority to replace V2.x threadpriority_t

+ 1 - 1
demos/3rdparty/notepad-2/notepadApp.c

@@ -402,7 +402,7 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
402 402
   ncoreSpawnDrawThread(nDrawingArea, gstatusConsole);
403 403
 
404 404
   while(1) {
405
-	  pem = (GEventMouse *) geventEventWait(&gl, TIME_INFINITE);
405
+	  pem = (GEventMouse *) geventEventWait(&gl, gDelayForever);
406 406
 
407 407
 	  /* button pressed... */
408 408
 	  if (pem->type == GEVENT_GWIN_BUTTON) {

+ 1 - 1
demos/applications/combo/main.c

@@ -436,7 +436,7 @@ int main(void) {
436 436
 
437 437
 	while(1) {
438 438
 		// Get an Event
439
-		pe = geventEventWait(&gl, TIME_INFINITE);
439
+		pe = geventEventWait(&gl, gDelayForever);
440 440
 
441 441
 		switch(pe->type) {
442 442
 		case GEVENT_GWIN_BUTTON:

+ 1 - 1
demos/modules/gadc/gwinosc.c

@@ -101,7 +101,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
101 101
 		return;
102 102
 
103 103
 	/* Wait for a set of conversions */
104
-	pd = gadcHighSpeedGetData(TIME_INFINITE);
104
+	pd = gadcHighSpeedGetData(gDelayForever);
105 105
 
106 106
 	/* Ensure we are drawing in the right area */
107 107
 	#if GDISP_NEED_CLIP

+ 1 - 1
demos/modules/gaudio/oscilloscope/gwinosc.c

@@ -118,7 +118,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
118 118
 		return;
119 119
 
120 120
 	/* Wait for a set of audio conversions */
121
-	paud = gaudioRecordGetData(TIME_INFINITE);
121
+	paud = gaudioRecordGetData(gDelayForever);
122 122
 
123 123
 	/* Ensure we are drawing in the right area */
124 124
 	#if GDISP_NEED_CLIP

+ 2 - 2
demos/modules/gaudio/play-vs1053/main.c

@@ -83,7 +83,7 @@ repeatplay:
83 83
 	toplay = gfileGetSize(f);
84 84
 	while(toplay) {
85 85
 		// Get a buffer to put the data into
86
-		pd = gfxBufferGet(TIME_INFINITE);		// This should never fail as we are waiting forever
86
+		pd = gfxBufferGet(gDelayForever);		// This should never fail as we are waiting forever
87 87
 
88 88
 		// How much data can we put in
89 89
 		len = toplay > pd->size ? pd->size : toplay;
@@ -101,7 +101,7 @@ repeatplay:
101 101
 	gfileClose(f);
102 102
 
103 103
 	// Wait for the play to finish
104
-	gaudioPlayWait(TIME_INFINITE);
104
+	gaudioPlayWait(gDelayForever);
105 105
 	gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN);
106 106
 
107 107
 	// Repeat the whole thing

+ 2 - 2
demos/modules/gaudio/play-wave/main.c

@@ -165,7 +165,7 @@ repeatplay:
165 165
 	gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, GFX_YELLOW);
166 166
 	while(toplay) {
167 167
 		// Get a buffer to put the data into
168
-		pd = gfxBufferGet(TIME_INFINITE);		// This should never fail as we are waiting forever
168
+		pd = gfxBufferGet(gDelayForever);		// This should never fail as we are waiting forever
169 169
 
170 170
 		// How much data can we put in
171 171
 		len = toplay > pd->size ? pd->size : toplay;
@@ -183,7 +183,7 @@ repeatplay:
183 183
 	gfileClose(f);
184 184
 
185 185
 	// Wait for the play to finish
186
-	gaudioPlayWait(TIME_INFINITE);
186
+	gaudioPlayWait(gDelayForever);
187 187
 	gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN);
188 188
 
189 189
 	// Repeat the whole thing

+ 2 - 2
demos/modules/gdisp/images_animated/main.c

@@ -89,12 +89,12 @@ int main(void) {
89 89
 				break;
90 90
 			}
91 91
 			delay = gdispImageNext(&myImage);
92
-			if (delay == TIME_INFINITE) {
92
+			if (delay == gDelayForever) {
93 93
 				SHOW_ERROR(GFX_GREEN);
94 94
 				break;
95 95
 			}
96 96
 			SHOW_ERROR(GFX_YELLOW);
97
-			if (delay != TIME_IMMEDIATE)
97
+			if (delay != gDelayNone)
98 98
 				gfxSleepMilliseconds(delay);
99 99
 		}
100 100
 		gdispImageClose(&myImage);

+ 1 - 1
demos/modules/ginput/keyboard/main.c

@@ -70,7 +70,7 @@ int main(void) {
70 70
 
71 71
 	while(1) {
72 72
 		// Get an Event
73
-		pk = (GEventKeyboard *)geventEventWait(&gl, TIME_INFINITE);
73
+		pk = (GEventKeyboard *)geventEventWait(&gl, gDelayForever);
74 74
 
75 75
 		if (pk->type != GEVENT_KEYBOARD)
76 76
 			continue;

+ 1 - 1
demos/modules/gwin/button/main.c

@@ -76,7 +76,7 @@ int main(void) {
76 76
 
77 77
 	while(1) {
78 78
 		// Get an Event
79
-		pe = geventEventWait(&gl, TIME_INFINITE);
79
+		pe = geventEventWait(&gl, gDelayForever);
80 80
 
81 81
 		switch(pe->type) {
82 82
 			case GEVENT_GWIN_BUTTON:

+ 1 - 1
demos/modules/gwin/checkbox/main.c

@@ -70,7 +70,7 @@ int main(void) {
70 70
 
71 71
 	while(1) {
72 72
 		// Get an Event
73
-		pe = geventEventWait(&gl, TIME_INFINITE);
73
+		pe = geventEventWait(&gl, gDelayForever);
74 74
 
75 75
 		switch(pe->type) {
76 76
 			case GEVENT_GWIN_CHECKBOX:

+ 1 - 1
demos/modules/gwin/container_nested/main.c

@@ -134,7 +134,7 @@ int main(void) {
134 134
 
135 135
     while(1) {
136 136
         // Get an Event
137
-        pe = geventEventWait(&gl, TIME_INFINITE);
137
+        pe = geventEventWait(&gl, gDelayForever);
138 138
 
139 139
         switch(pe->type) {
140 140
             case GEVENT_GWIN_CHECKBOX:

+ 1 - 1
demos/modules/gwin/frame/main.c

@@ -131,7 +131,7 @@ int main(void) {
131 131
 
132 132
     while(1) {
133 133
         // Get an Event
134
-        pe = geventEventWait(&gl, TIME_INFINITE);
134
+        pe = geventEventWait(&gl, gDelayForever);
135 135
 
136 136
         switch(pe->type) {
137 137
             case GEVENT_GWIN_SLIDER:

+ 1 - 1
demos/modules/gwin/keyboard/main.c

@@ -85,7 +85,7 @@ int main(void) {
85 85
 
86 86
 	while(1) {
87 87
 		// Get an Event
88
-		pe = geventEventWait(&gl, TIME_INFINITE);
88
+		pe = geventEventWait(&gl, gDelayForever);
89 89
 
90 90
 		switch(pe->type) {
91 91
 		case GEVENT_GWIN_KEYBOARD:

+ 1 - 1
demos/modules/gwin/label/main.c

@@ -72,7 +72,7 @@ int main(void) {
72 72
 
73 73
 	while(1) {
74 74
 		// Get an Event
75
-		pe = geventEventWait(&gl, TIME_INFINITE);
75
+		pe = geventEventWait(&gl, gDelayForever);
76 76
 	}
77 77
 
78 78
 	return 0;

+ 1 - 1
demos/modules/gwin/list/main.c

@@ -124,7 +124,7 @@ int main(void) {
124 124
 
125 125
 	while(1) {
126 126
 		// Get an Event
127
-		pe = geventEventWait(&gl, TIME_INFINITE);
127
+		pe = geventEventWait(&gl, gDelayForever);
128 128
 
129 129
 	}
130 130
 

+ 1 - 1
demos/modules/gwin/radio/main.c

@@ -92,7 +92,7 @@ int main(void) {
92 92
 
93 93
 	while(1) {
94 94
 		// Get an Event
95
-		pe = geventEventWait(&gl, TIME_INFINITE);
95
+		pe = geventEventWait(&gl, gDelayForever);
96 96
 
97 97
 		switch(pe->type) {
98 98
 			case GEVENT_GWIN_RADIO:

+ 1 - 1
demos/modules/gwin/slider/main.c

@@ -84,7 +84,7 @@ int main(void) {
84 84
 
85 85
 	while(1) {
86 86
 		// Get an Event (assume it is a slider event)
87
-		pe = (GEventGWinSlider *)geventEventWait(&gl, TIME_INFINITE);
87
+		pe = (GEventGWinSlider *)geventEventWait(&gl, gDelayForever);
88 88
 
89 89
 		switch(pe->type) {
90 90
 			case GEVENT_GWIN_SLIDER:

+ 1 - 1
demos/modules/gwin/tabset/main.c

@@ -87,7 +87,7 @@ int main(void) {
87 87
 
88 88
 	while(1) {
89 89
 		// Get an Event
90
-		pe = geventEventWait(&gl, TIME_INFINITE);
90
+		pe = geventEventWait(&gl, gDelayForever);
91 91
 
92 92
 		(void)pe;
93 93
 	}

+ 1 - 1
demos/modules/gwin/textedit/main.c

@@ -117,7 +117,7 @@ int main(void) {
117 117
 
118 118
 	while(1) {
119 119
 		// Get an Event
120
-		pk = (GEventKeyboard *)geventEventWait(&gl, TIME_INFINITE);
120
+		pk = (GEventKeyboard *)geventEventWait(&gl, gDelayForever);
121 121
 
122 122
 		if (pk->type != GEVENT_KEYBOARD)
123 123
 			continue;

+ 1 - 1
demos/modules/gwin/widgets/main.c

@@ -535,7 +535,7 @@ int main(void) {
535 535
 
536 536
 	while(1) {
537 537
 		// Get an Event
538
-		pe = geventEventWait(&gl, TIME_INFINITE);
538
+		pe = geventEventWait(&gl, gDelayForever);
539 539
 
540 540
 		switch(pe->type) {
541 541
 		case GEVENT_GWIN_BUTTON:

+ 7 - 7
demos/tools/touch_driver_test/main.c

@@ -176,7 +176,7 @@ StepDeviceType:
176 176
 	}
177 177
 
178 178
 	while(1) {
179
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
179
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
180 180
 		if (isCalibrated) {
181 181
 			switch (CheckButtons(pem)) {
182 182
 			case BTN_NEXT:
@@ -225,7 +225,7 @@ StepRawReading:
225 225
 		// Always sleep a bit first to enable other events. We actually don't
226 226
 		// mind missing events for this test.
227 227
 		gfxSleepMilliseconds(100);
228
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
228
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
229 229
 		gwinPrintf(ghc, "%u, %u z=%u b=0x%04x\n", pem->x, pem->y, pem->z, pem->buttons & ~GINPUT_MISSED_MOUSE_EVENT);
230 230
 		if ((pem->buttons & GMETA_MOUSE_UP))
231 231
 			break;
@@ -265,7 +265,7 @@ StepCalibrate:
265 265
 		gwinPrintf(ghc, "Press and release your %s to move on to start calibration.\n", deviceText);
266 266
 
267 267
 	while(1) {
268
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
268
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
269 269
 		if (isCalibrated) {
270 270
 			switch (CheckButtons(pem)) {
271 271
 			case BTN_NEXT:
@@ -317,7 +317,7 @@ StepMouseCoords:
317 317
 		// Always sleep a bit first to enable other events. We actually don't
318 318
 		// mind missing events for this test.
319 319
 		gfxSleepMilliseconds(100);
320
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
320
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
321 321
 
322 322
 		switch (CheckButtons(pem)) {
323 323
 		case BTN_NEXT:
@@ -359,7 +359,7 @@ StepMovementJitter:
359 359
 	gwinPrintf(ghc, "Press Next or Back to continue.\n\n");
360 360
 
361 361
 	while(1) {
362
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
362
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
363 363
 		switch (CheckButtons(pem)) {
364 364
 		case BTN_NEXT:
365 365
 			break;
@@ -402,7 +402,7 @@ StepClickJitter:
402 402
 	gwinPrintf(ghc, "Press Next or Back to continue.\n\n");
403 403
 
404 404
 	while(1) {
405
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
405
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
406 406
 		switch (CheckButtons(pem)) {
407 407
 		case BTN_NEXT:
408 408
 			break;
@@ -444,7 +444,7 @@ StepDrawing:
444 444
 	gwinPrintf(ghc, "Press Next or Back to continue.\n\n");
445 445
 
446 446
 	while(1) {
447
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
447
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
448 448
 		if (pem->y < bHeight && pem->x >= swidth-2*bWidth) {
449 449
 			if ((pem->buttons & GMETA_MOUSE_UP)) {
450 450
 				if (pem->x >= swidth-bWidth)

+ 1 - 1
demos/tools/touch_raw_readings/main.c

@@ -101,7 +101,7 @@ int main(void) {
101 101
 	geventAttachSource(&gl, gs, GLISTEN_MOUSEDOWNMOVES|GLISTEN_MOUSEUPMOVES|GLISTEN_MOUSEMETA|GLISTEN_MOUSENOFILTER);
102 102
 
103 103
 	while(1) {
104
-		pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
104
+		pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
105 105
 		gwinPrintf(ghc, "%u, %u z=%u b=0x%04x\n", pem->x, pem->y, pem->z, pem->buttons & ~GINPUT_MISSED_MOUSE_EVENT);
106 106
 
107 107
 		// Always sleep a bit first to enable other events. We actually don't mind missing events.

+ 1 - 1
demos/tools/uGFXnetDisplay/main.c

@@ -198,7 +198,7 @@ static gBool sendpkt(uint16_t *pkt, int len) {
198 198
 
199 199
 		while(1) {
200 200
 			// Get a (mouse) event
201
-			pem = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
201
+			pem = (GEventMouse *)geventEventWait(&gl, gDelayForever);
202 202
 			if (pem->type != GEVENT_MOUSE && pem->type != GEVENT_TOUCH)
203 203
 				continue;
204 204
 

+ 2 - 2
drivers/multiple/Win32/gdisp_lld_Win32.c

@@ -544,7 +544,7 @@ static LRESULT myWindowProc(HWND hWnd,	UINT Msg, WPARAM wParam, LPARAM lParam)
544 544
 					rect.bottom = GDISP_SCREEN_HEIGHT + WIN32_BUTTON_AREA;
545 545
 					InvalidateRect(hWnd, &rect, FALSE);
546 546
 					UpdateWindow(hWnd);
547
-					#if GINPUT_TOGGLE_POLL_PERIOD == TIME_INFINITE
547
+					#if GINPUT_TOGGLE_POLL_PERIOD == gDelayForever
548 548
 						ginputToggleWakeup();
549 549
 					#endif
550 550
 				}
@@ -567,7 +567,7 @@ static LRESULT myWindowProc(HWND hWnd,	UINT Msg, WPARAM wParam, LPARAM lParam)
567 567
 						rect.bottom = GDISP_SCREEN_HEIGHT + WIN32_BUTTON_AREA;
568 568
 						InvalidateRect(hWnd, &rect, FALSE);
569 569
 						UpdateWindow(hWnd);
570
-						#if GINPUT_TOGGLE_POLL_PERIOD == TIME_INFINITE
570
+						#if GINPUT_TOGGLE_POLL_PERIOD == gDelayForever
571 571
 							ginputToggleWakeup();
572 572
 						#endif
573 573
 					}

+ 1 - 1
drivers/multiple/Win32/ginput_lld_toggle_config.h

@@ -10,7 +10,7 @@
10 10
 
11 11
 #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
12 12
 
13
-#define GINPUT_TOGGLE_POLL_PERIOD		TIME_INFINITE	// We are interrupt driven (or polled - either works here)
13
+#define GINPUT_TOGGLE_POLL_PERIOD		gDelayForever	// We are interrupt driven (or polled - either works here)
14 14
 
15 15
 // This driver is unique in that it can support 8 buttons per window across multiple windows.
16 16
 // GINPUT_TOGGLE_CONFIG_ENTRIES just must be less than the number of GDISP windows (GDISP_DRIVER_COUNT_WIN32).

+ 2 - 2
drivers/multiple/uGFXnet/ginput_lld_mouse_config.h

@@ -13,7 +13,7 @@
13 13
 //	When operating in touch mode we allow sloppier clicks etc
14 14
 #if 1
15 15
 	#define GINPUT_MOUSE_EVENT_TYPE					GEVENT_MOUSE
16
-	#define GINPUT_MOUSE_CLICK_TIME					TIME_INFINITE			// Long click != Context Click
16
+	#define GINPUT_MOUSE_CLICK_TIME					gDelayForever			// Long click != Context Click
17 17
 	#define GINPUT_MOUSE_NEED_CALIBRATION			GFXOFF
18 18
 	#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE	GFXOFF
19 19
 	#define GINPUT_MOUSE_READ_CYCLES				1
@@ -32,7 +32,7 @@
32 32
 #endif
33 33
 
34 34
 // This driver supports both an "interrupt" mode, and a polled mode
35
-#define GINPUT_MOUSE_POLL_PERIOD				TIME_INFINITE			// Interrupt driven by the Window thread
35
+#define GINPUT_MOUSE_POLL_PERIOD				gDelayForever			// Interrupt driven by the Window thread
36 36
 //#define GINPUT_MOUSE_POLL_PERIOD				25						// Poll driven
37 37
 
38 38
 // This driver does not require rotation of co-ordinates for orientations other than 0.

+ 2 - 2
drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h

@@ -13,7 +13,7 @@
13 13
 //	When operating in touch mode we allow sloppier clicks etc
14 14
 #if 1
15 15
 	#define GINPUT_MOUSE_EVENT_TYPE					GEVENT_MOUSE
16
-	#define GINPUT_MOUSE_CLICK_TIME					TIME_INFINITE			// Long click != Context Click
16
+	#define GINPUT_MOUSE_CLICK_TIME					gDelayForever			// Long click != Context Click
17 17
 	#define GINPUT_MOUSE_NEED_CALIBRATION			GFXOFF
18 18
 	#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE	GFXOFF
19 19
 	#define GINPUT_MOUSE_READ_CYCLES				1
@@ -32,7 +32,7 @@
32 32
 #endif
33 33
 
34 34
 // This driver supports both an "interrupt" mode, and a polled mode
35
-#define GINPUT_MOUSE_POLL_PERIOD				TIME_INFINITE			// Interrupt driven by the Window thread
35
+#define GINPUT_MOUSE_POLL_PERIOD				gDelayForever			// Interrupt driven by the Window thread
36 36
 //#define GINPUT_MOUSE_POLL_PERIOD				25						// Poll driven
37 37
 
38 38
 // This driver does not require rotation of co-ordinates for orientations other than 0.

+ 4 - 4
src/gadc/gadc.c

@@ -214,7 +214,7 @@ void gadcHighSpeedInit(uint32_t physdev, uint32_t frequency)
214 214
 #if GFX_USE_GEVENT
215 215
 	GSourceHandle gadcHighSpeedGetSource(void) {
216 216
 		if (!gtimerIsActive(&hsGTimer))
217
-			gtimerStart(&hsGTimer, HighSpeedGTimerCallback, 0, gTrue, TIME_INFINITE);
217
+			gtimerStart(&hsGTimer, HighSpeedGTimerCallback, 0, gTrue, gDelayForever);
218 218
 		hsFlags |= GADC_HSADC_GTIMER;
219 219
 		return (GSourceHandle)&hsGTimer;
220 220
 	}
@@ -285,7 +285,7 @@ static void LowSpeedGTimerCallback(void *param) {
285 285
 	NonTimerData		*pdata;
286 286
 
287 287
 	// Look for completed non-timer jobs and call the call-backs for each
288
-	while ((pdata = (NonTimerData *)gfxQueueGSyncGet(&lsListDone, TIME_IMMEDIATE))) {
288
+	while ((pdata = (NonTimerData *)gfxQueueGSyncGet(&lsListDone, gDelayNone))) {
289 289
 		pdata->callback(pdata->job.buffer, pdata->param);
290 290
 		gfxFree(pdata);
291 291
 	}
@@ -315,7 +315,7 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer) {
315 315
 	gfxSystemUnlock();
316 316
 
317 317
 	// Wait for it to complete
318
-	gfxSemWait(&ndata.sigdone, TIME_INFINITE);
318
+	gfxSemWait(&ndata.sigdone, gDelayForever);
319 319
 	gfxSemDestroy(&ndata.sigdone);
320 320
 }
321 321
 
@@ -324,7 +324,7 @@ gBool gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunct
324 324
 
325 325
 	/* Start the Low Speed Timer */
326 326
 	if (!gtimerIsActive(&lsGTimer))
327
-		gtimerStart(&lsGTimer, LowSpeedGTimerCallback, 0, gTrue, TIME_INFINITE);
327
+		gtimerStart(&lsGTimer, LowSpeedGTimerCallback, 0, gTrue, gDelayForever);
328 328
 
329 329
 	// Prepare the job
330 330
 	if (!(pdata = gfxAlloc(sizeof(NonTimerData))))

+ 3 - 3
src/gaudio/gaudio.c

@@ -152,7 +152,7 @@ void _gaudioDeinit(void)
152 152
 
153 153
 		GSourceHandle gaudioPlayGetSource(void) {
154 154
 			if (!gtimerIsActive(&playTimer))
155
-				gtimerStart(&playTimer, PlayTimerCallback, 0, gTrue, TIME_INFINITE);
155
+				gtimerStart(&playTimer, PlayTimerCallback, 0, gTrue, gDelayForever);
156 156
 			playFlags |= PLAYFLG_USEEVENTS;
157 157
 			return (GSourceHandle)&playTimer;
158 158
 		}
@@ -209,7 +209,7 @@ void _gaudioDeinit(void)
209 209
 		if ((recordFlags & (RECORDFLG_RECORDING|RECORDFLG_STALLED)) == RECORDFLG_RECORDING)
210 210
 			gaudio_record_lld_stop();
211 211
 		recordFlags &= ~(RECORDFLG_RECORDING|RECORDFLG_STALLED);
212
-		while((pd = (GDataBuffer *)gfxQueueGSyncGet(&recordList, TIME_IMMEDIATE)))
212
+		while((pd = (GDataBuffer *)gfxQueueGSyncGet(&recordList, gDelayNone)))
213 213
 			gfxBufferRelease(pd);
214 214
 	}
215 215
 
@@ -245,7 +245,7 @@ void _gaudioDeinit(void)
245 245
 
246 246
 		GSourceHandle gaudioRecordGetSource(void) {
247 247
 			if (!gtimerIsActive(&recordTimer))
248
-				gtimerStart(&recordTimer, RecordTimerCallback, 0, gTrue, TIME_INFINITE);
248
+				gtimerStart(&recordTimer, RecordTimerCallback, 0, gTrue, gDelayForever);
249 249
 			recordFlags |= RECORDFLG_USEEVENTS;
250 250
 			return (GSourceHandle)&recordTimer;
251 251
 		}

+ 7 - 7
src/gdisp/gdisp_image.h

@@ -227,20 +227,20 @@ gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y
227 227
 /**
228 228
  * @brief	Prepare for the next frame/page in the image file.
229 229
  * @return	A time in milliseconds to keep displaying the current frame before trying to draw
230
- * 			the next frame. Watch out for the special values TIME_IMMEDIATE and TIME_INFINITE.
230
+ * 			the next frame. Watch out for the special values gDelayNone and gDelayForever.
231 231
  *
232 232
  * @param[in] img   The image structure
233 233
  *
234 234
  * @pre		gdispImageOpen() must have returned successfully.
235 235
  *
236
- * @note	It will return TIME_IMMEDIATE if the first frame/page hasn't been drawn or if the next frame
236
+ * @note	It will return gDelayNone if the first frame/page hasn't been drawn or if the next frame
237 237
  * 			should be drawn immediately.
238
- * @note	It will return TIME_INFINITE if another image frame doesn't exist or an error has occurred.
239
- * @note	Images that support multiple pages (eg TIFF files) will return TIME_IMMEDIATE between pages
240
- * 			and then TIME_INFINITE when there are no more pages.
241
- * @note	An image that displays a looped animation will never return TIME_INFINITE unless it
238
+ * @note	It will return gDelayForever if another image frame doesn't exist or an error has occurred.
239
+ * @note	Images that support multiple pages (eg TIFF files) will return gDelayNone between pages
240
+ * 			and then gDelayForever when there are no more pages.
241
+ * @note	An image that displays a looped animation will never return gDelayForever unless it
242 242
  * 			gets an error.
243
- * @note	Calling gdispImageDraw() after getting a TIME_INFINITE will go back to drawing the first
243
+ * @note	Calling gdispImageDraw() after getting a gDelayForever will go back to drawing the first
244 244
  * 			frame/page.
245 245
  */
246 246
 gDelay gdispImageNext(gdispImage *img);

+ 1 - 1
src/gdisp/gdisp_image_bmp.c

@@ -819,7 +819,7 @@ gDelay gdispImageNext_BMP(gdispImage *img) {
819 819
 	(void) img;
820 820
 
821 821
 	/* No more frames/pages */
822
-	return TIME_INFINITE;
822
+	return gDelayForever;
823 823
 }
824 824
 
825 825
 uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img) {

+ 3 - 3
src/gdisp/gdisp_image_gif.c

@@ -1122,7 +1122,7 @@ gDelay gdispImageNext_GIF(gdispImage *img) {
1122 1122
 		gfileSetPos(img->f, priv->frame.posimg+1);				// Skip the code size byte too
1123 1123
 		while(1) {
1124 1124
 			if (gfileRead(img->f, &blocksz, 1) != 1)
1125
-				return TIME_INFINITE;
1125
+				return gDelayForever;
1126 1126
 			if (!blocksz)
1127 1127
 				break;
1128 1128
 			gfileSetPos(img->f, gfileGetPos(img->f) + blocksz);
@@ -1145,10 +1145,10 @@ gDelay gdispImageNext_GIF(gdispImage *img) {
1145 1145
 		case GDISP_IMAGE_ERR_NOMEMORY:				// Out of Memory
1146 1146
 		case GDISP_IMAGE_ERR_UNSUPPORTED:			// Unsupported
1147 1147
 		default:
1148
-			return TIME_INFINITE;
1148
+			return gDelayForever;
1149 1149
 		}
1150 1150
 	}
1151
-	return TIME_INFINITE;
1151
+	return gDelayForever;
1152 1152
 }
1153 1153
 
1154 1154
 #endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_GIF */

+ 1 - 1
src/gdisp/gdisp_image_jpg.c

@@ -202,7 +202,7 @@ gDelay gdispImageNext_JPG(gdispImage *img) {
202 202
 	(void) img;
203 203
 
204 204
 	/* No more frames/pages */
205
-	return TIME_INFINITE;
205
+	return gDelayForever;
206 206
 }
207 207
 
208 208
 /*----------------------------------------------------------------------------/

+ 1 - 1
src/gdisp/gdisp_image_native.c

@@ -144,7 +144,7 @@ gDelay gdispImageNext_NATIVE(gdispImage *img) {
144 144
 	(void) img;
145 145
 
146 146
 	/* No more frames/pages */
147
-	return TIME_INFINITE;
147
+	return gDelayForever;
148 148
 }
149 149
 
150 150
 #endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_NATIVE */

+ 1 - 1
src/gdisp/gdisp_image_png.c

@@ -1625,7 +1625,7 @@ gDelay gdispImageNext_PNG(gdispImage *img) {
1625 1625
 	(void) img;
1626 1626
 
1627 1627
 	/* No more frames/pages */
1628
-	return TIME_INFINITE;
1628
+	return gDelayForever;
1629 1629
 }
1630 1630
 
1631 1631
 #endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_PNG */

+ 2 - 2
src/gevent/gevent.h

@@ -142,8 +142,8 @@ void geventDetachSource(GListener *pl, GSourceHandle gsh);
142 142
  * @brief	Wait for an event on a listener from an assigned source.
143 143
  * @details	The type of the event should be checked (pevent->type) and then pevent should
144 144
  *			be typecast to the actual event type if it needs to be processed.
145
- *			TIME_INFINITE means no timeout - wait forever for an event.
146
- *			TIME_IMMEDIATE means return immediately
145
+ *			gDelayForever means no timeout - wait forever for an event.
146
+ *			gDelayNone means return immediately
147 147
  * @note	The returned GEvent is released when this routine is called again
148 148
  * 			or when optionally @p geventEventComplete() is called. Calling @p geventEventComplete()
149 149
  * 			allows the GEvent object to be reused earlier which can reduce missed events. The GEvent

+ 2 - 2
src/ginput/ginput_driver_toggle.h

@@ -41,12 +41,12 @@ extern "C" {
41 41
 	unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc);
42 42
 
43 43
 	/* This routine is provided to low level drivers to wakeup a value read from a thread context.
44
-	 *	Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = TIME_INFINITE
44
+	 *	Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = gDelayForever
45 45
 	 */
46 46
 	void ginputToggleWakeup(void);
47 47
 
48 48
 	/* This routine is provided to low level drivers to wakeup a value read from an ISR
49
-	 *	Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = TIME_INFINITE
49
+	 *	Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = gDelayForever
50 50
 	 */
51 51
 	void ginputToggleWakeupI(void);
52 52
 

+ 12 - 7
src/gos/gos.h

@@ -99,8 +99,8 @@
99 99
 	 * @note	Your platform may use slightly different definitions to these
100 100
 	 * @{
101 101
 	 */
102
-	#define TIME_IMMEDIATE				0
103
-	#define TIME_INFINITE				((gDelay)-1)
102
+	#define gDelayNone				0
103
+	#define gDelayForever				((gDelay)-1)
104 104
 	#define MAX_SEMAPHORE_COUNT			((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
105 105
 	#define LOW_PRIORITY				0
106 106
 	#define NORMAL_PRIORITY				1
@@ -215,9 +215,9 @@
215 215
 	 *
216 216
 	 * @param[in] ms	The number milliseconds to sleep
217 217
 	 *
218
-	 * @note		Specifying TIME_IMMEDIATE will yield the current thread but return
218
+	 * @note		Specifying gDelayNone will yield the current thread but return
219 219
 	 * 				on the next time slice.
220
-	 * @note		Specifying TIME_INFINITE will sleep forever.
220
+	 * @note		Specifying gDelayForever will sleep forever.
221 221
 	 *
222 222
 	 * @api
223 223
 	 */
@@ -228,8 +228,8 @@
228 228
 	 *
229 229
 	 * @param[in] us	The number microseconds to sleep
230 230
 	 *
231
-	 * @note		Specifying TIME_IMMEDIATE will return immediately (no sleeping)
232
-	 * @note		Specifying TIME_INFINITE will sleep forever.
231
+	 * @note		Specifying gDelayNone will return immediately (no sleeping)
232
+	 * @note		Specifying gDelayForever will sleep forever.
233 233
 	 *
234 234
 	 * @api
235 235
 	 */
@@ -372,7 +372,7 @@
372 372
 
373 373
 	/**
374 374
 	 * @brief	Test if a wait on a semaphore can be satisfied immediately
375
-	 * @details	Equivalent to @p gfxSemWait(psem, TIME_IMMEDIATE) except it can be called at interrupt level
375
+	 * @details	Equivalent to @p gfxSemWait(psem, gDelayNone) except it can be called at interrupt level
376 376
 	 * @return	gFalse if the wait would occur occurred otherwise gTrue
377 377
 	 *
378 378
 	 * @param[in] psem		A pointer to the semaphore
@@ -498,6 +498,11 @@
498 498
 	typedef gTicks			systemticks_t;
499 499
 	typedef gThreadreturn	threadreturn_t;
500 500
 	typedef gThreadpriority	threadpriority_t;
501
+	#if !GFX_USE_OS_CHIBIOS
502
+		// These are defined by ChibiOS itself
503
+		#define TIME_IMMEDIATE	gDelayNone
504
+		#define TIME_INFINITE	gDelayForever
505
+	#endif
501 506
 #endif
502 507
 
503 508
 #endif /* _GOS_H */

+ 8 - 8
src/gos/gos_chibios.c

@@ -84,8 +84,8 @@ void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz)
84 84
 void gfxSleepMilliseconds(gDelay ms)
85 85
 {
86 86
 	switch(ms) {
87
-		case TIME_IMMEDIATE:	chThdYield();				return;
88
-		case TIME_INFINITE:		chThdSleep(TIME_INFINITE);	return;
87
+		case gDelayNone:		chThdYield();				return;
88
+		case gDelayForever:		chThdSleep(TIME_INFINITE);	return;
89 89
 		default:				chThdSleepMilliseconds(ms);	return;
90 90
 	}
91 91
 }
@@ -93,8 +93,8 @@ void gfxSleepMilliseconds(gDelay ms)
93 93
 void gfxSleepMicroseconds(gDelay ms)
94 94
 {
95 95
 	switch(ms) {
96
-		case TIME_IMMEDIATE:								return;
97
-		case TIME_INFINITE:		chThdSleep(TIME_INFINITE);	return;
96
+		case gDelayNone:									return;
97
+		case gDelayForever:		chThdSleep(TIME_INFINITE);	return;
98 98
 		default:				chThdSleepMicroseconds(ms);	return;
99 99
 	}
100 100
 }
@@ -122,14 +122,14 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms)
122 122
 {
123 123
 	#if CH_KERNEL_MAJOR <= 2
124 124
 		switch(ms) {
125
-		case TIME_IMMEDIATE:	return chSemWaitTimeout(&psem->sem, TIME_IMMEDIATE) != RDY_TIMEOUT;
126
-		case TIME_INFINITE:		chSemWait(&psem->sem);	return gTrue;
125
+		case gDelayNone:		return chSemWaitTimeout(&psem->sem, TIME_IMMEDIATE) != RDY_TIMEOUT;
126
+		case gDelayForever:		chSemWait(&psem->sem);	return gTrue;
127 127
 		default:				return chSemWaitTimeout(&psem->sem, gfxMillisecondsToTicks(ms)) != RDY_TIMEOUT;
128 128
 		}
129 129
 	#else
130 130
 		switch(ms) {
131
-		case TIME_IMMEDIATE:	return chSemWaitTimeout(&psem->sem, TIME_IMMEDIATE) != MSG_TIMEOUT;
132
-		case TIME_INFINITE:		chSemWait(&psem->sem);	return gTrue;
131
+		case gDelayNone:		return chSemWaitTimeout(&psem->sem, TIME_IMMEDIATE) != MSG_TIMEOUT;
132
+		case gDelayForever:		chSemWait(&psem->sem);	return gTrue;
133 133
 		default:				return chSemWaitTimeout(&psem->sem, gfxMillisecondsToTicks(ms)) != MSG_TIMEOUT;
134 134
 		}
135 135
 	#endif

+ 2 - 4
src/gos/gos_chibios.h

@@ -25,10 +25,8 @@
25 25
 /* Type definitions                                                          */
26 26
 /*===========================================================================*/
27 27
 
28
-/**
29
- * TIME_IMMEDIATE, TIME_INFINITE
30
- * are already defined by ChibiOS
31
- */
28
+#define gDelayNone		TIME_IMMEDIATE
29
+#define gDelayForever	TIME_INFINITE
32 30
 
33 31
 #if CH_KERNEL_MAJOR <= 4
34 32
 	typedef systime_t      gDelay;

+ 3 - 3
src/gos/gos_cmsis.h

@@ -25,8 +25,8 @@
25 25
 /* Type definitions                                                          */
26 26
 /*===========================================================================*/
27 27
 
28
-#define TIME_IMMEDIATE		0
29
-#define TIME_INFINITE		osWaitForever
28
+#define gDelayNone			0
29
+#define gDelayForever		osWaitForever
30 30
 typedef uint32_t			gDelay;
31 31
 typedef uint32_t			gTicks;
32 32
 typedef uint16_t			gSemcount;
@@ -69,7 +69,7 @@ typedef osThreadId			gfxThreadHandle;
69 69
 
70 70
 void gfxMutexInit(gfxMutex* pmutex);
71 71
 #define gfxMutexDestroy(pmutex)		osMutexDelete((pmutex)->id)
72
-#define gfxMutexEnter(pmutex)		osMutexWait((pmutex)->id, TIME_INFINITE)
72
+#define gfxMutexEnter(pmutex)		osMutexWait((pmutex)->id, gDelayForever)
73 73
 #define gfxMutexExit(pmutex)		osMutexRelease((pmutex)->id)
74 74
 
75 75
 void gfxSemInit(gfxSem* psem, gSemcount val, gSemcount limit);

+ 3 - 3
src/gos/gos_cmsis2.h

@@ -25,8 +25,8 @@
25 25
 /* Type definitions                                                          */
26 26
 /*===========================================================================*/
27 27
 
28
-#define TIME_IMMEDIATE		0
29
-#define TIME_INFINITE		osWaitForever
28
+#define gDelayNone			0
29
+#define gDelayForever		osWaitForever
30 30
 typedef uint32_t			gDelay;
31 31
 typedef uint32_t			gTicks;
32 32
 typedef uint16_t			gSemcount;
@@ -62,7 +62,7 @@ typedef osThreadId_t		gfxThreadHandle;
62 62
 
63 63
 void gfxMutexInit(gfxMutex* pmutex);
64 64
 #define gfxMutexDestroy(pmutex)		osMutexDelete(*(pmutex))
65
-#define gfxMutexEnter(pmutex)		osMutexAcquire(*(pmutex), TIME_INFINITE)
65
+#define gfxMutexEnter(pmutex)		osMutexAcquire(*(pmutex), gDelayForever)
66 66
 #define gfxMutexExit(pmutex)		osMutexRelease(*(pmutex))
67 67
 
68 68
 void gfxSemInit(gfxSem* psem, gSemcount val, gSemcount limit);

+ 6 - 6
src/gos/gos_ecos.c

@@ -35,8 +35,8 @@ void _gosDeinit(void)
35 35
 void gfxSleepMilliseconds(gDelay ms)
36 36
 {
37 37
 	switch(ms) {
38
-		case TIME_IMMEDIATE:	cyg_thread_yield();								return;
39
-		case TIME_INFINITE:		cyg_thread_suspend(cyg_thread_self());			return;
38
+		case gDelayNone:	cyg_thread_yield();								return;
39
+		case gDelayForever:		cyg_thread_suspend(cyg_thread_self());			return;
40 40
 		default:				cyg_thread_delay(gfxMillisecondsToTicks(ms));	return;
41 41
 	}
42 42
 }
@@ -44,8 +44,8 @@ void gfxSleepMilliseconds(gDelay ms)
44 44
 void gfxSleepMicroseconds(gDelay ms)
45 45
 {
46 46
 	switch(ms) {
47
-		case TIME_IMMEDIATE:														return;
48
-		case TIME_INFINITE:		cyg_thread_suspend(cyg_thread_self());				return;
47
+		case gDelayNone:														return;
48
+		case gDelayForever:		cyg_thread_suspend(cyg_thread_self());				return;
49 49
 		default:				cyg_thread_delay(gfxMillisecondsToTicks(ms/1000));	return;
50 50
 	}
51 51
 }
@@ -67,8 +67,8 @@ void gfxSemDestroy(gfxSem *psem)
67 67
 gBool gfxSemWait(gfxSem *psem, gDelay ms)
68 68
 {
69 69
 	switch(ms) {
70
-	case TIME_IMMEDIATE:	return cyg_semaphore_trywait(&psem->sem);
71
-	case TIME_INFINITE:		return cyg_semaphore_wait(&psem->sem);
70
+	case gDelayNone:	return cyg_semaphore_trywait(&psem->sem);
71
+	case gDelayForever:		return cyg_semaphore_wait(&psem->sem);
72 72
 	default:				return cyg_semaphore_timed_wait(&psem->sem, gfxMillisecondsToTicks(ms)+cyg_current_time());
73 73
 	}
74 74
 }

+ 2 - 2
src/gos/gos_ecos.h

@@ -18,8 +18,8 @@
18 18
 /* Type definitions                                                          */
19 19
 /*===========================================================================*/
20 20
 
21
-#define TIME_IMMEDIATE		0
22
-#define TIME_INFINITE		0xFFFFFFFF
21
+#define gDelayNone			0
22
+#define gDelayForever		0xFFFFFFFF
23 23
 
24 24
 typedef cyg_ucount32		gDelay;
25 25
 typedef cyg_tick_count_t	gTicks;

+ 2 - 2
src/gos/gos_freertos.h

@@ -24,8 +24,8 @@
24 24
 /* Type definitions                                                          */
25 25
 /*===========================================================================*/
26 26
 
27
-#define TIME_IMMEDIATE		0
28
-#define TIME_INFINITE		((gDelay)-1)
27
+#define gDelayNone			0
28
+#define gDelayForever		((gDelay)-1)
29 29
 typedef uint32_t			gDelay;
30 30
 typedef portTickType		gTicks;
31 31
 typedef int32_t				gSemcount;

+ 8 - 8
src/gos/gos_linux.c

@@ -64,11 +64,11 @@ void gfxSleepMilliseconds(gDelay ms) {
64 64
 	struct timespec	ts;
65 65
 
66 66
 	switch(ms) {
67
-		case TIME_IMMEDIATE:
67
+		case gDelayNone:
68 68
 			linuxyield();
69 69
 			return;
70 70
 
71
-		case TIME_INFINITE:
71
+		case gDelayForever:
72 72
 			while(1)
73 73
 				sleep(60);
74 74
 			return;
@@ -85,11 +85,11 @@ void gfxSleepMicroseconds(gDelay us) {
85 85
 	struct timespec	ts;
86 86
 
87 87
 	switch(us) {
88
-		case TIME_IMMEDIATE:
88
+		case gDelayNone:
89 89
 			linuxyield();
90 90
 			return;
91 91
 
92
-		case TIME_INFINITE:
92
+		case gDelayForever:
93 93
 			while(1)
94 94
 				sleep(60);
95 95
 			return;
@@ -147,10 +147,10 @@ gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
147 147
 	}
148 148
 	gBool gfxSemWait(gfxSem *pSem, gDelay ms) {
149 149
 		switch (ms) {
150
-		case TIME_INFINITE:
150
+		case gDelayForever:
151 151
 			return sem_wait(&pSem->sem) ? gFalse : gTrue;
152 152
 
153
-		case TIME_IMMEDIATE:
153
+		case gDelayNone:
154 154
 			return sem_trywait(&pSem->sem) ? gFalse : gTrue;
155 155
 
156 156
 		default:
@@ -189,12 +189,12 @@ gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
189 189
 		pthread_mutex_lock(&pSem->mtx);
190 190
 
191 191
 		switch (ms) {
192
-			case TIME_INFINITE:
192
+			case gDelayForever:
193 193
 				while (!pSem->cnt)
194 194
 					pthread_cond_wait(&pSem->cond, &pSem->mtx);
195 195
 				break;
196 196
 
197
-			case TIME_IMMEDIATE:
197
+			case gDelayNone:
198 198
 				if (!pSem->cnt) {
199 199
 					pthread_mutex_unlock(&pSem->mtx);
200 200
 					return gFalse;

+ 3 - 3
src/gos/gos_linux.h

@@ -46,11 +46,11 @@ typedef pthread_mutex_t		gfxMutex;
46 46
 #define gfxMutexDestroy(pmtx)			pthread_mutex_destroy(pmtx)
47 47
 #define gfxMutexEnter(pmtx)				pthread_mutex_lock(pmtx)
48 48
 #define gfxMutexExit(pmtx)				pthread_mutex_unlock(pmtx)
49
-#define gfxSemWaitI(psem)				gfxSemWait(psem, TIME_IMMEDIATE)
49
+#define gfxSemWaitI(psem)				gfxSemWait(psem, gDelayNone)
50 50
 #define gfxSemSignalI(psem)				gfxSemSignal(psem)
51 51
 
52
-#define TIME_IMMEDIATE				0
53
-#define TIME_INFINITE				((gDelay)-1)
52
+#define gDelayNone					0
53
+#define gDelayForever				((gDelay)-1)
54 54
 #define MAX_SEMAPHORE_COUNT			((gSemcount)-1)
55 55
 #define LOW_PRIORITY				10
56 56
 #define NORMAL_PRIORITY				0

+ 6 - 6
src/gos/gos_osx.c

@@ -57,8 +57,8 @@ void gfxSleepMilliseconds(gDelay ms) {
57 57
 	struct timespec	ts;
58 58
 
59 59
 	switch(ms) {
60
-	case TIME_IMMEDIATE:	gfxYield();			return;
61
-	case TIME_INFINITE:		while(1) sleep(60);			return;
60
+	case gDelayNone:	gfxYield();			return;
61
+	case gDelayForever:		while(1) sleep(60);			return;
62 62
 	default:
63 63
 		ts.tv_sec = ms / 1000;
64 64
 		ts.tv_nsec = (ms % 1000) * 1000000;
@@ -71,8 +71,8 @@ void gfxSleepMicroseconds(gDelay us) {
71 71
 	struct timespec	ts;
72 72
 
73 73
 	switch(us) {
74
-	case TIME_IMMEDIATE:	gfxYield();			return;
75
-	case TIME_INFINITE:		while(1) sleep(60);			return;
74
+	case gDelayNone:	gfxYield();			return;
75
+	case gDelayForever:		while(1) sleep(60);			return;
76 76
 	default:
77 77
 		ts.tv_sec = us / 1000000;
78 78
 		ts.tv_nsec = (us % 1000000) * 1000;
@@ -135,11 +135,11 @@ void gfxSemDestroy(gfxSem *pSem) {
135 135
 gBool gfxSemWait(gfxSem *pSem, gDelay ms) {
136 136
 	pthread_mutex_lock(&pSem->mtx);
137 137
 	switch (ms) {
138
-	case TIME_INFINITE:
138
+	case gDelayForever:
139 139
 		while (!pSem->cnt)
140 140
 			pthread_cond_wait(&pSem->cond, &pSem->mtx);
141 141
 		break;
142
-	case TIME_IMMEDIATE:
142
+	case gDelayNone:
143 143
 		if (!pSem->cnt) {
144 144
 			pthread_mutex_unlock(&pSem->mtx);
145 145
 			return gFalse;

+ 3 - 3
src/gos/gos_osx.h

@@ -38,11 +38,11 @@ typedef pthread_mutex_t		gfxMutex;
38 38
 #define gfxMutexDestroy(pmtx)			pthread_mutex_destroy(pmtx)
39 39
 #define gfxMutexEnter(pmtx)				pthread_mutex_lock(pmtx)
40 40
 #define gfxMutexExit(pmtx)				pthread_mutex_unlock(pmtx)
41
-#define gfxSemWaitI(psem)				gfxSemWait(psem, TIME_IMMEDIATE)
41
+#define gfxSemWaitI(psem)				gfxSemWait(psem, gDelayNone)
42 42
 #define gfxSemSignalI(psem)				gfxSemSignal(psem)
43 43
 
44
-#define TIME_IMMEDIATE				0
45
-#define TIME_INFINITE				((gDelay)-1)
44
+#define gDelayNone					0
45
+#define gDelayForever				((gDelay)-1)
46 46
 #define MAX_SEMAPHORE_COUNT			((gSemcount)-1)
47 47
 #define LOW_PRIORITY				10
48 48
 #define NORMAL_PRIORITY				0

+ 2 - 2
src/gos/gos_qt.h

@@ -14,8 +14,8 @@
14 14
 #define DECLARE_THREAD_STACK(name, sz)          uint8_t name[0]
15 15
 #define THREAD_RETURN(retval)					return retval
16 16
 
17
-#define TIME_IMMEDIATE				0
18
-#define TIME_INFINITE				((gDelay)-1)
17
+#define gDelayNone					0
18
+#define gDelayForever				((gDelay)-1)
19 19
 #define MAX_SEMAPHORE_COUNT			((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
20 20
 #define LOW_PRIORITY				2
21 21
 #define NORMAL_PRIORITY				3

+ 1 - 1
src/gos/gos_rawrtos.c

@@ -70,7 +70,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms)
70 70
 
71 71
 gBool gfxSemWaitI(gfxSem* psem)
72 72
 {
73
-	if(raw_semaphore_get((psem), TIME_IMMEDIATE)==RAW_SUCCESS)
73
+	if(raw_semaphore_get((psem), RAW_NO_WAIT)==RAW_SUCCESS)
74 74
 		return gTrue;
75 75
 	return gFalse;
76 76
 }

+ 3 - 3
src/gos/gos_rawrtos.h

@@ -5,8 +5,8 @@
5 5
 
6 6
 #include "raw_api.h"
7 7
 
8
-#define TIME_IMMEDIATE		(RAW_NO_WAIT)
9
-#define TIME_INFINITE		(RAW_WAIT_FOREVER)
8
+#define gDelayNone			(RAW_NO_WAIT)
9
+#define gDelayForever		(RAW_WAIT_FOREVER)
10 10
 typedef uint32_t			gDelay;
11 11
 typedef RAW_TICK_TYPE		gTicks;
12 12
 typedef int32_t				gSemcount;
@@ -38,7 +38,7 @@ typedef RAW_TASK_OBJ*		gfxThreadHandle;
38 38
 #define gfxSystemUnlock()				{}
39 39
 #define gfxMutexInit(pmutex)			raw_mutex_create(pmutex, (RAW_U8 *)"", RAW_MUTEX_INHERIT_POLICY, 3)
40 40
 #define gfxMutexDestroy(pmutex)			raw_mutex_delete(pmutex)
41
-#define gfxMutexEnter(pmutex) 			raw_mutex_get(pmutex, TIME_INFINITE)
41
+#define gfxMutexEnter(pmutex) 			raw_mutex_get(pmutex, gDelayForever)
42 42
 #define gfxMutexExit(pmutex)			raw_mutex_put(pmutex)
43 43
 #define gfxSemInit(psem, val, limit)	raw_semaphore_create(psem, "", val)
44 44
 #define gfxSemDestroy(psem)				raw_semaphore_delete(psem)

+ 2 - 2
src/gos/gos_win32.c

@@ -43,10 +43,10 @@ void gfxSleepMicroseconds(gDelay ms) {
43 43
     LARGE_INTEGER t1, t2, tdiff;
44 44
 
45 45
     switch(ms) {
46
-		case TIME_IMMEDIATE:
46
+		case gDelayNone:
47 47
 			return;
48 48
 
49
-		case TIME_INFINITE:
49
+		case gDelayForever:
50 50
 			while(1)
51 51
 				Sleep(1000);
52 52
 			return;

+ 3 - 3
src/gos/gos_win32.h

@@ -35,8 +35,8 @@ typedef int					gThreadpriority;
35 35
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[1];
36 36
 #define THREAD_RETURN(retval)					return retval
37 37
 
38
-#define TIME_IMMEDIATE				0
39
-#define TIME_INFINITE				INFINITE
38
+#define gDelayNone					0
39
+#define gDelayForever				INFINITE
40 40
 #define MAX_SEMAPHORE_COUNT			((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
41 41
 #define LOW_PRIORITY				THREAD_PRIORITY_BELOW_NORMAL
42 42
 #define NORMAL_PRIORITY				THREAD_PRIORITY_NORMAL
@@ -60,7 +60,7 @@ typedef HANDLE gfxThreadHandle;
60 60
 #define gfxMutexExit(pmutex)			ReleaseMutex(*(pmutex))
61 61
 #define gfxSemInit(psem, val, limit)	*(psem) = CreateSemaphore(0, val, limit, 0)
62 62
 #define gfxSemDestroy(psem)				CloseHandle(*(psem))
63
-#define gfxSemWaitI(psem)				gfxSemWait((psem), TIME_IMMEDIATE)
63
+#define gfxSemWaitI(psem)				gfxSemWait((psem), gDelayNone)
64 64
 #define gfxSemSignal(psem)				ReleaseSemaphore(*(psem), 1, 0)
65 65
 #define gfxSemSignalI(psem)				ReleaseSemaphore(*(psem), 1, 0)
66 66
 #define gfxThreadMe()					GetCurrentThread()

+ 10 - 10
src/gos/gos_x_threads.c

@@ -56,11 +56,11 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms) {
56 56
 	// Convert our delay to ticks
57 57
 	starttm = 0;
58 58
 	switch (ms) {
59
-	case TIME_IMMEDIATE:
60
-		delay = TIME_IMMEDIATE;
59
+	case gDelayNone:
60
+		delay = gDelayNone;
61 61
 		break;
62
-	case TIME_INFINITE:
63
-		delay = TIME_INFINITE;
62
+	case gDelayForever:
63
+		delay = gDelayForever;
64 64
 		break;
65 65
 	default:
66 66
 		delay = gfxMillisecondsToTicks(ms);
@@ -73,9 +73,9 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms) {
73 73
 		INTERRUPTS_ON();
74 74
 		// Check if we have exceeded the defined delay
75 75
 		switch (delay) {
76
-		case TIME_IMMEDIATE:
76
+		case gDelayNone:
77 77
 			return gFalse;
78
-		case TIME_INFINITE:
78
+		case gDelayForever:
79 79
 			break;
80 80
 		default:
81 81
 			if (gfxSystemTicks() - starttm >= delay)
@@ -117,9 +117,9 @@ void gfxSleepMilliseconds(gDelay ms) {
117 117
 
118 118
 	// Safety first
119 119
 	switch (ms) {
120
-	case TIME_IMMEDIATE:
120
+	case gDelayNone:
121 121
 		return;
122
-	case TIME_INFINITE:
122
+	case gDelayForever:
123 123
 		while(1)
124 124
 			gfxYield();
125 125
 		return;
@@ -139,9 +139,9 @@ void gfxSleepMicroseconds(gDelay ms) {
139 139
 
140 140
 	// Safety first
141 141
 	switch (ms) {
142
-	case TIME_IMMEDIATE:
142
+	case gDelayNone:
143 143
 		return;
144
-	case TIME_INFINITE:
144
+	case gDelayForever:
145 145
 		while(1)
146 146
 			gfxYield();
147 147
 		return;

+ 2 - 2
src/gos/gos_x_threads.h

@@ -34,8 +34,8 @@ typedef int				gThreadpriority;
34 34
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[(sz) & ~3];
35 35
 #define THREAD_RETURN(retval)					return retval
36 36
 
37
-#define TIME_IMMEDIATE				0
38
-#define TIME_INFINITE				((gDelay)-1)
37
+#define gDelayNone					0
38
+#define gDelayForever				((gDelay)-1)
39 39
 #define MAX_SEMAPHORE_COUNT			0x7FFF
40 40
 #define LOW_PRIORITY				0
41 41
 #define NORMAL_PRIORITY				1

+ 2 - 2
src/gos/gos_zephyr.h

@@ -30,8 +30,8 @@ typedef int	gThreadpriority;
30 30
 
31 31
 #define THREAD_RETURN(retval)		return
32 32
 
33
-#define TIME_IMMEDIATE			K_NO_WAIT
34
-#define TIME_INFINITE			K_FOREVER
33
+#define gDelayNone				K_NO_WAIT
34
+#define gDelayForever			K_FOREVER
35 35
 #define MAX_SEMAPHORE_COUNT		((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
36 36
 #define LOW_PRIORITY			CONFIG_NUM_PREEMPT_PRIORITIES-1
37 37
 #define NORMAL_PRIORITY			1

+ 1 - 1
src/gqueue/gqueue.c

@@ -297,7 +297,7 @@ void _gqueueDeinit(void)
297 297
 		gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
298 298
 	}
299 299
 	void gfxQueueFSyncDeinit(gfxQueueGSync *pqueue) {
300
-		while(gfxQueueFSyncGet(pqueue, TIME_IMMEDIATE));
300
+		while(gfxQueueFSyncGet(pqueue, gDelayNone));
301 301
 		pqueue->head = pqueue->tail = 0;
302 302
 		gfxSemDestroy(&pqueue->sem);
303 303
 	}

+ 4 - 4
src/gqueue/gqueue.h

@@ -124,7 +124,7 @@ void gfxQueueFSyncDeinit(gfxQueueFSync *pqueue);
124 124
  *
125 125
  * @param[in]	pqueue	A pointer to the queue
126 126
  * @param[in]	ms		The maxmimum time to wait for an item. For ASync queues this parameter is
127
- * 						not specified as TIME_IMMEDIATE is assumed.
127
+ * 						not specified as gDelayNone is assumed.
128 128
  *
129 129
  * @note		The routines ending in "I" are interrupt/system/iclass level routines.
130 130
  *
@@ -147,7 +147,7 @@ gfxQueueFSyncItem *gfxQueueFSyncGet(gfxQueueFSync *pqueue, gDelay ms);
147 147
  * @param[in]	pitem	A pointer to the queue item
148 148
  * @param[in]	ms		The maxmimum time to wait for an item to be removed from the queue (only for FSync queues)
149 149
  *
150
- * @note		FSync: Use a delay time of TIME_IMMEDIATE if you don't want to wait until the
150
+ * @note		FSync: Use a delay time of gDelayNone if you don't want to wait until the
151 151
  * 				item is removed from the queue. Note that even if the timeout occurs - the item
152 152
  * 				remains in the queue.
153 153
  * @note		The routines ending in "I" are interrupt/system/iclass level routines.
@@ -185,7 +185,7 @@ gBool gfxQueueFSyncPut(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gDelay m
185 185
  * @param[in]	pitem	A pointer to the queue item
186 186
  * @param[in]	ms		The maxmimum time to wait for an item to be popped (only for FSync queues)
187 187
  *
188
- * @note		FSync: Use a delay time of TIME_IMMEDIATE if you don't want to wait until the
188
+ * @note		FSync: Use a delay time of gDelayNone if you don't want to wait until the
189 189
  * 				item is removed from the queue. Note that even if the timeout occurs - the item
190 190
  * 				remains in the queue.
191 191
  * @note		The routines ending in "I" are interrupt/system/iclass level routines.
@@ -211,7 +211,7 @@ gBool gfxQueueFSyncPush(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gDelay
211 211
  * 							pafter can't be found in the queue, it puts the new item at the end of the queue.
212 212
  * @param[in]	ms		The maxmimum time to wait for an item to be removed from the queue (only for FSync queues)
213 213
  *
214
- * @note		FSync: Use a delay time of TIME_IMMEDIATE if you don't want to wait until the
214
+ * @note		FSync: Use a delay time of gDelayNone if you don't want to wait until the
215 215
  * 				item is removed from the queue. Note that even if the timeout occurs - the item
216 216
  * 				remains in the queue.
217 217
  * @note		The routines ending in "I" are interrupt/system/iclass level routines.

+ 5 - 5
src/gtimer/gtimer.c

@@ -38,7 +38,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
38 38
 	void			*param;
39 39
 	(void)			arg;
40 40
 
41
-	nxtTimeout = TIME_INFINITE;
41
+	nxtTimeout = gDelayForever;
42 42
 	lastTime = 0;
43 43
 	while(1) {
44 44
 		/* Wait for work to do. */
@@ -49,7 +49,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
49 49
 	
50 50
 		// Our reference time
51 51
 		tm = gfxSystemTicks();
52
-		nxtTimeout = TIME_INFINITE;
52
+		nxtTimeout = gDelayForever;
53 53
 		
54 54
 		/* We need to obtain the mutex */
55 55
 		gfxMutexEnter(&mutex);
@@ -61,7 +61,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
61 61
 				if ((pt->flags & GTIMER_FLG_JABBED) || (!(pt->flags & GTIMER_FLG_INFINITE) && TimeIsWithin(pt->when, lastTime, tm))) {
62 62
 				
63 63
 					// Is this timer periodic?
64
-					if ((pt->flags & GTIMER_FLG_PERIODIC) && pt->period != TIME_IMMEDIATE) {
64
+					if ((pt->flags & GTIMER_FLG_PERIODIC) && pt->period != gDelayNone) {
65 65
 						// Yes - Update ready for the next period
66 66
 						if (!(pt->flags & GTIMER_FLG_INFINITE)) {
67 67
 							// We may have skipped a period.
@@ -164,9 +164,9 @@ void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, gBool periodic, gDe
164 164
 	pt->flags = GTIMER_FLG_SCHEDULED;
165 165
 	if (periodic)
166 166
 		pt->flags |= GTIMER_FLG_PERIODIC;
167
-	if (millisec == TIME_INFINITE) {
167
+	if (millisec == gDelayForever) {
168 168
 		pt->flags |= GTIMER_FLG_INFINITE;
169
-		pt->period = TIME_INFINITE;
169
+		pt->period = gDelayForever;
170 170
 	} else {
171 171
 		pt->period = gfxMillisecondsToTicks(millisec);
172 172
 		pt->when = gfxSystemTicks() + pt->period;

+ 2 - 2
src/gtimer/gtimer.h

@@ -89,9 +89,9 @@ void gtimerDeinit(GTimer* pt);
89 89
  * @param[in] param		The parameter to pass to the callback function
90 90
  * @param[in] periodic	Is the timer a periodic timer? gFalse is a once-only timer.
91 91
  * @param[in] millisec	The timer period. The following special values are allowed:
92
- *							TIME_IMMEDIATE	causes the callback function to be called asap.
92
+ *							gDelayNone	causes the callback function to be called asap.
93 93
  *											A periodic timer with this value will fire once only.
94
- *							TIME_INFINITE	never timeout (unless triggered by gtimerJab or gtimerJabI)
94
+ *							gDelayForever	never timeout (unless triggered by gtimerJab or gtimerJabI)
95 95
  *
96 96
  * @note				If the timer is already active its properties are updated with the new parameters.
97 97
  *						The current period will be immediately canceled (without the callback function being

+ 2 - 2
src/gwin/gwin_image.c

@@ -99,10 +99,10 @@ static void ImageRedraw(GHandle gh) {
99 99
 
100 100
 		// Wait for that delay if required
101 101
 		switch(delay) {
102
-		case TIME_INFINITE:
102
+		case gDelayForever:
103 103
 			// Everything is done
104 104
 			break;
105
-		case TIME_IMMEDIATE:
105
+		case gDelayNone:
106 106
 			// We can't allow a continuous loop here as it would lock the system up so we delay for the minimum period
107 107
 			delay = 1;
108 108
 			// Fall through

+ 6 - 6
src/gwin/gwin_wm.c

@@ -190,7 +190,7 @@ void _gwmInit(void)
190 190
 	#endif
191 191
 	#if !GWIN_REDRAW_IMMEDIATE
192 192
 		gtimerInit(&RedrawTimer);
193
-		gtimerStart(&RedrawTimer, RedrawTimerFn, 0, gTrue, TIME_INFINITE);
193
+		gtimerStart(&RedrawTimer, RedrawTimerFn, 0, gTrue, gDelayForever);
194 194
 	#endif
195 195
 	_GWINwm = (GWindowManager *)&GNullWindowManager;
196 196
 	_GWINwm->vmt->Init();
@@ -231,8 +231,8 @@ void _gwinFlushRedraws(GRedrawMethod how) {
231 231
 
232 232
 	// Obtain the drawing lock
233 233
 	if (how == REDRAW_WAIT)
234
-		gfxSemWait(&gwinsem, TIME_INFINITE);
235
-	else if (how == REDRAW_NOWAIT && !gfxSemWait(&gwinsem, TIME_IMMEDIATE))
234
+		gfxSemWait(&gwinsem, gDelayForever);
235
+	else if (how == REDRAW_NOWAIT && !gfxSemWait(&gwinsem, gDelayNone))
236 236
 		// Someone is drawing - They will do the redraw when they are finished
237 237
 		return;
238 238
 
@@ -373,7 +373,7 @@ gBool _gwinDrawStart(GHandle gh) {
373 373
 		return gFalse;
374 374
 
375 375
 	// Obtain the drawing lock
376
-	gfxSemWait(&gwinsem, TIME_INFINITE);
376
+	gfxSemWait(&gwinsem, gDelayForever);
377 377
 
378 378
 	// Re-test visibility as we may have waited a while
379 379
 	if (!(gh->flags & GWIN_FLG_SYSVISIBLE)) {
@@ -742,7 +742,7 @@ static gBool WM_Add(GHandle gh, const GWindowInit *pInit) {
742 742
 
743 743
 static void WM_Delete(GHandle gh) {
744 744
 	// Remove it from the window list
745
-	gfxSemWait(&gwinsem, TIME_INFINITE);
745
+	gfxSemWait(&gwinsem, gDelayForever);
746 746
 	gfxQueueASyncRemove(&_GWINList, &gh->wmq);
747 747
 	gfxSemSignal(&gwinsem);
748 748
 }
@@ -986,7 +986,7 @@ static void WM_Raise(GHandle gh) {
986 986
 	// Take it off the list and then put it back on top
987 987
 	// The order of the list then reflects the z-order.
988 988
 
989
-	gfxSemWait(&gwinsem, TIME_INFINITE);
989
+	gfxSemWait(&gwinsem, gDelayForever);
990 990
 	
991 991
 	gfxQueueASyncRemove(&_GWINList, &gh->wmq);
992 992
 	gfxQueueASyncPut(&_GWINList, &gh->wmq);