Browse Source

Added new type definitions - moving towards V3.0

inmarket 1 year ago
parent
commit
41271d632b
100 changed files with 441 additions and 553 deletions
  1. 10 10
      boards/addons/gdisp/board_ED060SC4_example.h
  2. 1 1
      boards/addons/gdisp/board_HX8347D_stm32f4discovery.h
  3. 1 1
      boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h
  4. 1 1
      boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h
  5. 3 3
      boards/addons/gdisp/board_ILI9341_spi.h
  6. 1 1
      boards/addons/gdisp/board_ILI9481_firebullstm32f103.h
  7. 1 1
      boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h
  8. 1 1
      boards/addons/gdisp/board_S6D1121_olimex_e407.h
  9. 2 2
      boards/addons/gdisp/board_SPFD54124B_stm32f3.h
  10. 1 1
      boards/addons/gdisp/board_SSD1289_stm32f4discovery.h
  11. 1 1
      boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h
  12. 1 1
      boards/addons/gdisp/board_SSD1306_i2c.h
  13. 0 88
      boards/addons/gdisp/board_SSD1331_tinyscreen_arduino.cpp
  14. 0 34
      boards/addons/gdisp/board_SSD1331_tinyscreen_arduino.h
  15. 13 12
      boards/addons/gdisp/board_SSD1351_teensy.h
  16. 1 1
      boards/addons/gdisp/board_SSD1963_fsmc.h
  17. 1 1
      boards/addons/gdisp/board_SSD1963_gpio.h
  18. 7 7
      boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h
  19. 4 4
      boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h
  20. 4 4
      boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h
  21. 6 6
      boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h
  22. 6 6
      boards/addons/ginput/touch/MCU/ginput_lld_mouse_board_olimex_pic32mx_lcd.h
  23. 2 2
      boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h
  24. 1 0
      boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h
  25. 1 1
      boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h
  26. 4 4
      boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h
  27. 1 1
      boards/base/FireBull-STM32F103-FB/board_SSD1289.h
  28. 4 4
      boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h
  29. 1 1
      boards/base/HY-MiniSTM32V/board_SSD1289.h
  30. 2 2
      boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h
  31. 1 1
      boards/base/Marlin/board_RA8875.h
  32. 3 3
      boards/base/Marlin/gmouse_lld_FT5x06_board.h
  33. 1 1
      boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h
  34. 4 4
      boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h
  35. 1 1
      boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h
  36. 5 5
      boards/base/Mikromedia-STM32-M4-ILI9341/gmouse_lld_MCU_board.h
  37. 6 6
      boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h
  38. 6 6
      boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h
  39. 1 1
      boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h
  40. 1 1
      boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h
  41. 1 1
      boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h
  42. 1 1
      boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h
  43. 3 3
      boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h
  44. 1 1
      boards/base/Olimex-STM32-LCD/board_ILI9320.h
  45. 5 5
      boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h
  46. 4 4
      boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h
  47. 4 4
      boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h
  48. 3 3
      boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h
  49. 3 3
      boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h
  50. 3 3
      boards/base/STM32F746-Discovery/stm32f7_i2c.c
  51. 1 1
      boards/base/STM32F746-Discovery/stm32f7_i2c.h
  52. 8 0
      changelog.txt
  53. 2 2
      demos/3rdparty/notepad-2/main.c
  54. 5 5
      demos/3rdparty/notepad-2/notepadApp.c
  55. 3 3
      demos/3rdparty/notepad-2/notepadCore.c
  56. 4 4
      demos/applications/combo/bounce.c
  57. 71 71
      demos/applications/combo/main.c
  58. 4 4
      demos/applications/combo/mandelbrot.c
  59. 2 2
      demos/applications/combo/tasks.h
  60. 1 1
      demos/applications/mandelbrot/main.c
  61. 1 1
      demos/applications/notepad/main.c
  62. 1 1
      demos/benchmarks/main.c
  63. 43 43
      demos/games/justget10/jg10.c
  64. 1 1
      demos/games/justget10/main.c
  65. 1 1
      demos/games/minesweeper/main.c
  66. 33 33
      demos/games/minesweeper/mines.c
  67. 1 1
      demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h
  68. 1 1
      demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h
  69. 4 4
      demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h
  70. 4 4
      demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old
  71. 1 1
      demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h
  72. 1 1
      demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h
  73. 4 4
      demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h
  74. 1 1
      demos/games/tetris/main.c
  75. 40 40
      demos/games/tetris/tetris.c
  76. 7 7
      demos/modules/gadc/gwinosc.c
  77. 4 4
      demos/modules/gadc/main.c
  78. 7 7
      demos/modules/gaudio/oscilloscope/gwinosc.c
  79. 2 2
      demos/modules/gaudio/oscilloscope/main.c
  80. 1 1
      demos/modules/gaudio/play-vs1053/main.c
  81. 2 2
      demos/modules/gaudio/play-wave/main.c
  82. 1 1
      demos/modules/gdisp/basics/main.c
  83. 1 1
      demos/modules/gdisp/circles/main.c
  84. 1 1
      demos/modules/gdisp/fonts/main.c
  85. 1 1
      demos/modules/gdisp/fonts_cyrillic/main.c
  86. 2 2
      demos/modules/gdisp/multiple_displays/main.c
  87. 1 1
      demos/modules/gdisp/pixmap/main.c
  88. 1 1
      demos/modules/gdisp/polygons/main.c
  89. 1 1
      demos/modules/gdisp/thickarcs/main.c
  90. 1 1
      demos/modules/ginput/keyboard/main.c
  91. 3 3
      demos/modules/gos/threads/main.c
  92. 9 9
      demos/modules/gos/threads_advanced/main.c
  93. 3 3
      demos/modules/gtimer/main.c
  94. 1 1
      demos/modules/gtrans/basic/main.c
  95. 3 3
      demos/modules/gwin/basic/main.c
  96. 3 3
      demos/modules/gwin/button/main.c
  97. 2 2
      demos/modules/gwin/checkbox/main.c
  98. 4 4
      demos/modules/gwin/console/main.c
  99. 3 3
      demos/modules/gwin/container/main.c
  100. 0 0
      demos/modules/gwin/container_nested/main.c

+ 10 - 10
boards/addons/gdisp/board_ED060SC4_example.h

@@ -76,44 +76,44 @@ static void eink_delay(int us) {
76 76
 }
77 77
 
78 78
 /* Turn the E-ink panel Vdd supply (+3.3V) on or off. */
79
-static GFXINLINE void setpower_vdd(GDisplay *g, bool_t on) {
79
+static GFXINLINE void setpower_vdd(GDisplay *g, gBool on) {
80 80
 	(void) g;
81 81
 	palWritePad(GPIOB, GPIOB_SMPS_CTRL, !on);
82 82
 	palWritePad(GPIOA, GPIOA_EINK_VDD, on);
83 83
 }
84 84
 
85 85
 /* Turn the E-ink panel negative supplies (-15V, -20V) on or off. */
86
-static GFXINLINE void setpower_vneg(GDisplay *g, bool_t on) {
86
+static GFXINLINE void setpower_vneg(GDisplay *g, gBool on) {
87 87
 	(void) g;
88 88
 	palWritePad(GPIOA, GPIOA_VNEG_CTRL, on);
89 89
 }
90 90
 
91 91
 /* Turn the E-ink panel positive supplies (-15V, -20V) on or off. */
92
-static GFXINLINE void setpower_vpos(GDisplay *g, bool_t on) {
92
+static GFXINLINE void setpower_vpos(GDisplay *g, gBool on) {
93 93
 	(void) g;
94 94
 	palWritePad(GPIOA, GPIOA_VPOS_CTRL, on);
95 95
 }
96 96
 
97 97
 /* Set the state of the LE (source driver Latch Enable) pin. */
98
-static GFXINLINE void setpin_le(GDisplay *g, bool_t on) {
98
+static GFXINLINE void setpin_le(GDisplay *g, gBool on) {
99 99
 	(void) g;
100 100
 	palWritePad(GPIOB, GPIOB_EINK_LE, on);
101 101
 }
102 102
 
103 103
 /* Set the state of the OE (source driver Output Enable) pin. */
104
-static GFXINLINE void setpin_oe(GDisplay *g, bool_t on) {
104
+static GFXINLINE void setpin_oe(GDisplay *g, gBool on) {
105 105
 	(void) g;
106 106
 	palWritePad(GPIOB, GPIOB_EINK_OE, on);
107 107
 }
108 108
 
109 109
 /* Set the state of the CL (source driver Clock) pin. */
110
-static GFXINLINE void setpin_cl(GDisplay *g, bool_t on) {
110
+static GFXINLINE void setpin_cl(GDisplay *g, gBool on) {
111 111
 	(void) g;
112 112
 	palWritePad(GPIOB, GPIOB_EINK_CL, on);
113 113
 }
114 114
 
115 115
 /* Set the state of the SPH (source driver Start Pulse Horizontal) pin. */
116
-static GFXINLINE void setpin_sph(GDisplay *g, bool_t on) {
116
+static GFXINLINE void setpin_sph(GDisplay *g, gBool on) {
117 117
 	(void) g;
118 118
 	palWritePad(GPIOB, GPIOB_EINK_SPH, on);
119 119
 }
@@ -125,19 +125,19 @@ static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) {
125 125
 }
126 126
 
127 127
 /* Set the state of the CKV (gate driver Clock Vertical) pin. */
128
-static GFXINLINE void setpin_ckv(GDisplay *g, bool_t on) {
128
+static GFXINLINE void setpin_ckv(GDisplay *g, gBool on) {
129 129
 	(void) g;
130 130
 	palWritePad(GPIOB, GPIOB_EINK_CKV, on);
131 131
 }
132 132
 
133 133
 /* Set the state of the GMODE (gate driver Gate Mode) pin. */
134
-static GFXINLINE void setpin_gmode(GDisplay *g, bool_t on) {
134
+static GFXINLINE void setpin_gmode(GDisplay *g, gBool on) {
135 135
 	(void) g;
136 136
 	palWritePad(GPIOC, GPIOC_EINK_GMODE, on);
137 137
 }
138 138
 
139 139
 /* Set the state of the SPV (gate driver Start Pulse Vertical) pin. */
140
-static GFXINLINE void setpin_spv(GDisplay *g, bool_t on) {
140
+static GFXINLINE void setpin_spv(GDisplay *g, gBool on) {
141 141
 	(void) g;
142 142
 	palWritePad(GPIOB, GPIOB_EINK_SPV, on);
143 143
 }

+ 1 - 1
boards/addons/gdisp/board_HX8347D_stm32f4discovery.h

@@ -103,7 +103,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
103 103
 	(void) g;
104 104
 }
105 105
 
106
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
106
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
107 107
 	(void) g;
108 108
 	if (state) {
109 109
 		CLR_RST;

+ 1 - 1
boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h

@@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
68 68
 	(void) g;
69 69
 }
70 70
 
71
-static noinline void setpin_reset(GDisplay *g, bool_t state) {
71
+static noinline void setpin_reset(GDisplay *g, gBool state) {
72 72
 	(void) g;
73 73
 	if (state)
74 74
 		palClearPad(IOPORTA, 7);

+ 1 - 1
boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h

@@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
68 68
 	(void) g;
69 69
 }
70 70
 
71
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
71
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
72 72
 	(void) g;
73 73
 	if(state)
74 74
 		palClearPad(GPIOE, GPIOE_TFT_RST);

+ 3 - 3
boards/addons/gdisp/board_ILI9341_spi.h

@@ -83,14 +83,14 @@ static GFXINLINE void post_init_board(GDisplay *g) {
83 83
  * @brief   Set or clear the lcd reset pin.
84 84
  *
85 85
  * @param[in] g			The GDisplay structure
86
- * @param[in] state		TRUE = lcd in reset, FALSE = normal operation
86
+ * @param[in] state		gTrue = lcd in reset, gFalse = normal operation
87 87
  * 
88 88
  * @notapi
89 89
  */
90
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
90
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
91 91
 	(void) g;
92 92
 
93
-	if (state == TRUE) {
93
+	if (state) {
94 94
 		palClearPad(LCD_PORT, LCD_RES);
95 95
 	} else {
96 96
 		palSetPad(LCD_PORT, LCD_RES);

+ 1 - 1
boards/addons/gdisp/board_ILI9481_firebullstm32f103.h

@@ -53,7 +53,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
53 53
 	(void) g;
54 54
 }
55 55
 
56
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
56
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
57 57
 	(void) g;
58 58
 	(void) state;
59 59
 }

+ 1 - 1
boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h

@@ -97,7 +97,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
97 97
 	(void) g;
98 98
 }
99 99
 
100
-static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
100
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
101 101
 {
102 102
 	(void) g;
103 103
 

+ 1 - 1
boards/addons/gdisp/board_S6D1121_olimex_e407.h

@@ -50,7 +50,7 @@ static GFXINLINE void init_board(GDisplay *g) {
50 50
 	}
51 51
 }
52 52
 
53
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
53
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
54 54
 	(void) g;
55 55
 	(void) state;
56 56
 }

+ 2 - 2
boards/addons/gdisp/board_SPFD54124B_stm32f3.h

@@ -81,7 +81,7 @@ static GFXINLINE void soft_spi_write_9bit(uint16_t data){
81 81
 }
82 82
 #endif
83 83
 
84
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
84
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
85 85
   (void) g;
86 86
   if(state) {
87 87
     CLR_RST;
@@ -100,7 +100,7 @@ static GFXINLINE void init_board(GDisplay *g) {
100 100
      * SPI1 I/O pins setup.
101 101
      */
102 102
     palSetPadMode(SPFD54124B_PIN_PORT, SPFD54124B_PIN_RST,  PAL_MODE_OUTPUT_PUSHPULL);            /* RESET */
103
-    setpin_reset(g, TRUE);
103
+    setpin_reset(g, gTrue);
104 104
 
105 105
 #if USE_HARD_SPI
106 106
     palSetPadMode(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK,  PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST);   /* SCK. */

+ 1 - 1
boards/addons/gdisp/board_SSD1289_stm32f4discovery.h

@@ -109,7 +109,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
109 109
 	(void) g;
110 110
 }
111 111
 
112
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
112
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
113 113
 	(void) g;
114 114
 	(void) state;
115 115
 }

+ 1 - 1
boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h

@@ -49,7 +49,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
49 49
 }
50 50
 
51 51
 
52
-static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
52
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
53 53
 {
54 54
 	(void)g;
55 55
 

+ 1 - 1
boards/addons/gdisp/board_SSD1306_i2c.h

@@ -82,7 +82,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
82 82
 	(void) g;
83 83
 }
84 84
 
85
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
85
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
86 86
 	(void) g;
87 87
 	if(state)
88 88
 		CLR_RST

+ 0 - 88
boards/addons/gdisp/board_SSD1331_tinyscreen_arduino.cpp

@@ -1,88 +0,0 @@
1
-#include <Arduino.h>
2
-#include <SPI.h>
3
-#include <Wire.h>
4
-
5
-#include "board_SSD1331.h"
6
-
7
-#define LCD_BOARD_ID		0		// 0 or 1 - set by the position of a resistor near SX1505 (see schematic and board design)
8
-
9
-// GPIO Pins
10
-#define GPIO_DC				0x01
11
-#define GPIO_CS				0x02
12
-#define GPIO_RES			0x08
13
-#define GPIO_BTN1			0x10
14
-#define GPIO_BTN2			0x20
15
-#define GPIO_BTN3			0x40
16
-#define GPIO_BTN4			0x80
17
-#define GPIO_CMD_START		~(GPIO_CS|GPIO_DC)
18
-#define GPIO_DATA_START		~GPIO_CS
19
-#define GPIO_TRANSFER_END	GPIO_CS
20
-
21
-//GPIO Registers
22
-#define GPIO_RegData		0x00
23
-#define GPIO_RegDir			0x01
24
-#define GPIO_RegPullUp		0x02
25
-
26
-// Wire address of the SX1505 chip
27
-#define GPIO_ADDR			0x20
28
-
29
-static void writeGPIO(uint8_t regAddr, uint8_t regData)
30
-{
31
-  uint8_t oldTWBR=TWBR;
32
-  TWBR=0;
33
-  Wire.beginTransmission(GPIO_ADDR + LCD_BOARD_ID);
34
-  Wire.write(regAddr); 
35
-  Wire.write(regData);
36
-  Wire.endTransmission();
37
-  TWBR=oldTWBR;
38
-}
39
-
40
-static bool isDataMode = false;
41
-static bool isCmdMode = false;
42
-
43
-void SSD1331_init_board(void) {
44
-	//setup GPIO, reset SSD1331
45
-	writeGPIO(GPIO_RegData,~GPIO_RES);//reset low, CS/other pins high
46
-	writeGPIO(GPIO_RegDir,~GPIO_RES);//set reset to output
47
-	delay(5);
48
-	writeGPIO(GPIO_RegDir,~(GPIO_CS|GPIO_DC));//reset to input, CS/DC output
49
-	writeGPIO(GPIO_RegPullUp,GPIO_BTN1|GPIO_BTN2|GPIO_BTN3|GPIO_BTN4);//button pullup enable
50
-	//init SPI
51
-	SPI.begin();
52
-	SPI.setDataMode(SPI_MODE0);//wrong mode, works because we're only writing. this mode is compatible with SD cards.
53
-	SPI.setClockDivider(SPI_CLOCK_DIV2);
54
-	
55
-	isDataMode = isCmdMode = false;
56
-}
57
-
58
-void SSD1331_setpin_reset(int state) {
59
-	// Ignore this as we did it in the init_board
60
-}
61
-
62
-void SSD1331_aquirebus(void) {
63
-	// Do nothing as we do it in the data transfer
64
-}
65
-
66
-void SSD1331_releasebus(void) {
67
-	if (!isDataMode && !isCmdMode) return;
68
-	writeGPIO(GPIO_RegData,GPIO_TRANSFER_END);
69
-	isDataMode = isCmdMode = false;
70
-}
71
-
72
-void SSD1331_write_cmd(uint8_t cmd) {
73
-	if (!isCmdMode) {
74
-		writeGPIO(GPIO_RegData,GPIO_CMD_START);
75
-		isDataMode = false;
76
-		isCmdMode = true;
77
-	}
78
-	SPI.transfer(cmd);
79
-}
80
-
81
-void SSD1331_write_data(uint8_t data) {
82
-	if (!isDataMode) {
83
-		writeGPIO(GPIO_RegData,GPIO_DATA_START);
84
-		isDataMode = true;
85
-		isCmdMode = false;
86
-	}
87
-	SPI.transfer(data);
88
-}

+ 0 - 34
boards/addons/gdisp/board_SSD1331_tinyscreen_arduino.h

@@ -1,34 +0,0 @@
1
-/*
2
- * This file is subject to the terms of the GFX License. If a copy of
3
- * the license was not distributed with this file, you can obtain one at:
4
- *
5
- *              http://ugfx.org/license.html
6
- */
7
-
8
-#ifndef _GDISP_LLD_BOARD_H
9
-#define _GDISP_LLD_BOARD_H
10
-
11
-#define init_board(g)			SSD1331_init_board()
12
-#define post_init_board(g)
13
-#define setpin_reset(g, state)	SSD1331_setpin_reset(state)
14
-#define acquire_bus(g)			SSD1331_aquirebus()
15
-#define release_bus(g)			SSD1331_releasebus()
16
-#define write_cmd(g, cmd)		SSD1331_write_cmd(cmd)
17
-#define write_data(g, data)		SSD1331_write_data(data)
18
-
19
-#ifdef __cplusplus
20
-extern "C" {
21
-#endif
22
-
23
-void SSD1331_init_board(void);
24
-void SSD1331_setpin_reset(int state);
25
-void SSD1331_aquirebus(void);
26
-void SSD1331_releasebus(void);
27
-void SSD1331_write_cmd(uint8_t cmd);
28
-void SSD1331_write_data(uint8_t data);
29
-
30
-#ifdef __cplusplus
31
-}
32
-#endif
33
-
34
-#endif /* _GDISP_LLD_BOARD_H */

+ 13 - 12
boards/addons/gdisp/board_SSD1351_teensy.h

@@ -8,17 +8,6 @@
8 8
 #ifndef _GDISP_LLD_BOARD_H
9 9
 #define _GDISP_LLD_BOARD_H
10 10
 
11
-#ifdef __cplusplus
12
-extern "C" {
13
-#endif // __cplusplus
14
-
15
-extern void ssd1351_init_board(void);
16
-extern void ssd1351_setpin_reset(int state);
17
-extern void ssd1351_acquire_bus(void);
18
-extern void ssd1351_release_bus(void);
19
-extern void ssd1351_write_cmd(unsigned char index);
20
-extern void ssd1351_write_data(unsigned char data);
21
-
22 11
 #define init_board(g)			ssd1351_init_board()
23 12
 #define post_init_board(g)
24 13
 #define setpin_reset(g, s)		ssd1351_setpin_reset(s)
@@ -28,8 +17,20 @@ extern void ssd1351_write_data(unsigned char data);
28 17
 #define write_cmd(g, i)			ssd1351_write_cmd(i)
29 18
 #define write_data(g, d)		ssd1351_write_cmd(d)
30 19
 
20
+/* This test is needed as this file is also included in the .cpp file providing the below functions */
21
+#ifdef __cplusplus
22
+extern "C" {
23
+#endif
24
+
25
+void ssd1351_init_board(void);
26
+void ssd1351_setpin_reset(int state);
27
+void ssd1351_acquire_bus(void);
28
+void ssd1351_release_bus(void);
29
+void ssd1351_write_cmd(unsigned char index);
30
+void ssd1351_write_data(unsigned char data);
31
+
31 32
 #ifdef __cplusplus
32 33
 }
33
-#endif // __cplusplus
34
+#endif
34 35
 
35 36
 #endif /* _GDISP_LLD_BOARD_H */

+ 1 - 1
boards/addons/gdisp/board_SSD1963_fsmc.h

@@ -81,7 +81,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
81 81
 	FSMC_Bank1->BTCR[0] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
82 82
 }
83 83
 
84
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
84
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
85 85
 	(void) g;
86 86
 	(void) state;
87 87
 }

+ 1 - 1
boards/addons/gdisp/board_SSD1963_gpio.h

@@ -72,7 +72,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
72 72
 	(void) g;
73 73
 }
74 74
 
75
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
75
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
76 76
 	(void) g;
77 77
 	(void) state;
78 78
 }

+ 7 - 7
boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h

@@ -16,7 +16,7 @@
16 16
 
17 17
 static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);
18 18
 
19
-static GFXINLINE bool_t init_board(GDisplay* g)
19
+static GFXINLINE gBool init_board(GDisplay* g)
20 20
 {
21 21
 	nrf_drv_spi_config_t spi_config;
22 22
 	ret_code_t err = NRF_SUCCESS;
@@ -47,10 +47,10 @@ static GFXINLINE bool_t init_board(GDisplay* g)
47 47
 	spi_config.bit_order	= NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
48 48
 	err = nrf_drv_spi_init(&spi, &spi_config, 0);
49 49
 	if (err != NRF_SUCCESS) {
50
-		return FALSE;
50
+		return gFalse;
51 51
 	}
52 52
 
53
-	return TRUE;
53
+	return gTrue;
54 54
 }
55 55
 
56 56
 static GFXINLINE void post_init_board(GDisplay* g)
@@ -58,7 +58,7 @@ static GFXINLINE void post_init_board(GDisplay* g)
58 58
 	(void)g;
59 59
 }
60 60
 
61
-static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
61
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
62 62
 {
63 63
 	(void)g;
64 64
 
@@ -69,14 +69,14 @@ static GFXINLINE void setpin_reset(GDisplay* g, bool_t state)
69 69
 	}
70 70
 }
71 71
 
72
-static GFXINLINE bool_t getpin_busy(GDisplay* g)
72
+static GFXINLINE gBool getpin_busy(GDisplay* g)
73 73
 {
74 74
 	(void)g;
75 75
 	
76 76
 	if (nrf_gpio_pin_read(PIN_BUSY) == 1) {
77
-		return TRUE;
77
+		return gTrue;
78 78
 	} else {
79
-		return FALSE;
79
+		return gFalse;
80 80
 	}
81 81
 }
82 82
 

+ 4 - 4
boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h

@@ -34,17 +34,17 @@ static const SPIConfig spicfg = {
34 34
 // How much extra data to allocate at the end of the GMouse structure for the board's use
35 35
 #define GMOUSE_ADS7843_BOARD_DATA_SIZE			0
36 36
 
37
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
37
+static gBool init_board(GMouse* m, unsigned driverinstance) {
38 38
 	(void)		m;
39 39
 
40 40
 	if (driverinstance)
41
-		return FALSE;
41
+		return gFalse;
42 42
 
43 43
 	spiStart(&SPID2, &spicfg);
44
-	return TRUE;
44
+	return gTrue;
45 45
 }
46 46
 
47
-static GFXINLINE bool_t getpin_pressed(GMouse* m) {
47
+static GFXINLINE gBool getpin_pressed(GMouse* m) {
48 48
 	(void)		m;
49 49
 
50 50
 	return (!palReadPad(GPIOG, 0));

+ 4 - 4
boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h

@@ -45,11 +45,11 @@ static const SPIConfig spicfg = {
45 45
 // How much extra data to allocate at the end of the GMouse structure for the board's use
46 46
 #define GMOUSE_ADS7843_BOARD_DATA_SIZE			0
47 47
 
48
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
48
+static gBool init_board(GMouse* m, unsigned driverinstance) {
49 49
 	(void)		m;
50 50
 
51 51
 	if (driverinstance)
52
-		return FALSE;
52
+		return gFalse;
53 53
 
54 54
 	palSetPadMode(GPIOB, 13, PAL_MODE_ALTERNATE(5) );	/* SCK */
55 55
 	palSetPadMode(GPIOB, 14, PAL_MODE_ALTERNATE(5) );	/* MISO */
@@ -57,10 +57,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
57 57
 	palSetPadMode(GPIOC,  4, PAL_MODE_OUTPUT_PUSHPULL);	/* CS */
58 58
 
59 59
 	spiStart(&SPID2, &spicfg);
60
-	return TRUE;
60
+	return gTrue;
61 61
 }
62 62
 
63
-static GFXINLINE bool_t getpin_pressed(GMouse* m) {
63
+static GFXINLINE gBool getpin_pressed(GMouse* m) {
64 64
 	(void)		m;
65 65
 
66 66
 	return (!palReadPad(GPIOC, 5));

+ 6 - 6
boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h

@@ -16,7 +16,7 @@
16 16
 
17 17
 static SPI_HandleTypeDef _hspi;
18 18
 
19
-static bool_t init_board(GMouse* m, unsigned driverinstance)
19
+static gBool init_board(GMouse* m, unsigned driverinstance)
20 20
 {
21 21
   GPIO_InitTypeDef GPIO_InitStruct;
22 22
 
@@ -93,20 +93,20 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
93 93
   _hspi.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
94 94
   _hspi.Init.CRCPolynomial = 10;
95 95
   if (HAL_SPI_Init(&_hspi) != HAL_OK) {
96
-    return FALSE;
96
+    return gFalse;
97 97
   }
98 98
 
99
-  return TRUE;
99
+  return gTrue;
100 100
 }
101 101
 
102
-static GFXINLINE bool_t getpin_pressed(GMouse* m)
102
+static GFXINLINE gBool getpin_pressed(GMouse* m)
103 103
 {
104 104
   (void)m;
105 105
 
106 106
   if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_4) == GPIO_PIN_RESET)
107
-    return TRUE;
107
+    return gTrue;
108 108
 
109
-  return FALSE;
109
+  return gFalse;
110 110
 }
111 111
 
112 112
 static GFXINLINE void aquire_bus(GMouse* m)

+ 6 - 6
boards/addons/ginput/touch/MCU/ginput_lld_mouse_board_olimex_pic32mx_lcd.h

@@ -59,18 +59,18 @@ static const ADCConversionGroup ADC_Y_CG = {
59 59
   .channels = 1 << YPOS,
60 60
 };
61 61
 
62
-static bool_t init_board(GMouse *m, unsigned driverinstance) {
62
+static gBool init_board(GMouse *m, unsigned driverinstance) {
63 63
 	(void)	m;
64 64
 
65 65
 	if (driverinstance)
66
-		return FALSE;
66
+		return gFalse;
67 67
 
68 68
 	adcObjectInit(&ADCD);
69 69
 	adcStart(&ADCD, &ADCC);
70
-	return TRUE;
70
+	return gTrue;
71 71
 }
72 72
 
73
-static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
73
+static gBool read_xyz(GMouse *m, GMouseReading *prd) {
74 74
 	adcsample_t samples[2];
75 75
 
76 76
 	prd->buttons = 0;
@@ -89,7 +89,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
89 89
 
90 90
 	// Shortcut - no need to read X or Y if the touch is off.
91 91
 	if (pdr->z < GMOUSE_MCU_Z_TOUCHON)
92
-		return TRUE;
92
+		return gTrue;
93 93
 
94 94
 	// Read X
95 95
 	palSetPadMode(IOPORTB, XPOS, PAL_MODE_OUTPUT);
@@ -111,7 +111,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
111 111
 	adcConvert(&ADCD, &ADC_X_CG, &samples[0], 1);
112 112
 	pdr->y = ADC_MAX - samples[0];
113 113
 
114
-	return TRUE;
114
+	return gTrue;
115 115
 }
116 116
 
117 117
 #endif /* _GINPUT_LLD_MOUSE_BOARD_H */

+ 2 - 2
boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h

@@ -66,14 +66,14 @@ static unsigned int device_read_16(unsigned char device_address, unsigned char s
66 66
 	return (0xFFFF & ((rdata_h << 8) | rdata_l));
67 67
 }
68 68
 
69
-static bool_t init_board(GMouse* m, unsigned instance)
69
+static gBool init_board(GMouse* m, unsigned instance)
70 70
 {
71 71
 	(void)m;
72 72
 	(void)instance;
73 73
 
74 74
 	I2C_init(I2C_OPENCORES_0_BASE, 50000000, 400000);
75 75
 
76
-	return TRUE;
76
+	return gTrue;
77 77
 }
78 78
 
79 79
 static void write_reg(GMouse* m, uint8_t reg, uint8_t val)

+ 1 - 0
boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h

@@ -16,6 +16,7 @@
16 16
 #define write_cmd(g, cmd)		SSD1331_write_cmd(cmd)
17 17
 #define write_data(g, data)		SSD1331_write_data(data)
18 18
 
19
+/* This test is needed as this file is also included in the .cpp file providing the below functions */
19 20
 #ifdef __cplusplus
20 21
 extern "C" {
21 22
 #endif

+ 1 - 1
boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h

@@ -99,7 +99,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
99 99
 	(void) g;
100 100
 }
101 101
 
102
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
102
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
103 103
 	(void) g;
104 104
 	if (state) {
105 105
 		CLR_RST;

+ 4 - 4
boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h

@@ -43,12 +43,12 @@ static const I2CConfig i2ccfg = {
43 43
 	FAST_DUTY_CYCLE_2,
44 44
 };
45 45
 
46
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
46
+static gBool init_board(GMouse* m, unsigned driverinstance) {
47 47
 	(void)		m;
48 48
 
49 49
 	// This board only supports one touch panel
50 50
 	if (driverinstance)
51
-		return FALSE;
51
+		return gFalse;
52 52
 
53 53
 	palSetPadMode(GPIOC, 13, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING);			/* TP IRQ */
54 54
 	palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);	/* SCL */
@@ -56,11 +56,11 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
56 56
 
57 57
 	i2cStart(&I2CD1, &i2ccfg);
58 58
 
59
-	return TRUE;
59
+	return gTrue;
60 60
 }
61 61
 
62 62
 #if GMOUSE_STMPE811_GPIO_IRQPIN
63
-	static bool_t getpin_irq(GMouse* m) {
63
+	static gBool getpin_irq(GMouse* m) {
64 64
 		(void)		m;
65 65
 
66 66
 		return !palReadPad(GPIOC, 13);

+ 1 - 1
boards/base/FireBull-STM32F103-FB/board_SSD1289.h

@@ -48,7 +48,7 @@ static GFXINLINE void post_init_board(GDisplay *g)
48 48
 	(void) g;
49 49
 }
50 50
 
51
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state)
51
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state)
52 52
 {
53 53
 	(void) g;
54 54
 	(void) state;

+ 4 - 4
boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h

@@ -26,13 +26,13 @@ static const SPIConfig spicfg = {
26 26
     /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
27 27
 };
28 28
 
29
-static bool_t init_board(GMouse* m, unsigned driverinstance)
29
+static gBool init_board(GMouse* m, unsigned driverinstance)
30 30
 {
31 31
 	(void)m;
32 32
 
33 33
 	// Only one touch interface on this board
34 34
 	if (driverinstance)
35
-		return FALSE;
35
+		return gFalse;
36 36
 	
37 37
 	// Set the GPIO modes
38 38
 	palSetPadMode(GPIOC, 4, PAL_MODE_INPUT_PULLUP);
@@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
40 40
 	// Start the SPI peripheral
41 41
 	spiStart(&SPID1, &spicfg);
42 42
 
43
-	return TRUE;
43
+	return gTrue;
44 44
 }
45 45
 
46
-static GFXINLINE bool_t getpin_pressed(GMouse* m)
46
+static GFXINLINE gBool getpin_pressed(GMouse* m)
47 47
 {
48 48
 	(void)	m;
49 49
 

+ 1 - 1
boards/base/HY-MiniSTM32V/board_SSD1289.h

@@ -124,7 +124,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
124 124
   (void) g;
125 125
 }
126 126
 
127
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
127
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
128 128
   (void) g;
129 129
 
130 130
   if(state) {}

+ 2 - 2
boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h

@@ -46,7 +46,7 @@ static const SPIConfig spicfg = {
46 46
  * TP_IRQ       PB6
47 47
  */
48 48
 
49
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
49
+static gBool init_board(GMouse* m, unsigned driverinstance) {
50 50
   (void) m;
51 51
   (void) driverinstance;
52 52
 
@@ -63,7 +63,7 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
63 63
 /*
64 64
  * PB6 is connected to TP_IRQ (low active).
65 65
  */
66
-static GFXINLINE bool_t getpin_pressed(GMouse* m) {
66
+static GFXINLINE gBool getpin_pressed(GMouse* m) {
67 67
   (void)m;
68 68
   return (!palReadPad(GPIOB, 6));
69 69
 }

+ 1 - 1
boards/base/Marlin/board_RA8875.h

@@ -70,7 +70,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
70 70
 	FSMC_Bank1->BTCR[2] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
71 71
 }
72 72
 
73
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
73
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
74 74
 	(void) g;
75 75
 	(void) state;
76 76
 }

+ 3 - 3
boards/base/Marlin/gmouse_lld_FT5x06_board.h

@@ -32,13 +32,13 @@ static const I2CConfig i2ccfg2 = {
32 32
     FAST_DUTY_CYCLE_2,
33 33
 };
34 34
 
35
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
35
+static gBool init_board(GMouse* m, unsigned driverinstance) {
36 36
 	(void)		m;
37 37
 
38 38
 	// We only support one of these on this board
39 39
 	if (driverinstance)
40
-		return FALSE;
41
-	return TRUE;
40
+		return gFalse;
41
+	return gTrue;
42 42
 }
43 43
 
44 44
 static GFXINLINE void aquire_bus(GMouse* m) {

+ 1 - 1
boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h

@@ -68,7 +68,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
68 68
 	(void) g;
69 69
 }
70 70
 
71
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
71
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
72 72
 	(void) g;
73 73
 	if (state) {
74 74
 		CLR_RST;

+ 4 - 4
boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h

@@ -43,12 +43,12 @@ static const I2CConfig i2ccfg = {
43 43
 	FAST_DUTY_CYCLE_2,
44 44
 };
45 45
 
46
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
46
+static gBool init_board(GMouse* m, unsigned driverinstance) {
47 47
 	(void)		m;
48 48
 
49 49
 	// This board only supports one touch panel
50 50
 	if (driverinstance)
51
-		return FALSE;
51
+		return gFalse;
52 52
 
53 53
     palSetPadMode(GPIOA, 0, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING);          /* TP IRQ */
54 54
     palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
@@ -56,11 +56,11 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
56 56
 
57 57
 	i2cStart(&I2CD1, &i2ccfg);
58 58
 
59
-	return TRUE;
59
+	return gTrue;
60 60
 }
61 61
 
62 62
 #if GMOUSE_STMPE610_GPIO_IRQPIN
63
-	static bool_t getpin_irq(GMouse* m) {
63
+	static gBool getpin_irq(GMouse* m) {
64 64
 		(void)		m;
65 65
 
66 66
 		return !palReadPad(GPIOA, 0);

+ 1 - 1
boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h

@@ -39,7 +39,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
39 39
 	(void) g;
40 40
 }
41 41
 
42
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
42
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
43 43
 	(void) g;
44 44
 	if(state) {
45 45
 		// reset lcd

+ 5 - 5
boards/base/Mikromedia-STM32-M4-ILI9341/gmouse_lld_MCU_board.h

@@ -41,12 +41,12 @@ static const ADCConversionGroup adcgrpcfg = {
41 41
   ADC_SQR3_SQ2_N(ADC_CHANNEL_IN8) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN9)
42 42
 };
43 43
 
44
-static bool_t init_board(GMouse *m, unsigned driverinstance) {
44
+static gBool init_board(GMouse *m, unsigned driverinstance) {
45 45
 	(void)	m;
46 46
 
47 47
 	// Only one touch interface on this board
48 48
 	if (driverinstance)
49
-		return FALSE;
49
+		return gFalse;
50 50
 
51 51
 	adcStart(&ADCD1, 0);
52 52
 
@@ -54,10 +54,10 @@ static bool_t init_board(GMouse *m, unsigned driverinstance) {
54 54
 	palClearPad(GPIOB, GPIOB_DRIVEA);
55 55
 	palClearPad(GPIOB, GPIOB_DRIVEB);
56 56
     chThdSleepMilliseconds(1);				// Settling time
57
-	return TRUE;
57
+	return gTrue;
58 58
 }
59 59
 
60
-static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
60
+static gBool read_xyz(GMouse *m, GMouseReading *prd) {
61 61
 	adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
62 62
 	(void)		m;
63 63
 
@@ -89,7 +89,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
89 89
 		palClearPad(GPIOB, GPIOB_DRIVEA);
90 90
 		palClearPad(GPIOB, GPIOB_DRIVEB);
91 91
     }
92
-    return TRUE;
92
+    return gTrue;
93 93
 }
94 94
 
95 95
 #endif /* _LLD_GMOUSE_MCU_BOARD_H */

+ 6 - 6
boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h

@@ -57,7 +57,7 @@ static const PWMConfig pwmcfg = {
57 57
   },
58 58
 };
59 59
 
60
-static bool_t pwmRunning = FALSE;
60
+static gBool pwmRunning = gFalse;
61 61
 
62 62
 /**
63 63
  * @brief   Initialise the board for the display.
@@ -123,7 +123,7 @@ static GFXINLINE void init_board(GDisplay *g) {
123 123
 		pSPI->SPI_CSR[0]  = 0x01010311;			//9bit, CPOL=1, ClockPhase=0, SCLK = 48Mhz/3 = 16MHz
124 124
 
125 125
 		/* Display backlight control at 100% */
126
-		pwmRunning = FALSE;
126
+		pwmRunning = gFalse;
127 127
 		palSetPad(IOPORT2, PIOB_LCD_BL);
128 128
 		break;
129 129
 	}
@@ -133,7 +133,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
133 133
 	(void) g;
134 134
 }
135 135
 
136
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
136
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
137 137
 	(void) g;
138 138
 	if (state)
139 139
 		palClearPad(IOPORT1, PIOA_LCD_RESET);
@@ -147,21 +147,21 @@ static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
147 147
 		/* Turn the pin on - No PWM */
148 148
 		if (pwmRunning) {
149 149
 			pwmStop(&PWMD2);
150
-			pwmRunning = FALSE;
150
+			pwmRunning = gFalse;
151 151
 		}
152 152
 		palSetPad(IOPORT2, PIOB_LCD_BL);
153 153
 	} else if (percent == 0) {
154 154
 		/* Turn the pin off - No PWM */
155 155
 		if (pwmRunning) {
156 156
 			pwmStop(&PWMD2);
157
-			pwmRunning = FALSE;
157
+			pwmRunning = gFalse;
158 158
 		}
159 159
 		palClearPad(IOPORT2, PIOB_LCD_BL);
160 160
 	} else {
161 161
 		/* Use the PWM */
162 162
 		if (!pwmRunning) {
163 163
 			pwmStart(&PWMD2, &pwmcfg);
164
-			pwmRunning = TRUE;
164
+			pwmRunning = gTrue;
165 165
 		}
166 166
 		pwmEnableChannel(&PWMD2, 0, PWM_VALUE(percent));
167 167
 	}

+ 6 - 6
boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h

@@ -56,7 +56,7 @@ static const PWMConfig pwmcfg = {
56 56
   },
57 57
 };
58 58
 
59
-static bool_t pwmRunning = FALSE;
59
+static gBool pwmRunning = gFalse;
60 60
 
61 61
 /**
62 62
  * @brief   Initialise the board for the display.
@@ -121,7 +121,7 @@ static GFXINLINE void init_board(GDisplay *g) {
121 121
 		pSPI->SPI_CSR[0]  = 0x00000311;			//9bit, CPOL=1, ClockPhase=0, SCLK = 48Mhz/3 = 16MHz
122 122
 
123 123
 		/* Display backlight control at 100% */
124
-		pwmRunning = FALSE;
124
+		pwmRunning = gFalse;
125 125
 		palSetPad(IOPORT2, PIOB_LCD_BL);
126 126
 		break;
127 127
 	}
@@ -131,7 +131,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
131 131
 	(void) g;
132 132
 }
133 133
 
134
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
134
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
135 135
 	(void) g;
136 136
 	if (state)
137 137
 		palClearPad(IOPORT1, PIOA_LCD_RESET);
@@ -145,21 +145,21 @@ static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
145 145
 		/* Turn the pin on - No PWM */
146 146
 		if (pwmRunning) {
147 147
 			pwmStop(&PWMD2);
148
-			pwmRunning = FALSE;
148
+			pwmRunning = gFalse;
149 149
 		}
150 150
 		palSetPad(IOPORT2, PIOB_LCD_BL);
151 151
 	} else if (percent == 0) {
152 152
 		/* Turn the pin off - No PWM */
153 153
 		if (pwmRunning) {
154 154
 			pwmStop(&PWMD2);
155
-			pwmRunning = FALSE;
155
+			pwmRunning = gFalse;
156 156
 		}
157 157
 		palClearPad(IOPORT2, PIOB_LCD_BL);
158 158
 	} else {
159 159
 		/* Use the PWM */
160 160
 		if (!pwmRunning) {
161 161
 			pwmStart(&PWMD2, &pwmcfg);
162
-			pwmRunning = TRUE;
162
+			pwmRunning = gTrue;
163 163
 		}
164 164
 		pwmEnableChannel(&PWMD2, 0, PWM_VALUE(percent));
165 165
 	}

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

@@ -102,7 +102,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
102 102
 	(void) g;
103 103
 }
104 104
 
105
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
105
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
106 106
 	(void) g;
107 107
 	(void) state;
108 108
 }

+ 1 - 1
boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h

@@ -175,7 +175,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
175 175
 	(void) g;
176 176
 }
177 177
 
178
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
178
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
179 179
 	(void) g;
180 180
 	(void) state;
181 181
 

+ 1 - 1
boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h

@@ -172,7 +172,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
172 172
 	(void) g;
173 173
 }
174 174
 
175
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
175
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
176 176
 	(void) g;
177 177
 	(void) state;
178 178
 

+ 1 - 1
boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h

@@ -161,7 +161,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
161 161
 	(void) g;
162 162
 }
163 163
 
164
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
164
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
165 165
 	(void) g;
166 166
 	(void) state;
167 167
 

+ 3 - 3
boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h

@@ -35,15 +35,15 @@ static GPTConfig gptcfg = {
35 35
 
36 36
 static uint16_t		lastvalue;
37 37
 
38
-static bool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) {
38
+static gBool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) {
39 39
 	if (format == ARRAY_DATA_10BITUNSIGNED)
40 40
 		pwmcfg.period = 1024;
41 41
 	else if (format == ARRAY_DATA_8BITUNSIGNED)
42 42
 		pwmcfg.period = 256;
43 43
 	else
44
-		return FALSE;
44
+		return gFalse;
45 45
 	gptcfg.frequency = frequency;
46
-	return TRUE;
46
+	return gTrue;
47 47
 }
48 48
 
49 49
 static void gaudio_play_pwm_start(void) {

+ 1 - 1
boards/base/Olimex-STM32-LCD/board_ILI9320.h

@@ -45,7 +45,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
45 45
 	(void) g;
46 46
 }
47 47
 
48
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
48
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
49 49
 	(void) g;
50 50
 
51 51
 	if(state)

+ 5 - 5
boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h

@@ -58,22 +58,22 @@ static GFXINLINE void setup_z(void) {
58 58
 	palSetPad(GPIOC, 3);
59 59
 }
60 60
 
61
-static bool_t init_board(GMouse *m, unsigned driverinstance) {
61
+static gBool init_board(GMouse *m, unsigned driverinstance) {
62 62
 	(void)	m;
63 63
 
64 64
 	// Only one touch interface on this board
65 65
 	if (driverinstance)
66
-		return FALSE;
66
+		return gFalse;
67 67
 
68 68
 	adcStart(&ADCD1, 0);
69 69
 
70 70
 	// Set up for reading Z
71 71
 	setup_z();
72 72
     chThdSleepMilliseconds(1);				// Settling time
73
-	return TRUE;
73
+	return gTrue;
74 74
 }
75 75
 
76
-static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
76
+static gBool read_xyz(GMouse *m, GMouseReading *prd) {
77 77
 	adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH];
78 78
 	uint16_t val1, val2;
79 79
 	(void)		m;
@@ -130,7 +130,7 @@ static bool_t read_xyz(GMouse *m, GMouseReading *prd) {
130 130
 		// Set up for reading z again. We know it will be 20ms before we get called again so don't worry about settling time
131 131
 	    setup_z();
132 132
     }
133
-	return TRUE;
133
+	return gTrue;
134 134
 }
135 135
 
136 136
 #endif /* _LLD_GMOUSE_MCU_BOARD_H */

+ 4 - 4
boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h

@@ -42,12 +42,12 @@ static const I2CConfig i2ccfg = {
42 42
 	FAST_DUTY_CYCLE_2,
43 43
 };
44 44
 
45
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
45
+static gBool init_board(GMouse* m, unsigned driverinstance) {
46 46
 	(void)		m;
47 47
 
48 48
 	// This board only supports one touch panel
49 49
 	if (driverinstance)
50
-		return FALSE;
50
+		return gFalse;
51 51
 
52 52
 	// Set pin modes
53 53
 	#if CH_KERNEL_MAJOR == 2
@@ -63,11 +63,11 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
63 63
 	// Start the I2C
64 64
 	i2cStart(&I2CD3, &i2ccfg);
65 65
 
66
-	return TRUE;
66
+	return gTrue;
67 67
 }
68 68
 
69 69
 #if GMOUSE_STMPE811_GPIO_IRQPIN
70
-	static bool_t getpin_irq(GMouse* m) {
70
+	static gBool getpin_irq(GMouse* m) {
71 71
 		(void)		m;
72 72
 
73 73
 		return !palReadPad(GPIOA, 15);

+ 4 - 4
boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h

@@ -40,7 +40,7 @@
40 40
 
41 41
 static I2C_HandleTypeDef _i2cHandle;
42 42
 
43
-static bool_t init_board(GMouse* m, unsigned driverinstance)
43
+static gBool init_board(GMouse* m, unsigned driverinstance)
44 44
 {
45 45
 	GPIO_InitTypeDef GPIO_InitStruct;
46 46
 	
@@ -79,17 +79,17 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
79 79
 	_i2cHandle.Init.NoStretchMode   = I2C_NOSTRETCH_DISABLED;  
80 80
 	HAL_I2C_Init(&_i2cHandle);
81 81
 	
82
-	return TRUE;
82
+	return gTrue;
83 83
 }
84 84
 
85
-static bool_t read_bytes(GMouse* m, uint8_t reg, uint8_t* buffer, uint8_t nbrBytes)
85
+static gBool read_bytes(GMouse* m, uint8_t reg, uint8_t* buffer, uint8_t nbrBytes)
86 86
 {
87 87
 	(void)m;
88 88
 
89 89
 	HAL_I2C_Master_Transmit(&_i2cHandle, (uint16_t)EXC7200_SLAVE_ADDR, (uint8_t*)&reg, 1, 10000);
90 90
 	HAL_I2C_Master_Receive(&_i2cHandle, (uint16_t)EXC7200_SLAVE_ADDR, buffer, nbrBytes, 10000);
91 91
 	
92
-	return TRUE;
92
+	return gTrue;
93 93
 }
94 94
 
95 95
 #endif /* _GINPUT_LLD_MOUSE_BOARD_H */

+ 3 - 3
boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h

@@ -30,7 +30,7 @@ I2C_HandleTypeDef i2cHandle;
30 30
 /* Maximum speed (400kHz) */
31 31
 #define CLOCKSPEED 400000;
32 32
 
33
-static bool_t init_board(GMouse* m, unsigned instance) {
33
+static gBool init_board(GMouse* m, unsigned instance) {
34 34
 	(void)m;
35 35
 	(void)instance;
36 36
 
@@ -69,9 +69,9 @@ static bool_t init_board(GMouse* m, unsigned instance) {
69 69
     __HAL_RCC_I2C1_CLK_ENABLE();
70 70
 
71 71
 	if(HAL_I2C_Init(&i2cHandle) == HAL_OK)
72
-		return TRUE;
72
+		return gTrue;
73 73
 
74
-	return FALSE;
74
+	return gFalse;
75 75
 }
76 76
 
77 77
 static GFXINLINE void aquire_bus(GMouse* m) {

+ 3 - 3
boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h

@@ -30,7 +30,7 @@
30 30
 	#define AFRH	AFR[1]
31 31
 #endif
32 32
 
33
-static bool_t init_board(GMouse* m, unsigned instance)
33
+static gBool init_board(GMouse* m, unsigned instance)
34 34
 {
35 35
 	(void)m;
36 36
 	(void)instance;
@@ -51,10 +51,10 @@ static bool_t init_board(GMouse* m, unsigned instance)
51 51
 
52 52
 	// Initialize the I2C3 peripheral
53 53
 	if (!(i2cInit(I2C3))) {
54
-		return FALSE;
54
+		return gFalse;
55 55
 	}
56 56
 
57
-	return TRUE;
57
+	return gTrue;
58 58
 }
59 59
 
60 60
 static void write_reg(GMouse* m, uint8_t reg, uint8_t val)

+ 3 - 3
boards/base/STM32F746-Discovery/stm32f7_i2c.c

@@ -34,7 +34,7 @@ static void _i2cResetCr2(I2C_TypeDef* i2c)
34 34
 	i2c->CR2 &= (uint32_t) ~((uint32_t) (I2C_CR2_SADD | I2C_CR2_HEAD10R | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_RD_WRN));
35 35
 }
36 36
 
37
-bool_t i2cInit(I2C_TypeDef* i2c)
37
+gBool i2cInit(I2C_TypeDef* i2c)
38 38
 {
39 39
 	// Enable I2Cx peripheral clock.
40 40
 	// Select APB1 as clock source
@@ -51,7 +51,7 @@ bool_t i2cInit(I2C_TypeDef* i2c)
51 51
 		RCC->DCKCFGR2 &= ~RCC_DCKCFGR2_I2C4SEL;
52 52
 		RCC->APB1ENR |= RCC_APB1ENR_I2C4EN;
53 53
 	} else {
54
-		return FALSE;
54
+		return gFalse;
55 55
 	}
56 56
 
57 57
 	// Disable the I2Cx peripheral
@@ -76,7 +76,7 @@ bool_t i2cInit(I2C_TypeDef* i2c)
76 76
 	// Enable the I2Cx peripheral
77 77
 	i2c->CR1 |= I2C_CR1_PE;
78 78
 
79
-	return TRUE;
79
+	return gTrue;
80 80
 }
81 81
 
82 82
 void i2cSend(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length)

+ 1 - 1
boards/base/STM32F746-Discovery/stm32f7_i2c.h

@@ -3,7 +3,7 @@
3 3
 #include "stm32f7xx.h"
4 4
 #include "gfx.h"
5 5
 
6
-bool_t i2cInit(I2C_TypeDef* i2c);
6
+gBool i2cInit(I2C_TypeDef* i2c);
7 7
 
8 8
 void i2cSend(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length);
9 9
 void i2cSendByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t data);

+ 8 - 0
changelog.txt

@@ -15,8 +15,16 @@ FEATURE:	Added GFX_COMPAT_V2 to maintain source compatibility with V2.x programs
15 15
 FEATURE:	Added GFX_COMPAT_OLDCOLORS to allow V2.x Red, Green, Blue color names. It is turned on by default.
16 16
 CHANGE:		Added GFX_RED, GFX_BLUE, GFX_GREEN etc to replace V2.x Red, Gree, Blue color names
17 17
 CHANGE:		Added GFXON/GFXOFF to replace V2.x TRUE/FALSE for configuration options.
18
+CHANGE:		Added gBool type and gTrue/gFalse to replace TRUE/FALSE for booleans.
19
+CHANGE:		Added types gI8, gU8 .. gI32, gU32 to replace V2.x int8_t etc
20
+CHANGE:		Added types gPtr and gPtrDiff
21
+FEATURE:	Added gI64 and gU64 when the compiler supports it. GFX_TYPE_64 macro is defined as GFXON if it does.
22
+FEATURE:	Fixed headers to ensure size_t, NULL are always defined. size_t is not used as it may be 64bit.
18 23
 FIX:		Added gfxRealloc() to Qt port
19 24
 FIX:		Fixed UC1610 driver private area initialisation
25
+FIX:		Fixed ST7735 driver and added kapacuk changes
26
+FEATURE:	Added keyboard support to radio buttons (by Steffan)
27
+FEATURE:	Added internal use only GFX_COMPILESTAGE (used to control compilation)
20 28
 
21 29
 
22 30
 *** Release 2.8 ***

+ 2 - 2
demos/3rdparty/notepad-2/main.c

@@ -81,13 +81,13 @@ int main(void) {
81 81
   gfxInit();
82 82
 
83 83
   /* Calibrate the touchscreen */
84
-  ginputSetMouseCalibrationRoutines(0, NULL, tsCalibRead, FALSE);
84
+  ginputSetMouseCalibrationRoutines(0, NULL, tsCalibRead, gFalse);
85 85
   ginputGetMouse(0);
86 86
 
87 87
   // Set the color scheme
88 88
   nSetColorScheme(schemeDefault);
89 89
 
90
-  while (TRUE) {
90
+  while (1) {
91 91
 	gfxThreadWait(nLaunchNotepadApp());
92 92
 
93 93
 	gdispSetClip(0, 0, gdispGetWidth(), gdispGetHeight());

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

@@ -73,7 +73,7 @@ static NColorScheme nCurColorScheme;
73 73
 static DECLARE_THREAD_FUNCTION(notepadThread, param);
74 74
 
75 75
 // Custom drawing functions for the buttons
76
-static void nbtnColorBarDraw(GHandle gh, bool_t enabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
76
+static void nbtnColorBarDraw(GHandle gh, gBool enabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
77 77
   #define ccs nCurColorScheme
78 78
 
79 79
   int i, j, k;
@@ -152,7 +152,7 @@ static void nbtnColorBarDraw(GHandle gh, bool_t enabled, bool_t isdown, const ch
152 152
   #undef ccs
153 153
 }
154 154
 
155
-static void nbtnColorBarSelDraw(GHandle gh, bool_t enabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
155
+static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
156 156
 #define ccs nCurColorScheme
157 157
 
158 158
   int i, j = 0, k;
@@ -215,7 +215,7 @@ static void nbtnColorBarSelDraw(GHandle gh, bool_t enabled, bool_t isdown, const
215 215
   #undef ccs
216 216
 }
217 217
 
218
-static void nToolbarImageButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
218
+static void nToolbarImageButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
219 219
   (void)txt;  (void)pstyle; (void)isenabled;
220 220
 
221 221
   color_t cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel;
@@ -228,7 +228,7 @@ static void nToolbarImageButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown,
228 228
 	gdispDrawBox(gh->x, gh->y, gh->width, gh->height, nCurColorScheme.toolbarSeparator);
229 229
 }
230 230
 
231
-static void nCloseButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
231
+static void nCloseButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) {
232 232
   (void) isenabled;
233 233
   (void) isdown;
234 234
   (void) txt;
@@ -401,7 +401,7 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
401 401
 
402 402
   ncoreSpawnDrawThread(nDrawingArea, gstatusConsole);
403 403
 
404
-  while(TRUE) {
404
+  while(1) {
405 405
 	  pem = (GEventMouse *) geventEventWait(&gl, TIME_INFINITE);
406 406
 
407 407
 	  /* button pressed... */

+ 3 - 3
demos/3rdparty/notepad-2/notepadCore.c

@@ -53,7 +53,7 @@ static gfxThreadHandle			nThd;
53 53
 static GHandle					ncoreDrawingArea = NULL;
54 54
 static GHandle					nStatusConsole = NULL;
55 55
 
56
-static volatile bool_t			doExit;
56
+static volatile gBool			doExit;
57 57
 
58 58
 static void draw_point(coord_t x, coord_t y) {
59 59
   color_t c = ncoreDrawingArea->color;
@@ -204,7 +204,7 @@ void ncoreSpawnDrawThread(GHandle drawingArea, GHandle statusConsole) {
204 204
 
205 205
   ncoreDrawingArea = drawingArea;
206 206
   nStatusConsole = statusConsole;
207
-  doExit = FALSE;
207
+  doExit = gFalse;
208 208
 
209 209
   nThd = gfxThreadCreate(waDrawThread,
210 210
                            sizeof(waDrawThread),
@@ -216,7 +216,7 @@ void ncoreSpawnDrawThread(GHandle drawingArea, GHandle statusConsole) {
216 216
 
217 217
 /* Terminate the core thread, wait for control release */
218 218
 void ncoreTerminateDrawThread(void) {
219
-  doExit = TRUE;
219
+  doExit = gTrue;
220 220
   gfxThreadWait(nThd);
221 221
   nThd = 0;
222 222
 }

+ 4 - 4
demos/applications/combo/bounce.c

@@ -33,7 +33,7 @@
33 33
 
34 34
 #include "tasks.h"
35 35
 
36
-static volatile bool_t	run;
36
+static volatile gBool	run;
37 37
 static GHandle			gh;
38 38
 static gfxThreadHandle	thread;
39 39
 
@@ -149,13 +149,13 @@ static DECLARE_THREAD_FUNCTION(task, param) {
149 149
 	return 0;
150 150
 }
151 151
 
152
-void doBounce(GHandle parent, bool_t start) {
152
+void doBounce(GHandle parent, gBool start) {
153 153
 	if (start) {
154
-		run = TRUE;
154
+		run = gTrue;
155 155
 		gh = parent;
156 156
 		thread = gfxThreadCreate(0, 0x200, LOW_PRIORITY, task, 0);
157 157
 	} else if (run) {
158
-		run = FALSE;
158
+		run = gFalse;
159 159
 		gfxThreadWait(thread);
160 160
 		gfxYield();
161 161
 	}

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

@@ -146,18 +146,18 @@ static void createWidgets(void) {
146 146
 	border = ScrWidth < 450 ? 1 : 5;
147 147
 
148 148
 	// Create the Tabs
149
-	wi.g.show = TRUE;
149
+	wi.g.show = gTrue;
150 150
 	wi.g.x = border; wi.g.y = 0;
151 151
 	wi.g.width = ScrWidth - 2*border; wi.g.height = ScrHeight-wi.g.y-border;
152 152
 	ghTabset			= gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER);
153
-	ghPgControls		= gwinTabsetAddTab(ghTabset, "Controls", FALSE);
154
-	ghPgSliders			= gwinTabsetAddTab(ghTabset, "Sliders", FALSE);
155
-	ghPgRadios			= gwinTabsetAddTab(ghTabset, "Radios", FALSE);
156
-	ghPgLists			= gwinTabsetAddTab(ghTabset, "Lists", FALSE);
157
-	ghPgLabels			= gwinTabsetAddTab(ghTabset, "Labels", FALSE);
158
-	ghPgImages			= gwinTabsetAddTab(ghTabset, "Images", FALSE);
159
-	ghPgBounce			= gwinTabsetAddTab(ghTabset, "Bounce", FALSE);
160
-	ghPgMandelbrot		= gwinTabsetAddTab(ghTabset, "Mandelbrot", FALSE);
153
+	ghPgControls		= gwinTabsetAddTab(ghTabset, "Controls", gFalse);
154
+	ghPgSliders			= gwinTabsetAddTab(ghTabset, "Sliders", gFalse);
155
+	ghPgRadios			= gwinTabsetAddTab(ghTabset, "Radios", gFalse);
156
+	ghPgLists			= gwinTabsetAddTab(ghTabset, "Lists", gFalse);
157
+	ghPgLabels			= gwinTabsetAddTab(ghTabset, "Labels", gFalse);
158
+	ghPgImages			= gwinTabsetAddTab(ghTabset, "Images", gFalse);
159
+	ghPgBounce			= gwinTabsetAddTab(ghTabset, "Bounce", gFalse);
160
+	ghPgMandelbrot		= gwinTabsetAddTab(ghTabset, "Mandelbrot", gFalse);
161 161
 
162 162
 	pagewidth = gwinGetInnerWidth(ghTabset)/2;
163 163
 
@@ -266,62 +266,62 @@ static void createWidgets(void) {
266 266
 	wi.g.parent = ghPgLists;
267 267
 	wi.g.width = LIST_WIDTH; wi.g.height = LIST_HEIGHT; wi.g.y = border;
268 268
 	wi.g.x = border; wi.text = "L1";
269
-	ghList1 = gwinListCreate(0, &wi, FALSE);
270
-	gwinListAddItem(ghList1, "Item 0", FALSE);
271
-	gwinListAddItem(ghList1, "Item 1", FALSE);
272
-	gwinListAddItem(ghList1, "Item 2", FALSE);
273
-	gwinListAddItem(ghList1, "Item 3", FALSE);
274
-	gwinListAddItem(ghList1, "Item 4", FALSE);
275
-	gwinListAddItem(ghList1, "Item 5", FALSE);
276
-	gwinListAddItem(ghList1, "Item 6", FALSE);
277
-	gwinListAddItem(ghList1, "Item 7", FALSE);
278
-	gwinListAddItem(ghList1, "Item 8", FALSE);
279
-	gwinListAddItem(ghList1, "Item 9", FALSE);
280
-	gwinListAddItem(ghList1, "Item 10", FALSE);
281
-	gwinListAddItem(ghList1, "Item 11", FALSE);
282
-	gwinListAddItem(ghList1, "Item 12", FALSE);
283
-	gwinListAddItem(ghList1, "Item 13", FALSE);
269
+	ghList1 = gwinListCreate(0, &wi, gFalse);
270
+	gwinListAddItem(ghList1, "Item 0", gFalse);
271
+	gwinListAddItem(ghList1, "Item 1", gFalse);
272
+	gwinListAddItem(ghList1, "Item 2", gFalse);
273
+	gwinListAddItem(ghList1, "Item 3", gFalse);
274
+	gwinListAddItem(ghList1, "Item 4", gFalse);
275
+	gwinListAddItem(ghList1, "Item 5", gFalse);
276
+	gwinListAddItem(ghList1, "Item 6", gFalse);
277
+	gwinListAddItem(ghList1, "Item 7", gFalse);
278
+	gwinListAddItem(ghList1, "Item 8", gFalse);
279
+	gwinListAddItem(ghList1, "Item 9", gFalse);
280
+	gwinListAddItem(ghList1, "Item 10", gFalse);
281
+	gwinListAddItem(ghList1, "Item 11", gFalse);
282
+	gwinListAddItem(ghList1, "Item 12", gFalse);
283
+	gwinListAddItem(ghList1, "Item 13", gFalse);
284 284
 	wi.text = "L2"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; }
285
-	ghList2 = gwinListCreate(0, &wi, TRUE);
286
-	gwinListAddItem(ghList2, "Item 0", FALSE);
287
-	gwinListAddItem(ghList2, "Item 1", FALSE);
288
-	gwinListAddItem(ghList2, "Item 2", FALSE);
289
-	gwinListAddItem(ghList2, "Item 3", FALSE);
290
-	gwinListAddItem(ghList2, "Item 4", FALSE);
291
-	gwinListAddItem(ghList2, "Item 5", FALSE);
292
-	gwinListAddItem(ghList2, "Item 6", FALSE);
293
-	gwinListAddItem(ghList2, "Item 7", FALSE);
294
-	gwinListAddItem(ghList2, "Item 8", FALSE);
295
-	gwinListAddItem(ghList2, "Item 9", FALSE);
296
-	gwinListAddItem(ghList2, "Item 10", FALSE);
297
-	gwinListAddItem(ghList2, "Item 11", FALSE);
298
-	gwinListAddItem(ghList2, "Item 12", FALSE);
299
-	gwinListAddItem(ghList2, "Item 13", FALSE);
285
+	ghList2 = gwinListCreate(0, &wi, gTrue);
286
+	gwinListAddItem(ghList2, "Item 0", gFalse);
287
+	gwinListAddItem(ghList2, "Item 1", gFalse);
288
+	gwinListAddItem(ghList2, "Item 2", gFalse);
289
+	gwinListAddItem(ghList2, "Item 3", gFalse);
290
+	gwinListAddItem(ghList2, "Item 4", gFalse);
291
+	gwinListAddItem(ghList2, "Item 5", gFalse);
292
+	gwinListAddItem(ghList2, "Item 6", gFalse);
293
+	gwinListAddItem(ghList2, "Item 7", gFalse);
294
+	gwinListAddItem(ghList2, "Item 8", gFalse);
295
+	gwinListAddItem(ghList2, "Item 9", gFalse);
296
+	gwinListAddItem(ghList2, "Item 10", gFalse);
297
+	gwinListAddItem(ghList2, "Item 11", gFalse);
298
+	gwinListAddItem(ghList2, "Item 12", gFalse);
299
+	gwinListAddItem(ghList2, "Item 13", gFalse);
300 300
 	wi.text = "L3"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; }
301
-	ghList3 = gwinListCreate(0, &wi, TRUE);
302
-	gwinListAddItem(ghList3, "Item 0", FALSE);
303
-	gwinListAddItem(ghList3, "Item 1", FALSE);
304
-	gwinListAddItem(ghList3, "Item 2", FALSE);
305
-	gwinListAddItem(ghList3, "Item 3", FALSE);
301
+	ghList3 = gwinListCreate(0, &wi, gTrue);
302
+	gwinListAddItem(ghList3, "Item 0", gFalse);
303
+	gwinListAddItem(ghList3, "Item 1", gFalse);
304
+	gwinListAddItem(ghList3, "Item 2", gFalse);
305
+	gwinListAddItem(ghList3, "Item 3", gFalse);
306 306
 	gdispImageOpenFile(&imgYesNo, "image_yesno.gif");
307 307
 	gwinListItemSetImage(ghList3, 1, &imgYesNo);
308 308
 	gwinListItemSetImage(ghList3, 3, &imgYesNo);
309 309
 	wi.text = "L4"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; }
310
-	ghList4 = gwinListCreate(0, &wi, TRUE);
311
-	gwinListAddItem(ghList4, "Item 0", FALSE);
312
-	gwinListAddItem(ghList4, "Item 1", FALSE);
313
-	gwinListAddItem(ghList4, "Item 2", FALSE);
314
-	gwinListAddItem(ghList4, "Item 3", FALSE);
315
-	gwinListAddItem(ghList4, "Item 4", FALSE);
316
-	gwinListAddItem(ghList4, "Item 5", FALSE);
317
-	gwinListAddItem(ghList4, "Item 6", FALSE);
318
-	gwinListAddItem(ghList4, "Item 7", FALSE);
319
-	gwinListAddItem(ghList4, "Item 8", FALSE);
320
-	gwinListAddItem(ghList4, "Item 9", FALSE);
321
-	gwinListAddItem(ghList4, "Item 10", FALSE);
322
-	gwinListAddItem(ghList4, "Item 11", FALSE);
323
-	gwinListAddItem(ghList4, "Item 12", FALSE);
324
-	gwinListAddItem(ghList4, "Item 13", FALSE);
310
+	ghList4 = gwinListCreate(0, &wi, gTrue);
311
+	gwinListAddItem(ghList4, "Item 0", gFalse);
312
+	gwinListAddItem(ghList4, "Item 1", gFalse);
313
+	gwinListAddItem(ghList4, "Item 2", gFalse);
314
+	gwinListAddItem(ghList4, "Item 3", gFalse);
315
+	gwinListAddItem(ghList4, "Item 4", gFalse);
316
+	gwinListAddItem(ghList4, "Item 5", gFalse);
317
+	gwinListAddItem(ghList4, "Item 6", gFalse);
318
+	gwinListAddItem(ghList4, "Item 7", gFalse);
319
+	gwinListAddItem(ghList4, "Item 8", gFalse);
320
+	gwinListAddItem(ghList4, "Item 9", gFalse);
321
+	gwinListAddItem(ghList4, "Item 10", gFalse);
322
+	gwinListAddItem(ghList4, "Item 11", gFalse);
323
+	gwinListAddItem(ghList4, "Item 12", gFalse);
324
+	gwinListAddItem(ghList4, "Item 13", gFalse);
325 325
 	gwinListSetScroll(ghList4, scrollSmooth);
326 326
 
327 327
 	// Image
@@ -339,25 +339,25 @@ static void setLabels(void) {
339 339
 
340 340
 	// The sliders
341 341
 	snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider1));
342
-	gwinSetText(ghLabelSlider1, tmp, TRUE);
342
+	gwinSetText(ghLabelSlider1, tmp, gTrue);
343 343
 	snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider2));
344
-	gwinSetText(ghLabelSlider2, tmp, TRUE);
344
+	gwinSetText(ghLabelSlider2, tmp, gTrue);
345 345
 	snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider3));
346
-	gwinSetText(ghLabelSlider3, tmp, TRUE);
346
+	gwinSetText(ghLabelSlider3, tmp, gTrue);
347 347
 	snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider4));
348
-	gwinSetText(ghLabelSlider4, tmp, TRUE);
348
+	gwinSetText(ghLabelSlider4, tmp, gTrue);
349 349
 
350 350
 	// The radio buttons
351 351
 	if (gwinRadioIsPressed(ghRadio1))
352
-		gwinSetText(ghLabelRadio1, "Yes", TRUE);
352
+		gwinSetText(ghLabelRadio1, "Yes", gTrue);
353 353
 	else if (gwinRadioIsPressed(ghRadio2))
354
-		gwinSetText(ghLabelRadio1, "No", TRUE);
354
+		gwinSetText(ghLabelRadio1, "No", gTrue);
355 355
 }
356 356
 
357 357
 /**
358 358
  * Control the progress bar auto-increment
359 359
  */
360
-static void setProgressbar(bool_t onoff) {
360
+static void setProgressbar(gBool onoff) {
361 361
 	if (onoff)
362 362
 		gwinProgressbarStart(ghProgressbar1, 500);
363 363
 	else {
@@ -369,7 +369,7 @@ static void setProgressbar(bool_t onoff) {
369 369
 /**
370 370
  * Set the enabled state of every widget (except the tabs etc)
371 371
  */
372
-static void setEnabled(bool_t ena) {
372
+static void setEnabled(gBool ena) {
373 373
 	//gwinSetEnabled(ghPgControls, ena);
374 374
 	gwinSetEnabled(ghPgSliders, ena);
375 375
 	gwinSetEnabled(ghPgLabels, ena);
@@ -386,7 +386,7 @@ static void setEnabled(bool_t ena) {
386 386
 	gwinSetEnabled(ghCheckbox1, ena);
387 387
 	gwinSetEnabled(ghCheckbox2, ena);
388 388
 	gwinSetEnabled(ghCheckbox3, ena);
389
-	//gwinSetEnabled(ghCheckDisableAll, TRUE);
389
+	//gwinSetEnabled(ghCheckDisableAll, gTrue);
390 390
 }
391 391
 
392 392
 static void FlashOffFn(void *param) {
@@ -404,7 +404,7 @@ int main(void) {
404 404
 	// Set the widget defaults
405 405
 	font = gdispOpenFont("*");			// Get the first defined font.
406 406
 	gwinSetDefaultFont(font);
407
-	gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
407
+	gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse);
408 408
 	gdispClear(GFX_WHITE);
409 409
 
410 410
 	// Create the gwin windows/widgets
@@ -458,7 +458,7 @@ int main(void) {
458 458
 			// If it is the toggle button checkbox start the flash.
459 459
 			} else if (((GEventGWinCheckbox *)pe)->gwin == ghCheckbox3) {
460 460
 				gwinFlash(ghCheckbox3);
461
-				gtimerStart(&FlashTimer, FlashOffFn, 0, FALSE, 3000);
461
+				gtimerStart(&FlashTimer, FlashOffFn, 0, gFalse, 3000);
462 462
 			}
463 463
 			break;
464 464
 
@@ -501,7 +501,7 @@ int main(void) {
501 501
 					gdispClear(pstyle->background);
502 502
 
503 503
 					// Update the style on all controls
504
-					gwinSetDefaultStyle(pstyle, TRUE);
504
+					gwinSetDefaultStyle(pstyle, gTrue);
505 505
 				}
506 506
 				break;
507 507
 			}

+ 4 - 4
demos/applications/combo/mandelbrot.c

@@ -30,7 +30,7 @@
30 30
 #include "gfx.h"
31 31
 #include "tasks.h"
32 32
 
33
-static volatile bool_t	run;
33
+static volatile gBool	run;
34 34
 static GHandle			gh;
35 35
 static gfxThreadHandle	thread;
36 36
 
@@ -85,13 +85,13 @@ static DECLARE_THREAD_FUNCTION(task, param) {
85 85
 	return 0;
86 86
 }
87 87
 
88
-void doMandlebrot(GHandle parent, bool_t start) {
88
+void doMandlebrot(GHandle parent, gBool start) {
89 89
 	if (start) {
90
-		run = TRUE;
90
+		run = gTrue;
91 91
 		gh = parent;
92 92
 		thread = gfxThreadCreate(0, 0x400, LOW_PRIORITY, task, 0);
93 93
 	} else if (run) {
94
-		run = FALSE;
94
+		run = gFalse;
95 95
 		gfxThreadWait(thread);
96 96
 	}
97 97
 }

+ 2 - 2
demos/applications/combo/tasks.h

@@ -1,7 +1,7 @@
1 1
 #ifndef _TASKS_INCLUDED
2 2
 #define _TASKS_INCLUDED
3 3
 
4
-void doMandlebrot(GHandle parent, bool_t start);
5
-void doBounce(GHandle parent, bool_t start);
4
+void doMandlebrot(GHandle parent, gBool start);
5
+void doBounce(GHandle parent, gBool start);
6 6
 
7 7
 #endif

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

@@ -72,7 +72,7 @@ int main(void) {
72 72
 	cx = -0.086f;
73 73
 	cy = 0.85f;
74 74
 
75
-	while(TRUE) {
75
+	while(1) {
76 76
 		mandelbrot(-2.0f*zoom+cx, -1.5f*zoom+cy, 2.0f*zoom+cx, 1.5f*zoom+cy);
77 77
 
78 78
 		zoom *= 0.7f;

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

@@ -82,7 +82,7 @@ int main(void) {
82 82
 
83 83
 	drawScreen();
84 84
 
85
-	while (TRUE) {
85
+	while (1) {
86 86
 		ginputGetMouseStatus(0, &ev);
87 87
 		if (!(ev.buttons & GINPUT_MOUSE_BTN_LEFT))
88 88
 			continue;

+ 1 - 1
demos/benchmarks/main.c

@@ -141,7 +141,7 @@ int main(void) {
141 141
 	
142 142
 	benchmark();
143 143
     
144
-	while(TRUE) {
144
+	while(1) {
145 145
 		gfxSleepMilliseconds(500);
146 146
 	}
147 147
 

+ 43 - 43
demos/games/justget10/jg10.c

@@ -17,12 +17,12 @@ GHandle jg10SelectionWidgetGCreate(GDisplay* g, jg10WidgetObject* wo, GWidgetIni
17 17
 
18 18
 typedef struct {          // Node properties
19 19
   uint8_t num;            // Node number
20
-  bool_t check;           // Node needs to be checked or not
21
-  bool_t sel;             // Node selected or not
20
+  gBool check;           // Node needs to be checked or not
21
+  gBool sel;             // Node selected or not
22 22
 } nodeProps;
23 23
 
24 24
 nodeProps             jg10Field[JG10_FIELD_WIDTH][JG10_FIELD_HEIGHT];   // jg10 field array
25
-bool_t                jg10GameOver                           = FALSE;
25
+gBool                jg10GameOver                           = gFalse;
26 26
 const char            *jg10Graph[] = {"background.bmp", "1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp", "14.bmp", "15.bmp", "16.bmp", "17.bmp", "18.bmp", "19.bmp", "20.bmp"}; // 21 elements (0-20)
27 27
 gdispImage            jg10Image[JG10_MAX_COUNT];
28 28
 #define JG10_ANIM_IMAGES 5
@@ -33,7 +33,7 @@ uint8_t               jg10MaxVal=4;                                     // Max v
33 33
 font_t font;
34 34
 #if JG10_SHOW_SPLASH
35 35
 GTimer                jg10SplashBlink;
36
-bool_t                jg10SplashTxtVisible = FALSE;
36
+gBool                jg10SplashTxtVisible = gFalse;
37 37
 gdispImage            jg10SplashImage;
38 38
 #endif
39 39
 
@@ -86,16 +86,16 @@ static int uitoa(unsigned int value, char * buf, int max) {
86 86
   return n;
87 87
 }
88 88
 
89
-static bool_t inRange(int16_t x, int16_t y) {
90
-    if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return TRUE; else return FALSE;
89
+static gBool inRange(int16_t x, int16_t y) {
90
+    if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return gTrue; else return gFalse;
91 91
 }
92 92
 
93 93
 static void clean_SelCheck(void) {
94 94
     uint16_t i ,j;
95 95
     for (i = 0; i < JG10_FIELD_WIDTH; i++) {
96 96
         for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
97
-            jg10Field[i][j].check = FALSE;
98
-            jg10Field[i][j].sel = FALSE;
97
+            jg10Field[i][j].check = gFalse;
98
+            jg10Field[i][j].sel = gFalse;
99 99
         }
100 100
     }
101 101
 }
@@ -121,7 +121,7 @@ static void remove_Selected(void) {
121 121
     for (i = 0; i < JG10_FIELD_WIDTH; i++) {
122 122
         for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
123 123
             if (jg10Field[i][j].sel) {
124
-                jg10Field[i][j].sel = FALSE;
124
+                jg10Field[i][j].sel = gFalse;
125 125
                 jg10Field[i][j].num = 0;
126 126
             }
127 127
         }
@@ -148,9 +148,9 @@ static uint8_t jg10_randomer(uint8_t max, uint8_t th) {
148 148
 
149 149
 static void movePiecesDown(void) {
150 150
     uint8_t tmp = 0;
151
-    bool_t needToCheck = TRUE;
151
+    gBool needToCheck = gTrue;
152 152
     while (needToCheck) {
153
-        needToCheck = FALSE;
153
+        needToCheck = gFalse;
154 154
         for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) {
155 155
             for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) {
156 156
                 if (jg10Field[x][y].num == 0) {
@@ -164,7 +164,7 @@ static void movePiecesDown(void) {
164 164
                             jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num;
165 165
                         }
166 166
                         jg10Field[x][0].num = 0;
167
-                        needToCheck = TRUE;
167
+                        needToCheck = gTrue;
168 168
                     }
169 169
                 }
170 170
             }
@@ -172,9 +172,9 @@ static void movePiecesDown(void) {
172 172
     }
173 173
     gwinRedraw(mainWin);
174 174
     // Add new pieces
175
-    needToCheck = TRUE;
175
+    needToCheck = gTrue;
176 176
     while (needToCheck) {
177
-        needToCheck = FALSE;
177
+        needToCheck = gFalse;
178 178
         for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) {
179 179
             for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) {
180 180
                 if (jg10Field[x][y].num == 0) {
@@ -182,7 +182,7 @@ static void movePiecesDown(void) {
182 182
                         jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num;
183 183
                     }
184 184
                     jg10Field[x][0].num = jg10_randomer(jg10MaxVal, 3);
185
-                    needToCheck = TRUE;
185
+                    needToCheck = gTrue;
186 186
                 }
187 187
             }
188 188
         }
@@ -191,8 +191,8 @@ static void movePiecesDown(void) {
191 191
     }
192 192
 }
193 193
 
194
-static bool_t checkForPossibleMove(void) {
195
-    bool_t canMove = FALSE;
194
+static gBool checkForPossibleMove(void) {
195
+    gBool canMove = gFalse;
196 196
     uint16_t i ,j;
197 197
     for (i = 0; i < JG10_FIELD_WIDTH; i++) {
198 198
         for (j = 0; j < JG10_FIELD_HEIGHT; j++) {
@@ -200,7 +200,7 @@ static bool_t checkForPossibleMove(void) {
200 200
                 (inRange(i-1,j) && jg10Field[i-1][j].num == jg10Field[i][j].num) ||
201 201
                 (inRange(i,j+1) && jg10Field[i][j+1].num == jg10Field[i][j].num) ||
202 202
                 (inRange(i+1,j) && jg10Field[i+1][j].num == jg10Field[i][j].num)) {
203
-                canMove = TRUE;
203
+                canMove = gTrue;
204 204
                 return canMove;
205 205
             }
206 206
         }
@@ -242,10 +242,10 @@ static DECLARE_THREAD_FUNCTION(thdJg10, msg) {
242 242
                         (inRange(x-1,y) && jg10Field[x-1][y].num == jg10Field[x][y].num) ||
243 243
                         (inRange(x,y+1) && jg10Field[x][y+1].num == jg10Field[x][y].num) ||
244 244
                         (inRange(x+1,y) && jg10Field[x+1][y].num == jg10Field[x][y].num)) {
245
-                        gwinSetVisible(Jg10SelectWidget, FALSE);
245
+                        gwinSetVisible(Jg10SelectWidget, gFalse);
246 246
                         clean_SelCheck();
247
-                        jg10Field[x][y].check = TRUE;
248
-                        gwinSetVisible(Jg10SelectWidget, TRUE);
247
+                        jg10Field[x][y].check = gTrue;
248
+                        gwinSetVisible(Jg10SelectWidget, gTrue);
249 249
                     }
250 250
                 } else {
251 251
                     // already selected section clicked...
@@ -254,19 +254,19 @@ static DECLARE_THREAD_FUNCTION(thdJg10, msg) {
254 254
                         jg10MaxVal = jg10Field[x][y].num;
255 255
                         if (jg10MaxVal >= 10) printCongrats();
256 256
                         if (jg10MaxVal == 20) { // Just in case someone got so far :D I cannot imaginge though 
257
-                            jg10GameOver = TRUE;
257
+                            jg10GameOver = gTrue;
258 258
                             printGameOver();
259 259
                         }
260 260
                     }
261
-                    jg10Field[x][y].sel = FALSE;
262
-                    gwinSetVisible(Jg10SelectWidget, FALSE);
261
+                    jg10Field[x][y].sel = gFalse;
262
+                    gwinSetVisible(Jg10SelectWidget, gFalse);
263 263
                     remove_Selected();
264 264
                     movePiecesDown();
265 265
                     if (checkForPossibleMove()) {
266 266
                         clean_SelCheck();
267 267
                         //gwinRedraw(mainWin);
268 268
                     } else {
269
-                        jg10GameOver = TRUE;
269
+                        jg10GameOver = gTrue;
270 270
                         printGameOver();
271 271
                     }
272 272
                 }
@@ -284,11 +284,11 @@ static void initField(void) {
284 284
             //jg10Field[x][y].num = 1;      // good for animation testing
285 285
             //jg10Field[x][y].num = x+x+5;    // good to get high score fast
286 286
             //jg10Field[x][y].num = x+y+5;  // good demo to check out pieces :D
287
-            jg10Field[x][y].check = FALSE;
288
-            jg10Field[x][y].sel = FALSE;
287
+            jg10Field[x][y].check = gFalse;
288
+            jg10Field[x][y].sel = gFalse;
289 289
         }
290 290
     }
291
-    jg10GameOver = FALSE;
291
+    jg10GameOver = gFalse;
292 292
     printGameOver();
293 293
 }
294 294
 
@@ -304,21 +304,21 @@ static void mainWinDraw(GWidgetObject* gw, void* param) {
304 304
 
305 305
 static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) {
306 306
     int16_t x, y;
307
-    bool_t needToCheck = TRUE;
307
+    gBool needToCheck = gTrue;
308 308
 
309 309
 	(void)param;
310 310
 
311 311
     while (needToCheck) {
312
-        needToCheck = FALSE;
312
+        needToCheck = gFalse;
313 313
         for (x = 0; x < JG10_FIELD_WIDTH; x++) {
314 314
             for (y = 0; y < JG10_FIELD_HEIGHT; y++) {
315 315
                 if (jg10Field[x][y].check && !jg10Field[x][y].sel) {
316
-                    jg10Field[x][y].sel = TRUE;
317
-                    jg10Field[x][y].check = FALSE;
316
+                    jg10Field[x][y].sel = gTrue;
317
+                    jg10Field[x][y].check = gFalse;
318 318
                     // Up
319 319
                     if (inRange(x, y-1) && !jg10Field[x][y-1].sel && (jg10Field[x][y-1].num == jg10Field[x][y].num)) {
320
-                        jg10Field[x][y-1].check = TRUE;
321
-                        needToCheck = TRUE;
320
+                        jg10Field[x][y-1].check = gTrue;
321
+                        needToCheck = gTrue;
322 322
                     } else  if (!inRange(x, y-1) || (inRange(x, y-1) && !jg10Field[x][y-1].sel)) {
323 323
                         // We need longer line if this is wide corner inside shape
324 324
                         if (inRange(x+1, y) && inRange(x+1, y-1) && (jg10Field[x][y].num == jg10Field[x+1][y].num) && (jg10Field[x][y].num == jg10Field[x+1][y-1].num)) {
@@ -329,8 +329,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) {
329 329
                     }
330 330
                     // Down
331 331
                     if (inRange(x, y+1) && !jg10Field[x][y+1].sel && (jg10Field[x][y+1].num == jg10Field[x][y].num)) {
332
-                        jg10Field[x][y+1].check = TRUE;
333
-                        needToCheck = TRUE;
332
+                        jg10Field[x][y+1].check = gTrue;
333
+                        needToCheck = gTrue;
334 334
                     } else if (!inRange(x, y+1) || (inRange(x, y+1) && !jg10Field[x][y+1].sel)) {
335 335
                         // We need longer line if this is wide corner inside shape
336 336
                         if (inRange(x-1, y) && inRange(x-1, y+1) && (jg10Field[x][y].num == jg10Field[x-1][y].num) && (jg10Field[x][y].num == jg10Field[x-1][y+1].num)) {
@@ -341,8 +341,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) {
341 341
                     }
342 342
                     // Left
343 343
                     if (inRange(x-1, y) && !jg10Field[x-1][y].sel && (jg10Field[x-1][y].num == jg10Field[x][y].num)) {
344
-                        jg10Field[x-1][y].check = TRUE;
345
-                        needToCheck = TRUE;
344
+                        jg10Field[x-1][y].check = gTrue;
345
+                        needToCheck = gTrue;
346 346
                     } else if (!inRange(x-1, y) || (inRange(x-1, y) && !jg10Field[x-1][y].sel)) {
347 347
                         // We need longer line if this is wide corner inside shape
348 348
                         if (inRange(x, y-1) && inRange(x-1, y-1) && (jg10Field[x][y].num == jg10Field[x][y-1].num) && (jg10Field[x][y].num == jg10Field[x-1][y-1].num)) {
@@ -353,8 +353,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) {
353 353
                     }
354 354
                     // Right
355 355
                     if (inRange(x+1, y) && !jg10Field[x+1][y].sel && (jg10Field[x+1][y].num == jg10Field[x][y].num)) {
356
-                        jg10Field[x+1][y].check = TRUE;
357
-                        needToCheck = TRUE;
356
+                        jg10Field[x+1][y].check = gTrue;
357
+                        needToCheck = gTrue;
358 358
                     } else if (!inRange(x+1, y) || (inRange(x+1, y) && !jg10Field[x+1][y].sel)) {
359 359
                         // We need longer line if this is wide corner inside shape
360 360
                         if (inRange(x, y+1) && inRange(x+1, y+1) && (jg10Field[x][y].num == jg10Field[x][y+1].num) && (jg10Field[x][y].num == jg10Field[x+1][y+1].num)) {
@@ -422,7 +422,7 @@ static void createMainWin(void) {
422 422
     GWidgetInit wi;
423 423
     gwinWidgetClearInit(&wi);
424 424
     // Container - mainWin
425
-    wi.g.show = FALSE;
425
+    wi.g.show = gFalse;
426 426
     wi.g.x = 0;
427 427
     wi.g.y = 0;
428 428
     wi.g.width = gdispGetWidth();
@@ -435,7 +435,7 @@ static void createMainWin(void) {
435 435
     mainWin = gwinContainerCreate(0, &wi, 0);
436 436
 
437 437
     // create selection widget
438
-    wi.g.show = FALSE;
438
+    wi.g.show = gFalse;
439 439
     wi.g.x = 0;
440 440
     wi.g.y = 0;
441 441
     wi.g.width = 272;
@@ -496,6 +496,6 @@ void jg10ShowSplash(void) {
496 496
     gdispImageOpenFile(&jg10SplashImage, "splash.bmp");
497 497
     gdispImageDraw(&jg10SplashImage, (gdispGetWidth()/2)-150, (gdispGetHeight()/2)-100, 300, 200, 0, 0);
498 498
     gdispImageClose(&jg10SplashImage);
499
-    gtimerStart(&jg10SplashBlink, jg10SplashBlinker, 0, TRUE, 400);
499
+    gtimerStart(&jg10SplashBlink, jg10SplashBlinker, 0, gTrue, 400);
500 500
 }
501 501
 #endif

+ 1 - 1
demos/games/justget10/main.c

@@ -21,7 +21,7 @@ int main(void)
21 21
     gdispCloseFont(font);
22 22
 #endif
23 23
 
24
-    while (TRUE) {
24
+    while (1) {
25 25
         ginputGetMouseStatus(0, &ev);
26 26
         if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {
27 27
             while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {            // Wait until release

+ 1 - 1
demos/games/minesweeper/main.c

@@ -55,7 +55,7 @@ int main(void)
55 55
     gdispCloseFont(font);
56 56
 #endif
57 57
 
58
-    while (TRUE) {
58
+    while (1) {
59 59
         ginputGetMouseStatus(0, &ev);
60 60
         if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {
61 61
             while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {            // Wait until release

+ 33 - 33
demos/games/minesweeper/mines.c

@@ -4,16 +4,16 @@
4 4
 
5 5
 typedef struct {            // Node properties
6 6
       uint8_t num;          // Node number, how many mines around
7
-      bool_t open;          // Node shown or hidden
8
-      bool_t check;         // Node needs to be checked or not, used for opening up empty nodes
9
-      bool_t flag;          // Node is marked with flag by player
7
+      gBool open;          // Node shown or hidden
8
+      gBool check;         // Node needs to be checked or not, used for opening up empty nodes
9
+      gBool flag;          // Node is marked with flag by player
10 10
       uint16_t fieldNum;    // Node number, used to randomize gamestart "animation"
11 11
 } nodeProps;
12 12
 
13 13
 static GEventMouse ev;
14 14
 static nodeProps minesField[MINES_FIELD_WIDTH][MINES_FIELD_HEIGHT];   // Mines field array
15
-static bool_t minesGameOver = FALSE;
16
-static bool_t minesGameWinner = FALSE;
15
+static gBool minesGameOver = gFalse;
16
+static gBool minesGameWinner = gFalse;
17 17
 static int16_t minesEmptyNodes;                        // Empty node counter
18 18
 static int16_t minesFlags;                             // Flag counter
19 19
 static int16_t minesTime;                              // Time counter
@@ -22,8 +22,8 @@ static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bm
22 22
 static gdispImage minesImage;
23 23
 static uint8_t minesStatusIconWidth = 0;
24 24
 static uint8_t minesStatusIconHeight = 0;
25
-static bool_t minesFirstGame = TRUE;                  // Just don't clear field for the first time, as we have black screen already... :/
26
-static bool_t minesSplashTxtVisible = FALSE;
25
+static gBool minesFirstGame = gTrue;                  // Just don't clear field for the first time, as we have black screen already... :/
26
+static gBool minesSplashTxtVisible = gFalse;
27 27
 #if MINES_SHOW_SPLASH
28 28
     static GTimer minesSplashBlink;
29 29
 #endif
@@ -125,19 +125,19 @@ static void minesTimeCounter(void* arg)
125 125
     minesUpdateTime();
126 126
 }
127 127
 
128
-static bool_t inRange(int16_t x, int16_t y)
128
+static gBool inRange(int16_t x, int16_t y)
129 129
 {
130 130
     if ((x >= 0) && (x < MINES_FIELD_WIDTH) && (y >= 0) && (y < MINES_FIELD_HEIGHT))
131
-        return TRUE;
131
+        return gTrue;
132 132
     else
133
-        return FALSE;
133
+        return gFalse;
134 134
 }
135 135
 
136 136
 static void showOne(int16_t x, int16_t y)
137 137
 {
138
-    minesField[x][y].open = TRUE;
138
+    minesField[x][y].open = gTrue;
139 139
     if (minesField[x][y].flag) {
140
-        minesField[x][y].flag = FALSE;
140
+        minesField[x][y].flag = gFalse;
141 141
         minesFlags--;
142 142
     }
143 143
 
@@ -149,8 +149,8 @@ static void showOne(int16_t x, int16_t y)
149 149
         gdispImageClose(&minesImage);
150 150
         minesEmptyNodes--;
151 151
     } else if (minesField[x][y].num == 9) {
152
-        minesGameOver = TRUE;
153
-        minesGameWinner = FALSE;
152
+        minesGameOver = gTrue;
153
+        minesGameWinner = gFalse;
154 154
         gdispImageOpenFile(&minesImage, minesGraph[10]);
155 155
         gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0);
156 156
         gdispImageClose(&minesImage);
@@ -160,7 +160,7 @@ static void showOne(int16_t x, int16_t y)
160 160
         gdispImageOpenFile(&minesImage, minesGraph[9]);
161 161
         gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0);
162 162
         gdispImageClose(&minesImage);
163
-        minesField[x][y].check = TRUE;
163
+        minesField[x][y].check = gTrue;
164 164
         minesEmptyNodes--;
165 165
     }
166 166
 }
@@ -168,10 +168,10 @@ static void showOne(int16_t x, int16_t y)
168 168
 static void openEmptyNodes(void)
169 169
 {
170 170
     int16_t x, y, i, j;
171
-    bool_t needToCheck = TRUE;
171
+    gBool needToCheck = gTrue;
172 172
 
173 173
     while (needToCheck) {
174
-        needToCheck = FALSE;
174
+        needToCheck = gFalse;
175 175
         for (x = 0; x < MINES_FIELD_WIDTH; x++) {
176 176
             for (y = 0; y < MINES_FIELD_HEIGHT; y++) {
177 177
                 if (minesField[x][y].check) {
@@ -180,12 +180,12 @@ static void openEmptyNodes(void)
180 180
                             if ((i != 0) || (j != 0)) {                 // We don't need to check middle node as it is the one we are checking right now! :D
181 181
                                 if (inRange(x+i,y+j)) {
182 182
                                     if (!minesField[x+i][y+j].open) showOne(x+i,y+j);
183
-                                    if (minesField[x+i][y+j].check) needToCheck = TRUE;
183
+                                    if (minesField[x+i][y+j].check) needToCheck = gTrue;
184 184
                                 }
185 185
                             }
186 186
                         }
187 187
                     }
188
-                    minesField[x][y].check = FALSE;
188
+                    minesField[x][y].check = gFalse;
189 189
                 }
190 190
             }
191 191
         }
@@ -196,15 +196,15 @@ static DECLARE_THREAD_FUNCTION(thdMines, msg)
196 196
 {
197 197
     (void)msg;
198 198
     uint16_t x,y, delay;
199
-    bool_t delayed = FALSE;
199
+    gBool delayed = gFalse;
200 200
     while (!minesGameOver) {
201 201
         if (minesEmptyNodes == 0) {
202
-            minesGameOver = TRUE;
203
-            minesGameWinner = TRUE;
202
+            minesGameOver = gTrue;
203
+            minesGameWinner = gTrue;
204 204
         }
205 205
         initRng();
206 206
         ginputGetMouseStatus(0, &ev);
207
-        delayed = FALSE;
207
+        delayed = gFalse;
208 208
         if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) {
209 209
             x = ev.x/MINES_CELL_WIDTH;
210 210
             y = ev.y/MINES_CELL_WIDTH;
@@ -220,18 +220,18 @@ static DECLARE_THREAD_FUNCTION(thdMines, msg)
220 220
                             gdispImageOpenFile(&minesImage, minesGraph[8]);
221 221
                             gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH-1, MINES_CELL_HEIGHT-1, 0, 0);
222 222
                             gdispImageClose(&minesImage);
223
-                            minesField[x][y].flag = FALSE;
223
+                            minesField[x][y].flag = gFalse;
224 224
                             minesFlags--;
225 225
                             printStats();
226 226
                         } else {
227 227
                             gdispImageOpenFile(&minesImage, minesGraph[11]);
228 228
                             gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0);
229 229
                             gdispImageClose(&minesImage);
230
-                            minesField[x][y].flag = TRUE;
230
+                            minesField[x][y].flag = gTrue;
231 231
                             minesFlags++;
232 232
                             printStats();
233 233
                         }
234
-                        delayed = TRUE;
234
+                        delayed = gTrue;
235 235
                     }
236 236
                 }
237 237
             }
@@ -268,7 +268,7 @@ static void initField(void)
268 268
     int16_t x, y, mines, i, j;
269 269
 
270 270
     minesFlags = 0;
271
-    minesGameOver = FALSE;
271
+    minesGameOver = gFalse;
272 272
     printGameOver();
273 273
 
274 274
     font_t font = gdispOpenFont("fixed_5x8");
@@ -291,9 +291,9 @@ static void initField(void)
291 291
     for (x = 0; x < MINES_FIELD_WIDTH; x++) {
292 292
         for (y = 0; y < MINES_FIELD_HEIGHT; y++) {
293 293
             minesField[x][y].num = 0;
294
-            minesField[x][y].open = FALSE;
295
-            minesField[x][y].check = FALSE;
296
-            minesField[x][y].flag = FALSE;
294
+            minesField[x][y].open = gFalse;
295
+            minesField[x][y].check = gFalse;
296
+            minesField[x][y].flag = gFalse;
297 297
             minesField[x][y].fieldNum = i;
298 298
             i++;
299 299
         }
@@ -322,7 +322,7 @@ static void initField(void)
322 322
             }
323 323
         }
324 324
     } else {
325
-        minesFirstGame = FALSE;
325
+        minesFirstGame = gFalse;
326 326
     }
327 327
 
328 328
     // Drawing closed nodes randomly
@@ -369,7 +369,7 @@ static void initField(void)
369 369
 
370 370
     minesTime = 0;
371 371
     minesUpdateTime();
372
-    gtimerStart(&minesTimeCounterTimer, minesTimeCounter, 0, TRUE, 1000);
372
+    gtimerStart(&minesTimeCounterTimer, minesTimeCounter, 0, gTrue, 1000);
373 373
 }
374 374
 
375 375
 void minesStart(void)
@@ -434,7 +434,7 @@ void minesStart(void)
434 434
         gdispImageDraw(&minesImage, (gdispGetWidth()/2)-150, (gdispGetHeight()/2)-100, 300, 200, 0, 0);
435 435
         gdispImageClose(&minesImage);
436 436
     
437
-        gtimerStart(&minesSplashBlink, minesSplashBlinker, 0, TRUE, 400);
437
+        gtimerStart(&minesSplashBlink, minesSplashBlinker, 0, gTrue, 400);
438 438
     }
439 439
 #endif
440 440
 

+ 1 - 1
demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h

@@ -111,7 +111,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
111 111
 	(void) g;
112 112
 }
113 113
 
114
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
114
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
115 115
 	(void) g;
116 116
 	(void) state;
117 117
 }

+ 1 - 1
demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h

@@ -26,7 +26,7 @@ static GFXINLINE void init_board(void)
26 26
   spiStart(&SPID1, &spicfg);
27 27
 }
28 28
  
29
-static GFXINLINE bool_t getpin_pressed(void)
29
+static GFXINLINE gBool getpin_pressed(void)
30 30
 {
31 31
   return (!palReadPad(GPIOC, 4));
32 32
 }

+ 4 - 4
demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h

@@ -45,12 +45,12 @@ static const SPIConfig spicfg = {
45 45
 // How much extra data to allocate at the end of the GMouse structure for the board's use
46 46
 #define GMOUSE_ADS7843_BOARD_DATA_SIZE			0
47 47
 
48
-static bool_t init_board(GMouse* m, unsigned driverinstance) {
48
+static gBool init_board(GMouse* m, unsigned driverinstance) {
49 49
     (void)m;
50 50
 
51 51
     // Only one touch interface on this board
52 52
     if (driverinstance)
53
-	return FALSE;
53
+		return gFalse;
54 54
 
55 55
     // Set the GPIO modes
56 56
         palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL);
@@ -62,10 +62,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
62 62
     // Start the SPI peripheral
63 63
     	spiStart(&SPID1, &spicfg);
64 64
 
65
-    return TRUE;
65
+    return gTrue;
66 66
 }
67 67
 
68
-static GFXINLINE bool_t getpin_pressed(GMouse* m) {
68
+static GFXINLINE gBool getpin_pressed(GMouse* m) {
69 69
 	(void)		m;
70 70
 
71 71
 	return (!palReadPad(GPIOC, 4));

+ 4 - 4
demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old

@@ -22,13 +22,13 @@ static const SPIConfig spicfg = {
22 22
     /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
23 23
 };
24 24
 
25
-static bool_t init_board(GMouse* m, unsigned driverinstance)
25
+static gBool init_board(GMouse* m, unsigned driverinstance)
26 26
 {
27 27
     (void)m;
28 28
 
29 29
     // Only one touch interface on this board
30 30
     if (driverinstance)
31
-	return FALSE;
31
+		return gFalse;
32 32
 
33 33
     // Set the GPIO modes
34 34
         palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL);
@@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
40 40
     // Start the SPI peripheral
41 41
     spiStart(&SPID1, &spicfg);
42 42
 
43
-    return TRUE;
43
+    return gTrue;
44 44
 }
45 45
 
46
-GFXINLINE bool_t getpin_pressed(void) {
46
+GFXINLINE gBool getpin_pressed(void) {
47 47
   return (!palReadPad(GPIOC, 4));
48 48
 }
49 49
 

+ 1 - 1
demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h

@@ -109,7 +109,7 @@ static GFXINLINE void post_init_board(GDisplay *g) {
109 109
 	(void) g;
110 110
 }
111 111
 
112
-static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
112
+static GFXINLINE void setpin_reset(GDisplay *g, gBool state) {
113 113
 	(void) g;
114 114
 	(void) state;
115 115
 }

+ 1 - 1
demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h

@@ -26,7 +26,7 @@ static GFXINLINE void init_board(void)
26 26
   spiStart(&SPID1, &spicfg);
27 27
 }
28 28
  
29
-static GFXINLINE bool_t getpin_pressed(void)
29
+static GFXINLINE gBool getpin_pressed(void)
30 30
 {
31 31
   return (!palReadPad(GPIOC, 4));
32 32
 }

+ 4 - 4
demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h

@@ -22,13 +22,13 @@ static const SPIConfig spicfg = {
22 22
     /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0,
23 23
 };
24 24
 
25
-static bool_t init_board(GMouse* m, unsigned driverinstance)
25
+static gBool init_board(GMouse* m, unsigned driverinstance)
26 26
 {
27 27
     (void)m;
28 28
 
29 29
     // Only one touch interface on this board
30 30
     if (driverinstance)
31
-	return FALSE;
31
+		return gFalse;
32 32
 
33 33
     // Set the GPIO modes
34 34
         palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL);
@@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance)
40 40
     // Start the SPI peripheral
41 41
     spiStart(&SPID1, &spicfg);
42 42
 
43
-    return TRUE;
43
+    return gTrue;
44 44
 }
45 45
 
46
-GFXINLINE bool_t getpin_pressed(void) {
46
+GFXINLINE gBool getpin_pressed(void) {
47 47
   return (!palReadPad(GPIOC, 4));
48 48
 }
49 49
 

+ 1 - 1
demos/games/tetris/main.c

@@ -43,7 +43,7 @@ int main(void)
43 43
 
44 44
 	tetrisInit();
45 45
 
46
-	while (TRUE) {
46
+	while (1) {
47 47
 		// Start a new game
48 48
 		// Will return when game is over
49 49
 		tetrisStart();

+ 40 - 40
demos/games/tetris/tetris.c

@@ -86,9 +86,9 @@ int             tetrisOldShape[4][2];
86 86
 int             tetrisNextShapeNum, tetrisOldShapeNum;
87 87
 unsigned long   tetrisLines                                           = 0;
88 88
 unsigned long   tetrisScore                                           = 0;
89
-bool_t          tetrisKeysPressed[5]                                  = {FALSE, FALSE, FALSE, FALSE, FALSE}; // left/down/right/up/pause
90
-bool_t          tetrisPaused                                          = FALSE;
91
-bool_t          tetrisGameOver                                        = FALSE;
89
+gBool          tetrisKeysPressed[5]                                  = {gFalse, gFalse, gFalse, gFalse, gFalse}; // left/down/right/up/pause
90
+gBool          tetrisPaused                                          = gFalse;
91
+gBool          tetrisGameOver                                        = gFalse;
92 92
 font_t          font16;
93 93
 font_t          font12;
94 94
 
@@ -274,34 +274,34 @@ static void printTouchAreas(void) {
274 274
   gdispDrawLine(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-1, GFX_GRAY);
275 275
 }
276 276
 
277
-static bool_t stay(bool_t down) {
277
+static gBool stay(gBool down) {
278 278
   int sk, k;
279
-  bool_t stay;
280
-  if (down == TRUE) sk = 1; else sk = 0;
281
-  stay = FALSE;
279
+  gBool stay;
280
+  if (down) sk = 1; else sk = 0;
281
+  stay = gFalse;
282 282
   for (k = 0; k <= 3; k++) {
283 283
     if (tetrisCurrentShape[k][1] == 0) {
284
-      return TRUE;
284
+      return gTrue;
285 285
     }
286 286
   }
287 287
   for (k = 0; k <= 3; k++) {
288
-    if ((tetrisCurrentShape[k][0] < 0) || (tetrisCurrentShape[k][0] > 9)) return TRUE;
288
+    if ((tetrisCurrentShape[k][0] < 0) || (tetrisCurrentShape[k][0] > 9)) return gTrue;
289 289
     if (tetrisCurrentShape[k][1] <= 16)
290
-      if (tetrisField[tetrisCurrentShape[k][1]-sk][tetrisCurrentShape[k][0]] != 0) return TRUE;
290
+      if (tetrisField[tetrisCurrentShape[k][1]-sk][tetrisCurrentShape[k][0]] != 0) return gTrue;
291 291
   }
292 292
   return stay;
293 293
 }
294 294
 
295 295
 static void clearCompleteLines(void) {
296
-  bool_t t;
296
+  gBool t;
297 297
   uint8_t reiz = 0;
298 298
   int l,k,j;
299 299
   l = 0;
300 300
   while (l <= 16) {
301
-    t = TRUE;
301
+    t = gTrue;
302 302
     for (j = 0; j <= 9; j++)
303
-      if (tetrisField[l][j] == 0) t = FALSE;
304
-    if (t == TRUE) {
303
+      if (tetrisField[l][j] == 0) t = gFalse;
304
+    if (t) {
305 305
       for (j = 4; j >= 0; j--) { // cheap & dirty line removal animation :D
306 306
         drawCell(j,l, 0);
307 307
         drawCell(9-j,l, 0);
@@ -331,7 +331,7 @@ static void clearCompleteLines(void) {
331 331
 
332 332
 static void goDown(void) {
333 333
   int i;
334
-  if (stay(TRUE) == FALSE) {
334
+  if (!stay(gTrue)) {
335 335
     drawShape(0);
336 336
     for (i = 0; i <= 3; i++) {
337 337
       tetrisCurrentShape[i][1]--;
@@ -340,7 +340,7 @@ static void goDown(void) {
340 340
   } else {
341 341
     for (i = 0; i <= 3; i++) {
342 342
       if (tetrisCurrentShape[i][1] >=17) {
343
-        tetrisGameOver = TRUE;
343
+        tetrisGameOver = gTrue;
344 344
         return;
345 345
       } else {
346 346
        tetrisField[tetrisCurrentShape[i][1]][tetrisCurrentShape[i][0]] = tetrisOldShapeNum+1;
@@ -348,8 +348,8 @@ static void goDown(void) {
348 348
     }
349 349
     clearCompleteLines();
350 350
     createShape();
351
-    if (stay(FALSE) == TRUE) {
352
-      tetrisGameOver = TRUE;
351
+    if (stay(gFalse)) {
352
+      tetrisGameOver = gTrue;
353 353
       return;
354 354
     }
355 355
     drawShape(tetrisOldShapeNum+1);
@@ -383,7 +383,7 @@ static void rotateShape(void) {
383 383
     tetrisCurrentShape[i][0] = ox+(round((tx-ox)*cos(90*(3.14/180))-(ty-oy)*sin(90*(3.14/180))));
384 384
     tetrisCurrentShape[i][1] = oy+(round((tx-ox)*sin(90*(3.14/180))+(ty-oy)*cos(90*(3.14/180))));
385 385
   }
386
-  if (stay(FALSE) == FALSE) {
386
+  if (!stay(gFalse)) {
387 387
     memcpy(tetrisNextShape, tetrisCurrentShape, sizeof(tetrisNextShape)); // tetrisNextShape = tetrisCurrentShape;
388 388
     memcpy(tetrisCurrentShape, tetrisOldShape, sizeof(tetrisCurrentShape)); // tetrisCurrentShape = tetrisOldShape;
389 389
     drawShape(0);
@@ -394,20 +394,20 @@ static void rotateShape(void) {
394 394
   }
395 395
 }
396 396
 
397
-static bool_t checkSides(bool_t left) {
397
+static gBool checkSides(gBool left) {
398 398
   int sk,k;
399
-  if (left == TRUE) sk = 1; else sk = -1;
399
+  if (left) sk = 1; else sk = -1;
400 400
   for (k = 0; k <= 3; k++) {
401
-    if ((tetrisCurrentShape[k][0]+sk < 0) || (tetrisCurrentShape[k][0]+sk > 9)) return TRUE;
401
+    if ((tetrisCurrentShape[k][0]+sk < 0) || (tetrisCurrentShape[k][0]+sk > 9)) return gTrue;
402 402
     if (tetrisCurrentShape[k][1] <= 16)
403
-      if (tetrisField[tetrisCurrentShape[k][1]][tetrisCurrentShape[k][0]+sk] != 0) return TRUE;
403
+      if (tetrisField[tetrisCurrentShape[k][1]][tetrisCurrentShape[k][0]+sk] != 0) return gTrue;
404 404
   }
405
-  return FALSE;
405
+  return gFalse;
406 406
 }
407 407
 
408 408
 static void goRight(void) {
409 409
   int i;
410
-  if (checkSides(TRUE) == FALSE) {
410
+  if (!checkSides(gTrue)) {
411 411
     drawShape(0);
412 412
     for (i = 0; i <= 3; i++) {
413 413
       tetrisCurrentShape[i][0]++;
@@ -418,7 +418,7 @@ static void goRight(void) {
418 418
 
419 419
 static void goLeft(void) {
420 420
   int i;
421
-  if (checkSides(FALSE) == FALSE) {
421
+  if (!checkSides(gFalse)) {
</