diff --git a/boards/addons/gdisp/board_ED060SC4_example.h b/boards/addons/gdisp/board_ED060SC4_example.h index 7ac05575..7fcfcf94 100644 --- a/boards/addons/gdisp/board_ED060SC4_example.h +++ b/boards/addons/gdisp/board_ED060SC4_example.h @@ -119,7 +119,7 @@ static GFXINLINE void setpin_sph(GDisplay *g, gBool on) { } /* Set the state of the D0-D7 (source driver Data) pins. */ -static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) { +static GFXINLINE void setpins_data(GDisplay *g, gU8 value) { (void) g; palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value); } diff --git a/boards/addons/gdisp/board_HX8347D_stm32f4discovery.h b/boards/addons/gdisp/board_HX8347D_stm32f4discovery.h index f704e67c..1dad31cc 100644 --- a/boards/addons/gdisp/board_HX8347D_stm32f4discovery.h +++ b/boards/addons/gdisp/board_HX8347D_stm32f4discovery.h @@ -112,7 +112,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { } } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; pwmEnableChannel(&PWMD4, 1, percent); } @@ -140,7 +140,7 @@ static GFXINLINE void busmode8(GDisplay *g) { spiStart(&SPID1, &spi1cfg_8bit); } -static GFXINLINE void write_index(GDisplay *g, uint8_t index) { +static GFXINLINE void write_index(GDisplay *g, gU8 index) { (void) g; CLR_DATA; SPI1->DR = index; @@ -148,13 +148,13 @@ static GFXINLINE void write_index(GDisplay *g, uint8_t index) { SET_DATA; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; SPI1->DR = data; while(((SPI1->SR & SPI_SR_TXE) == 0) || ((SPI1->SR & SPI_SR_BSY) != 0)); } -static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) { +static GFXINLINE void write_ram16(GDisplay *g, gU16 data) { (void) g; SPI1->DR = data; while((SPI1->SR & SPI_SR_TXE) == 0); diff --git a/boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h b/boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h index 349967ed..668ede33 100644 --- a/boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h +++ b/boards/addons/gdisp/board_ILI9320_olimex_pic32mx_lcd.h @@ -76,7 +76,7 @@ static noinline void setpin_reset(GDisplay *g, gBool state) { palSetPad(IOPORTA, 7); } -static void set_backlight(GDisplay *g, uint8_t percent) { +static void set_backlight(GDisplay *g, gU8 percent) { (void) g; if (percentage) palClearPad(IOPORTD, 3); @@ -92,8 +92,8 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static noinline void write_index(GDisplay *g, uint16_t index) { - volatile uint16_t dummy; +static noinline void write_index(GDisplay *g, gU16 index) { + volatile gU16 dummy; (void) g; PmpWaitBusy(); @@ -106,7 +106,7 @@ static noinline void write_index(GDisplay *g, uint16_t index) { (void)dummy; } -static noinline void write_data(GDisplay *g, uint16_t data) { +static noinline void write_data(GDisplay *g, gU16 data) { (void) g; PMDIN = data; PmpWaitBusy(); @@ -120,7 +120,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static noinline uint16_t read_data(GDisplay *g) { +static noinline gU16 read_data(GDisplay *g) { (void) g; PmpWaitBusy(); return PMDIN; diff --git a/boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h b/boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h index e9cdbfe9..7f5cb250 100644 --- a/boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h +++ b/boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h @@ -31,8 +31,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */ static GFXINLINE void init_board(GDisplay *g) { @@ -76,7 +76,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { palSetPad(GPIOE, GPIOE_TFT_RST); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void)percent; } @@ -89,12 +89,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -107,7 +107,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/boards/addons/gdisp/board_ILI9341_spi.h b/boards/addons/gdisp/board_ILI9341_spi.h index 18069772..5c90e9d7 100644 --- a/boards/addons/gdisp/board_ILI9341_spi.h +++ b/boards/addons/gdisp/board_ILI9341_spi.h @@ -43,7 +43,7 @@ static const SPIConfig spi2cfg = { (SPI_CR1_MSTR | SPI_CR1_SPE | SPI_CR1_SSM | SPI_CR1_SSI) }; -static void send_data(uint16_t data); +static void send_data(gU16 data); /** * @brief Initialise the board for the display. @@ -105,7 +105,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { * * @notapi */ -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -139,7 +139,7 @@ static GFXINLINE void release_bus(GDisplay *g) { * * @notapi */ -static GFXINLINE void send_data(uint16_t data) { +static GFXINLINE void send_data(gU16 data) { // http://forum.easyelectronics.ru/viewtopic.php?p=262122#p262122 while (!(SPI2->SR & SPI_SR_TXE)); // при входе на отправку проверяем - а пустой ли SPI_DR SPI2->DR = data; // загрузили в SPI_DR код команды @@ -154,7 +154,7 @@ static GFXINLINE void send_data(uint16_t data) { * * @notapi */ -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; while (SPI2->SR & SPI_SR_BSY); @@ -177,7 +177,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) { * * @notapi */ -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; send_data(data); @@ -213,7 +213,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { * * @notapi */ -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/boards/addons/gdisp/board_ILI9481_firebullstm32f103.h b/boards/addons/gdisp/board_ILI9481_firebullstm32f103.h index 752dd2b7..04b7e721 100644 --- a/boards/addons/gdisp/board_ILI9481_firebullstm32f103.h +++ b/boards/addons/gdisp/board_ILI9481_firebullstm32f103.h @@ -58,7 +58,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -71,13 +71,13 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; palWritePort(GPIOE, index); CLR_RS; CLR_WR; SET_WR; SET_RS; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; palWritePort(GPIOE, data); CLR_WR; SET_WR; @@ -95,8 +95,8 @@ static GFXINLINE void setwritemode(GDisplay *g) { palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL); } -static GFXINLINE uint16_t read_data(GDisplay *g) { - uint16_t value; +static GFXINLINE gU16 read_data(GDisplay *g) { + gU16 value; (void) g; CLR_RD; diff --git a/boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h b/boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h index f1099c9b..98d970cf 100644 --- a/boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h +++ b/boards/addons/gdisp/board_ILI9488_stm32f4cube_hal.h @@ -10,8 +10,8 @@ #include "stm32f4xx_hal.h" -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */ static GFXINLINE void init_board(GDisplay *g) { @@ -108,7 +108,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) } } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { (void) g; @@ -129,14 +129,14 @@ static GFXINLINE void release_bus(GDisplay* g) (void) g; } -static GFXINLINE void write_index(GDisplay* g, uint16_t index) +static GFXINLINE void write_index(GDisplay* g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay* g, uint16_t data) +static GFXINLINE void write_data(GDisplay* g, gU16 data) { (void) g; @@ -153,11 +153,11 @@ static GFXINLINE void setwritemode(GDisplay* g) (void) g; } -static GFXINLINE uint16_t read_data(GDisplay* g) +static GFXINLINE gU16 read_data(GDisplay* g) { (void) g; - return (uint16_t)GDISP_RAM; + return (gU16)GDISP_RAM; } #endif /* _GDISP_LLD_BOARD_H */ diff --git a/boards/addons/gdisp/board_S6D1121_olimex_e407.h b/boards/addons/gdisp/board_S6D1121_olimex_e407.h index 00d8cc42..4a823410 100644 --- a/boards/addons/gdisp/board_S6D1121_olimex_e407.h +++ b/boards/addons/gdisp/board_S6D1121_olimex_e407.h @@ -18,8 +18,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */ static GFXINLINE void init_board(GDisplay *g) { @@ -55,7 +55,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -68,12 +68,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -86,7 +86,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/boards/addons/gdisp/board_SPFD54124B_stm32f3.h b/boards/addons/gdisp/board_SPFD54124B_stm32f3.h index e7178699..50ca846a 100644 --- a/boards/addons/gdisp/board_SPFD54124B_stm32f3.h +++ b/boards/addons/gdisp/board_SPFD54124B_stm32f3.h @@ -37,7 +37,7 @@ #if USE_HARD_SPI #if GFX_USE_OS_CHIBIOS -static int32_t thdPriority = 0; +static gI32 thdPriority = 0; #endif /* @@ -58,9 +58,9 @@ static GFXINLINE void soft_spi_sck(void){ palClearPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_SCK); } -static GFXINLINE void soft_spi_write_9bit(uint16_t data){ +static GFXINLINE void soft_spi_write_9bit(gU16 data){ - uint8_t i; + gU8 i; // activate lcd by low on CS pin palClearPad(SPFD54124B_SPI_PORT, SPFD54124B_SPI_NSS); @@ -131,7 +131,7 @@ static GFXINLINE void acquire_bus(GDisplay *g) { (void) g; #if USE_HARD_SPI #if GFX_USE_OS_CHIBIOS - thdPriority = (int32_t)chThdGetPriority(); + thdPriority = (gI32)chThdGetPriority(); chThdSetPriority(HIGHPRIO); #endif spiAcquireBus(&SPFD54124B_SPID); @@ -148,10 +148,10 @@ static GFXINLINE void release_bus(GDisplay *g) { #endif } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; - uint16_t b; + gU16 b; #if USE_HARD_SPI @@ -176,7 +176,7 @@ static GFXINLINE void write_data(GDisplay *g, uint16_t data) { } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; #if USE_HARD_SPI @@ -195,7 +195,7 @@ static GFXINLINE void post_init_board(GDisplay *g) { (void) g; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } diff --git a/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h b/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h index a7e81032..ca1b1b2a 100644 --- a/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h +++ b/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h @@ -18,8 +18,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG ((volatile uint16_t *) 0x60000000)[0] /* RS = 0 */ -#define GDISP_RAM ((volatile uint16_t *) 0x60020000)[0] /* RS = 1 */ +#define GDISP_REG ((volatile gU16 *) 0x60000000)[0] /* RS = 0 */ +#define GDISP_RAM ((volatile gU16 *) 0x60020000)[0] /* RS = 1 */ #define GDISP_DMA_STREAM STM32_DMA2_STREAM6 #define FSMC_BANK 0 @@ -114,7 +114,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; pwmEnableChannel(&PWMD3, 2, percent); } @@ -127,12 +127,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -147,7 +147,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */ } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h b/boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h index c13878fc..ad57edea 100644 --- a/boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h +++ b/boards/addons/gdisp/board_SSD1306_chibios_16.1.3_stm32f4.h @@ -72,17 +72,17 @@ static GFXINLINE void release_bus(GDisplay* g) spiReleaseBus(SPI_DRIVER); } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) +static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd) { (void)g; - static uint8_t buf; + static gU8 buf; palClearPad(DC_PORT, DC_PAD); buf = cmd; spiSend(SPI_DRIVER, 1, &buf); } -static GFXINLINE void write_data(GDisplay* g, uint8_t* data, uint16_t length) +static GFXINLINE void write_data(GDisplay* g, gU8* data, gU16 length) { (void)g; diff --git a/boards/addons/gdisp/board_SSD1306_i2c.h b/boards/addons/gdisp/board_SSD1306_i2c.h index 0f9bbb14..bd96920c 100644 --- a/boards/addons/gdisp/board_SSD1306_i2c.h +++ b/boards/addons/gdisp/board_SSD1306_i2c.h @@ -46,7 +46,7 @@ static I2CConfig i2cconfig; #if GFX_USE_OS_CHIBIOS - static int32_t thdPriority = 0; + static gI32 thdPriority = 0; #endif static GFXINLINE void init_board(GDisplay *g) { @@ -93,7 +93,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { static GFXINLINE void acquire_bus(GDisplay *g) { (void) g; #if GFX_USE_OS_CHIBIOS - thdPriority = (int32_t)chThdGetPriority(); + thdPriority = (gI32)chThdGetPriority(); chThdSetPriority(HIGHPRIO); #endif i2cAcquireBus(&I2CD1); @@ -107,8 +107,8 @@ static GFXINLINE void release_bus(GDisplay *g) { i2cReleaseBus(&I2CD1); } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { - uint8_t command[2]; +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { + gU8 command[2]; (void) g; command[0] = 0x00; // Co = 0, D/C = 0 @@ -119,7 +119,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { i2cStop(&I2CD1); } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; i2cStart(&I2CD1, &i2cconfig); diff --git a/boards/addons/gdisp/board_SSD1963_fsmc.h b/boards/addons/gdisp/board_SSD1963_fsmc.h index 06fb2c9a..f8b279de 100644 --- a/boards/addons/gdisp/board_SSD1963_fsmc.h +++ b/boards/addons/gdisp/board_SSD1963_fsmc.h @@ -32,8 +32,8 @@ static const LCD_Parameters DisplayTimings[] = { // set g->board to that structure. /* Using FSMC A16 as RS */ -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */ static GFXINLINE void init_board(GDisplay *g) { @@ -94,12 +94,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } diff --git a/boards/addons/gdisp/board_SSD1963_gpio.h b/boards/addons/gdisp/board_SSD1963_gpio.h index 20e5787e..ed9caf4d 100644 --- a/boards/addons/gdisp/board_SSD1963_gpio.h +++ b/boards/addons/gdisp/board_SSD1963_gpio.h @@ -87,14 +87,14 @@ static GFXINLINE void release_bus(GDisplay *g) { Clr_CS; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; Set_RS; Clr_RD; Set_WR; palWritePort(GDISP_DATA_PORT, index); Clr_WR; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; Clr_RS; Clr_RD; Set_WR; palWritePort(GDISP_DATA_PORT, data); diff --git a/boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h b/boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h index 7a4fb8ce..b95efc03 100644 --- a/boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h +++ b/boards/addons/gdisp/board_UC8173_nordic_nrf52_sdk11.h @@ -94,7 +94,7 @@ static GFXINLINE void release_bus(GDisplay* g) nrf_gpio_pin_set(PIN_CS); } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) +static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd) { (void)g; @@ -102,7 +102,7 @@ static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) nrf_drv_spi_transfer(&spi, &cmd, 1, 0, 0); } -static GFXINLINE void write_data(GDisplay* g, uint8_t data) +static GFXINLINE void write_data(GDisplay* g, gU8 data) { (void)g; @@ -110,7 +110,7 @@ static GFXINLINE void write_data(GDisplay* g, uint8_t data) nrf_drv_spi_transfer(&spi, &data, 1, 0, 0); } -static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, uint8_t length) +static GFXINLINE void write_data_burst(GDisplay* g, gU8* data, gU8 length) { (void)g; diff --git a/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h b/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h index d641f56c..0013c9c6 100644 --- a/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h +++ b/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_olimex_stm32_e407.h @@ -66,14 +66,14 @@ static GFXINLINE void release_bus(GMouse* m) { //TOUCHSCREEN_SPI_EPILOGUE(); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; (void) m; txbuf[0] = port; spiExchange(&SPID2, 3, txbuf, rxbuf); - return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3); + return ((gU16)rxbuf[1] << 5) | (rxbuf[2] >> 3); } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h b/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h index a11bc979..7b561c2b 100644 --- a/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h +++ b/boards/addons/ginput/touch/ADS7843/ginput_lld_mouse_board_st_stm32f4_discovery.h @@ -80,15 +80,15 @@ static GFXINLINE void release_bus(GMouse* m) { spiReleaseBus(&SPID2); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; (void) m; txbuf[0] = port; spiExchange(&SPID2, 3, txbuf, rxbuf); - return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3); + return ((gU16)rxbuf[1] << 5) | (rxbuf[2] >> 3); } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h b/boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h index e34dee84..c855c7d8 100644 --- a/boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h +++ b/boards/addons/ginput/touch/ADS7843/stm32f4cube_hal.h @@ -123,11 +123,11 @@ static GFXINLINE void release_bus(GMouse* m) HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t reg) +static GFXINLINE gU16 read_value(GMouse* m, gU16 reg) { - uint8_t txbuf[3] = {0, 0, 0}; - uint8_t rxbuf[3] = {0, 0, 0}; - uint16_t ret; + gU8 txbuf[3] = {0, 0, 0}; + gU8 rxbuf[3] = {0, 0, 0}; + gU16 ret; (void)m; diff --git a/boards/base/Altera-MAX10-Neek/board_alteraframereader.h b/boards/base/Altera-MAX10-Neek/board_alteraframereader.h index 3628b27b..86dc3c92 100644 --- a/boards/base/Altera-MAX10-Neek/board_alteraframereader.h +++ b/boards/base/Altera-MAX10-Neek/board_alteraframereader.h @@ -10,13 +10,13 @@ #define FRAMEREADER_BASE ALT_VIP_VFR_0_BASE #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay* g, uint8_t percent) + static void board_backlight(GDisplay* g, gU8 percent) { (void) g; (void) percent; } - static void board_contrast(GDisplay* g, uint8_t percent) + static void board_contrast(GDisplay* g, gU8 percent) { (void) g; (void) percent; diff --git a/boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h b/boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h index dd93cf7a..c7c84787 100644 --- a/boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h +++ b/boards/base/Altera-MAX10-Neek/gmouse_lld_FT5316_board.h @@ -76,29 +76,29 @@ static gBool init_board(GMouse* m, unsigned instance) return gTrue; } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { (void)m; device_write(FT5316_I2C_SLAVE_ADDRESS, reg, val); } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { (void)m; - uint8_t ret = 0; + gU8 ret = 0; - ret = (uint8_t)device_read(FT5316_I2C_SLAVE_ADDRESS, reg); + ret = (gU8)device_read(FT5316_I2C_SLAVE_ADDRESS, reg); return ret; } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { (void)m; - uint16_t ret = 0; + gU16 ret = 0; - ret = (uint16_t)device_read(FT5316_I2C_SLAVE_ADDRESS, reg); + ret = (gU16)device_read(FT5316_I2C_SLAVE_ADDRESS, reg); return ret; } diff --git a/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.cpp b/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.cpp index 5065c34d..6bbee453 100644 --- a/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.cpp +++ b/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.cpp @@ -26,9 +26,9 @@ // Wire address of the SX1505 chip #define GPIO_ADDR 0x20 -static void writeGPIO(uint8_t regAddr, uint8_t regData) +static void writeGPIO(gU8 regAddr, gU8 regData) { - uint8_t oldTWBR=TWBR; + gU8 oldTWBR=TWBR; TWBR=0; Wire.beginTransmission(GPIO_ADDR + LCD_BOARD_ID); Wire.write(regAddr); @@ -69,7 +69,7 @@ void SSD1331_releasebus(void) { isDataMode = isCmdMode = false; } -void SSD1331_write_cmd(uint8_t cmd) { +void SSD1331_write_cmd(gU8 cmd) { if (!isCmdMode) { writeGPIO(GPIO_RegData,GPIO_CMD_START); isDataMode = false; @@ -78,7 +78,7 @@ void SSD1331_write_cmd(uint8_t cmd) { SPI.transfer(cmd); } -void SSD1331_write_data(uint8_t data) { +void SSD1331_write_data(gU8 data) { if (!isDataMode) { writeGPIO(GPIO_RegData,GPIO_DATA_START); isDataMode = true; diff --git a/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h b/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h index c386416d..7a814fa4 100644 --- a/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h +++ b/boards/base/ArduinoTinyScreen/gfx/board_SSD1331.h @@ -25,8 +25,8 @@ void SSD1331_init_board(void); void SSD1331_setpin_reset(int state); void SSD1331_aquirebus(void); void SSD1331_releasebus(void); -void SSD1331_write_cmd(uint8_t cmd); -void SSD1331_write_data(uint8_t data); +void SSD1331_write_cmd(gU8 cmd); +void SSD1331_write_data(gU8 data); #ifdef __cplusplus } diff --git a/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h b/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h index b0c8bbb0..0fb14ce7 100644 --- a/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h +++ b/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h @@ -12,8 +12,8 @@ // set g->board to that structure. /* Using FSMC A19 (PE3) as DC */ -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* DC = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* DC = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* DC = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60100000)) /* DC = 1 */ #define GDISP_DMA_STREAM STM32_DMA2_STREAM6 #define SET_RST palSetPad(GPIOD, 3); @@ -108,7 +108,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { } } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; pwmEnableChannel(&PWMD4, 1, percent); } @@ -121,12 +121,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -139,7 +139,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h b/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h index da30c4a7..ceb4187e 100644 --- a/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h +++ b/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h @@ -77,8 +77,8 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { - uint8_t txbuf[2]; +static void write_reg(GMouse* m, gU8 reg, gU8 val) { + gU8 txbuf[2]; (void) m; txbuf[0] = reg; @@ -89,8 +89,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { i2cReleaseBus(&I2CD1); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { - uint8_t rxbuf[1]; +static gU8 read_byte(GMouse* m, gU8 reg) { + gU8 rxbuf[1]; (void) m; rxbuf[0] = 0; @@ -102,8 +102,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) { return rxbuf[0]; } -static uint16_t read_word(GMouse* m, uint8_t reg) { - uint8_t rxbuf[2]; +static gU16 read_word(GMouse* m, gU8 reg) { + gU8 rxbuf[2]; (void) m; rxbuf[0] = 0; @@ -113,7 +113,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) { i2cMasterTransmitTimeout(&I2CD1, STMPE811_ADDR, ®, 1, rxbuf, 2, MS2ST(STMPE811_TIMEOUT)); i2cReleaseBus(&I2CD1); - return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1]; + return (((gU16)rxbuf[0]) << 8) | rxbuf[1]; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/base/FireBull-STM32F103-FB/board_SSD1289.h b/boards/base/FireBull-STM32F103-FB/board_SSD1289.h index 7bfdd3dd..50019e62 100644 --- a/boards/base/FireBull-STM32F103-FB/board_SSD1289.h +++ b/boards/base/FireBull-STM32F103-FB/board_SSD1289.h @@ -56,7 +56,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) /* Nothing to do here - reset pin tied to Vcc */ } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -74,7 +74,7 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; @@ -85,7 +85,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) SET_RS; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; @@ -112,7 +112,7 @@ static GFXINLINE void setwritemode(GDisplay *g) palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL); } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return palReadPort(GPIOE); diff --git a/boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h b/boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h index fda0fee9..bba256d4 100644 --- a/boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h +++ b/boards/base/FireBull-STM32F103-FB/gmouse_lld_ADS7843_board.h @@ -66,11 +66,11 @@ static GFXINLINE void release_bus(GMouse* m) spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; (void) m; txbuf[0] = port; diff --git a/boards/base/HY-MiniSTM32V/board_SSD1289.h b/boards/base/HY-MiniSTM32V/board_SSD1289.h index 950a6f12..5eb7a7d4 100644 --- a/boards/base/HY-MiniSTM32V/board_SSD1289.h +++ b/boards/base/HY-MiniSTM32V/board_SSD1289.h @@ -40,8 +40,8 @@ static const PWMConfig pwmcfg = /* * LCD_RS is on A16 (PD11) */ -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60020000)) /* RS = 1 */ /* * STM32_DMA1_STREAM7 * NOTE: conflicts w/ USART2_TX, TIM2_CH2, TIM2_CH4, TIM4_UP, I2C1_RX in case @@ -131,7 +131,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { else {} } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; if (percent > 100) { percent = 100; } pwmEnableChannel(&PWMD3, 1, percent); @@ -145,12 +145,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -163,7 +163,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h b/boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h index 8e3a81c2..ca824f6c 100644 --- a/boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h +++ b/boards/base/HY-MiniSTM32V/gmouse_lld_ADS7843_board.h @@ -83,11 +83,11 @@ static GFXINLINE void release_bus(GMouse* m) { spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { (void)m; - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; txbuf[0] = port; spiExchange(&SPID1, 3, txbuf, rxbuf); diff --git a/boards/base/Linux-Framebuffer/board_framebuffer.h b/boards/base/Linux-Framebuffer/board_framebuffer.h index 19f182f4..fa631dbc 100644 --- a/boards/base/Linux-Framebuffer/board_framebuffer.h +++ b/boards/base/Linux-Framebuffer/board_framebuffer.h @@ -203,12 +203,12 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { (void) g; (void) percent; } diff --git a/boards/base/Marlin/board_RA8875.h b/boards/base/Marlin/board_RA8875.h index 46e749cb..76b61c4c 100644 --- a/boards/base/Marlin/board_RA8875.h +++ b/boards/base/Marlin/board_RA8875.h @@ -15,8 +15,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_RAM (*((volatile uint16_t *) 0x68000000)) /* RS = 0 */ -#define GDISP_REG (*((volatile uint16_t *) 0x68020000)) /* RS = 1 */ +#define GDISP_RAM (*((volatile gU16 *) 0x68000000)) /* RS = 0 */ +#define GDISP_REG (*((volatile gU16 *) 0x68020000)) /* RS = 1 */ #define FSMC_BANK 4 @@ -83,13 +83,13 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; @@ -103,7 +103,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; diff --git a/boards/base/Marlin/gmouse_lld_FT5x06_board.h b/boards/base/Marlin/gmouse_lld_FT5x06_board.h index fbcaea3d..6afaa063 100644 --- a/boards/base/Marlin/gmouse_lld_FT5x06_board.h +++ b/boards/base/Marlin/gmouse_lld_FT5x06_board.h @@ -51,8 +51,8 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { - uint8_t txbuf[2]; +static void write_reg(GMouse* m, gU8 reg, gU8 val) { + gU8 txbuf[2]; (void) m; txbuf[0] = reg; @@ -63,8 +63,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { i2cReleaseBus(&I2CD2); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { - uint8_t rxbuf[1]; +static gU8 read_byte(GMouse* m, gU8 reg) { + gU8 rxbuf[1]; (void) m; rxbuf[0] = 0; @@ -76,8 +76,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) { return rxbuf[0]; } -static uint16_t read_word(GMouse* m, uint8_t reg) { - uint8_t rxbuf[2]; +static gU16 read_word(GMouse* m, gU8 reg) { + gU8 rxbuf[2]; (void) m; rxbuf[0] = 0; @@ -87,7 +87,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) { i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, ®, 1, rxbuf, 2, MS2ST(FT5x06_TIMEOUT)); i2cReleaseBus(&I2CD2); - return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1]; + return (((gU16)rxbuf[0]) << 8) | rxbuf[1]; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c index ccd3ab9f..56a1b99a 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c +++ b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c @@ -19,10 +19,10 @@ static const SPIConfig flash_spicfg = { }; bool flash_is_write_busy(void) { - static uint8_t is_write_busy_cmd[1]; + static gU8 is_write_busy_cmd[1]; is_write_busy_cmd[0] = _SERIAL_FLASH_CMD_RDSR; - uint8_t result[1]; + gU8 result[1]; spiAcquireBus(&SPID3); spiStart(&SPID3, &flash_spicfg); @@ -44,9 +44,9 @@ void flash_write_enable(void) { spiReleaseBus(&SPID3); } -void flash_sector_erase(uint32_t sector) { +void flash_sector_erase(gU32 sector) { flash_write_enable(); - static uint8_t sector_erase_cmd[4]; + static gU8 sector_erase_cmd[4]; sector_erase_cmd[0] = _SERIAL_FLASH_CMD_SER; sector_erase_cmd[1] = (sector >> 16) & 0xFF; sector_erase_cmd[2] = (sector >> 8) & 0xFF; @@ -64,8 +64,8 @@ void flash_sector_erase(uint32_t sector) { while(flash_is_write_busy()); } -void flash_read(uint32_t address, size_t bytes, uint8_t *out) { - static uint8_t sector_read_cmd[4]; +void flash_read(gU32 address, gMemSize bytes, gU8 *out) { + static gU8 sector_read_cmd[4]; sector_read_cmd[0] = _SERIAL_FLASH_CMD_READ; sector_read_cmd[1] = (address >> 16) & 0xFF; sector_read_cmd[2] = (address >> 8) & 0xFF; @@ -80,8 +80,8 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) { spiReleaseBus(&SPID3); } -void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { - static uint8_t flash_write_cmd[4]; +void flash_write(gU32 address, gMemSize bytes, const gU8 *data) { + static gU8 flash_write_cmd[4]; flash_write_enable(); @@ -103,21 +103,21 @@ void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { } bool flash_tp_calibrated(void) { - uint8_t out[1]; + gU8 out[1]; flash_read(0x0F0000, 1, out); return (out[0] == 0x01); } -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) { +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz) { if (instance) return; flash_sector_erase(0x0F0000); - uint8_t calibrated = 0x01; + gU8 calibrated = 0x01; flash_write(0x0F0000, 1, &calibrated); flash_write(0x0F0001, sz, calbuf); } -const char *flash_tp_calibration_load(uint16_t instance) { - static uint8_t foo[24]; +const char *flash_tp_calibration_load(gU16 instance) { + static gU8 foo[24]; if (instance) return 0; if (!flash_tp_calibrated()) return 0; diff --git a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h index 2dcc9206..8dfdbb20 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h @@ -1,6 +1,6 @@ -void flash_sector_erase(uint32_t sector); -void flash_read(uint32_t address, size_t bytes, uint8_t *out); -void flash_write(uint32_t address, size_t bytes, const uint8_t *data); +void flash_sector_erase(gU32 sector); +void flash_read(gU32 address, gMemSize bytes, gU8 *out); +void flash_write(gU32 address, gMemSize bytes, const gU8 *data); bool flash_tp_calibrated(void); -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz); -const char *flash_tp_calibration_load(uint16_t instance); +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz); +const char *flash_tp_calibration_load(gU16 instance); diff --git a/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h b/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h index 456986d6..7dc34449 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h @@ -87,7 +87,7 @@ static GFXINLINE void release_bus(GDisplay *g) { SET_CS; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; CLR_DC; @@ -97,7 +97,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) { SET_DC; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; palWriteBus(&busDataLo, (data & 0xFF)); @@ -117,8 +117,8 @@ static GFXINLINE void setwritemode(GDisplay *g) { palSetBusMode(&busDataHi, PAL_MODE_OUTPUT_PUSHPULL); } -static GFXINLINE uint16_t read_data(GDisplay *g) { - uint16_t data; +static GFXINLINE gU16 read_data(GDisplay *g) { + gU16 data; (void) g; CLR_RD; diff --git a/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h b/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h index 5df2d5cd..d94e97a3 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h @@ -77,8 +77,8 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { - uint8_t txbuf[2]; +static void write_reg(GMouse* m, gU8 reg, gU8 val) { + gU8 txbuf[2]; (void) m; txbuf[0] = reg; @@ -89,8 +89,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { i2cReleaseBus(&I2CD1); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { - uint8_t rxbuf[1]; +static gU8 read_byte(GMouse* m, gU8 reg) { + gU8 rxbuf[1]; (void) m; rxbuf[0] = 0; @@ -102,8 +102,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) { return rxbuf[0]; } -static uint16_t read_word(GMouse* m, uint8_t reg) { - uint8_t rxbuf[2]; +static gU16 read_word(GMouse* m, gU8 reg) { + gU8 rxbuf[2]; (void) m; rxbuf[0] = 0; @@ -113,7 +113,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) { i2cMasterTransmitTimeout(&I2CD1, STMPE610_ADDR, ®, 1, rxbuf, 2, MS2ST(STMPE610_TIMEOUT)); i2cReleaseBus(&I2CD1); - return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1]; + return (((gU16)rxbuf[0]) << 8) | rxbuf[1]; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c index ccd3ab9f..56a1b99a 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c @@ -19,10 +19,10 @@ static const SPIConfig flash_spicfg = { }; bool flash_is_write_busy(void) { - static uint8_t is_write_busy_cmd[1]; + static gU8 is_write_busy_cmd[1]; is_write_busy_cmd[0] = _SERIAL_FLASH_CMD_RDSR; - uint8_t result[1]; + gU8 result[1]; spiAcquireBus(&SPID3); spiStart(&SPID3, &flash_spicfg); @@ -44,9 +44,9 @@ void flash_write_enable(void) { spiReleaseBus(&SPID3); } -void flash_sector_erase(uint32_t sector) { +void flash_sector_erase(gU32 sector) { flash_write_enable(); - static uint8_t sector_erase_cmd[4]; + static gU8 sector_erase_cmd[4]; sector_erase_cmd[0] = _SERIAL_FLASH_CMD_SER; sector_erase_cmd[1] = (sector >> 16) & 0xFF; sector_erase_cmd[2] = (sector >> 8) & 0xFF; @@ -64,8 +64,8 @@ void flash_sector_erase(uint32_t sector) { while(flash_is_write_busy()); } -void flash_read(uint32_t address, size_t bytes, uint8_t *out) { - static uint8_t sector_read_cmd[4]; +void flash_read(gU32 address, gMemSize bytes, gU8 *out) { + static gU8 sector_read_cmd[4]; sector_read_cmd[0] = _SERIAL_FLASH_CMD_READ; sector_read_cmd[1] = (address >> 16) & 0xFF; sector_read_cmd[2] = (address >> 8) & 0xFF; @@ -80,8 +80,8 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) { spiReleaseBus(&SPID3); } -void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { - static uint8_t flash_write_cmd[4]; +void flash_write(gU32 address, gMemSize bytes, const gU8 *data) { + static gU8 flash_write_cmd[4]; flash_write_enable(); @@ -103,21 +103,21 @@ void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { } bool flash_tp_calibrated(void) { - uint8_t out[1]; + gU8 out[1]; flash_read(0x0F0000, 1, out); return (out[0] == 0x01); } -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) { +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz) { if (instance) return; flash_sector_erase(0x0F0000); - uint8_t calibrated = 0x01; + gU8 calibrated = 0x01; flash_write(0x0F0000, 1, &calibrated); flash_write(0x0F0001, sz, calbuf); } -const char *flash_tp_calibration_load(uint16_t instance) { - static uint8_t foo[24]; +const char *flash_tp_calibration_load(gU16 instance) { + static gU8 foo[24]; if (instance) return 0; if (!flash_tp_calibrated()) return 0; diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h index 2dcc9206..8dfdbb20 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h @@ -1,6 +1,6 @@ -void flash_sector_erase(uint32_t sector); -void flash_read(uint32_t address, size_t bytes, uint8_t *out); -void flash_write(uint32_t address, size_t bytes, const uint8_t *data); +void flash_sector_erase(gU32 sector); +void flash_read(gU32 address, gMemSize bytes, gU8 *out); +void flash_write(gU32 address, gMemSize bytes, const gU8 *data); bool flash_tp_calibrated(void); -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz); -const char *flash_tp_calibration_load(uint16_t instance); +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz); +const char *flash_tp_calibration_load(gU16 instance); diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h b/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h index 93bdd982..2fb1940d 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h @@ -49,7 +49,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { } } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; // TODO: can probably pwm this if(percent) { @@ -76,19 +76,19 @@ static GFXINLINE void release_bus(GDisplay *g) { * * @notapi */ -static GFXINLINE void ili9341_delay(uint16_t dly) { - static uint16_t i; +static GFXINLINE void ili9341_delay(gU16 dly) { + static gU16 i; for(i = 0; i < dly; i++) asm("nop"); } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; palWriteGroup(GPIOE, 0x00FF, 0, index); CLR_RS; CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1); SET_RS; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; palWriteGroup(GPIOE, 0x00FF, 0, data); CLR_WR; ili9341_delay(1); SET_WR; ili9341_delay(1); @@ -106,8 +106,8 @@ static GFXINLINE void setwritemode(GDisplay *g) { palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL); } -static GFXINLINE uint16_t read_data(GDisplay *g) { - uint16_t value; +static GFXINLINE gU16 read_data(GDisplay *g) { + gU16 value; (void) g; CLR_RD; value = palReadPort(GPIOE); diff --git a/boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h b/boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h index 1feb5248..8d1d7ebc 100644 --- a/boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h +++ b/boards/base/Olimex-SAM7EX256-GE12/board_Nokia6610GE12.h @@ -141,7 +141,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { palSetPad(IOPORT1, PIOA_LCD_RESET); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; if (percent == 100) { /* Turn the pin on - No PWM */ @@ -175,7 +175,7 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; // wait for the previous transfer to complete while(!(pSPI->SPI_SR & AT91C_SPI_TDRE)); @@ -183,7 +183,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) { pSPI->SPI_TDR = index & 0xFF; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; // wait for the previous transfer to complete while(!(pSPI->SPI_SR & AT91C_SPI_TDRE)); diff --git a/boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h b/boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h index 9683144a..3e8e5c39 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h +++ b/boards/base/Olimex-SAM7EX256-GE8/board_Nokia6610GE8.h @@ -139,7 +139,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { palSetPad(IOPORT1, PIOA_LCD_RESET); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; if (percent == 100) { /* Turn the pin on - No PWM */ @@ -173,7 +173,7 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; // wait for the previous transfer to start while(!(pSPI->SPI_SR & AT91C_SPI_TDRE)); @@ -181,7 +181,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) { pSPI->SPI_TDR = index & 0xFF; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; // wait for the previous transfer to start while(!(pSPI->SPI_SR & AT91C_SPI_TDRE)); diff --git a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h index 9e1037b6..b5b2aa86 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h +++ b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_i2c.h @@ -81,7 +81,7 @@ #define I2C_WAITCOMPLETE() #define I2C_WRITECMDBYTE(cmd) { \ - uint8_t data[2]; \ + gU8 data[2]; \ data[0] = 0; \ data[1] = cmd; \ i2cMasterTransmitTimeout (UEXT_I2C, I2C_ADDRESS, data, 2, 0, 0, gDelayForever); \ @@ -107,7 +107,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -125,7 +125,7 @@ static GFXINLINE void release_bus(GDisplay *g) { I2C_RELEASEBUS(); } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; I2C_WAITCOMPLETE(); @@ -134,7 +134,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { I2C_WRITECMDBYTE(cmd); } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; I2C_WAITCOMPLETE(); diff --git a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h index 58b922cd..070906a8 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h +++ b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1306_spi.h @@ -63,8 +63,8 @@ static void spi_delay(volatile unsigned long a) { while (a!=0) a--; } - static void spi_write(uint8_t data) { - uint8_t bit; + static void spi_write(gU8 data) { + gU8 bit; for(bit = 0x80; bit; bit >>= 1) { if(data & bit) @@ -185,7 +185,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { PinSet(PORT_RESET, PIN_RESET); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -203,7 +203,7 @@ static GFXINLINE void release_bus(GDisplay *g) { SPI_RELEASEBUS(); } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; // Command mode please @@ -213,7 +213,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { SPI_WRITEBYTE(cmd); } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; // Data mode please diff --git a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h index b4cda276..7e066ec0 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h +++ b/boards/base/Olimex-SAM7EX256-GE8/board_SSD1331.h @@ -63,8 +63,8 @@ static void spi_delay(volatile unsigned long a) { while (a!=0) a--; } - static void spi_write(uint8_t data) { - uint8_t bit; + static void spi_write(gU8 data) { + gU8 bit; for(bit = 0x80; bit; bit >>= 1) { if(data & bit) @@ -182,7 +182,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { PinSet(PORT_RESET, PIN_RESET); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -200,7 +200,7 @@ static GFXINLINE void release_bus(GDisplay *g) { SPI_RELEASEBUS(); } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; // Command mode please @@ -210,7 +210,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { SPI_WRITEBYTE(cmd); } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; // Data mode please diff --git a/boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h b/boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h index dd51bfe2..e8b3c214 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h +++ b/boards/base/Olimex-SAM7EX256-GE8/board_TLS8204.h @@ -49,8 +49,8 @@ static void spi_delay(volatile unsigned long a) { while (a!=0) a--; } - static void spi_write(uint8_t data) { - uint8_t bit; + static void spi_write(gU8 data) { + gU8 bit; for(bit = 0x80; bit; bit >>= 1) { if(data & bit) @@ -171,7 +171,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { PinSet(PORT_RESET, PIN_RESET); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -189,7 +189,7 @@ static GFXINLINE void release_bus(GDisplay *g) { SPI_RELEASEBUS(); } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; // Command mode please @@ -199,7 +199,7 @@ static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { SPI_WRITEBYTE(cmd); } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; // Data mode please diff --git a/boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h b/boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h index dd80dcd3..a1abf2a0 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h +++ b/boards/base/Olimex-SAM7EX256-GE8/gaudio_play_board.h @@ -33,9 +33,9 @@ static GPTConfig gptcfg = { GPT_TRIGGER_NONE, // trigger }; -static uint16_t lastvalue; +static gU16 lastvalue; -static gBool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) { +static gBool gaudio_play_pwm_setup(gU32 frequency, ArrayDataFormat format) { if (format == ARRAY_DATA_10BITUNSIGNED) pwmcfg.period = 1024; else if (format == ARRAY_DATA_8BITUNSIGNED) @@ -65,7 +65,7 @@ static void gaudio_play_pwm_stop(void) { pwmStop(&PWMD1); } -static void gaudio_play_pwm_setI(uint16_t value) { +static void gaudio_play_pwm_setI(gU16 value) { if (value != lastvalue) { lastvalue = value; pwmEnableChannelI(&PWMD1, 0, value); diff --git a/boards/base/Olimex-SAM7EX256-GE8/gaudio_record_board.h b/boards/base/Olimex-SAM7EX256-GE8/gaudio_record_board.h index a4698275..8d3a8d80 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/gaudio_record_board.h +++ b/boards/base/Olimex-SAM7EX256-GE8/gaudio_record_board.h @@ -30,7 +30,7 @@ #define GAUDIO_RECORD_MICROPHONE 0 #ifdef GAUDIO_RECORD_IMPLEMENTATION - static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { + static gU32 gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { GADC_PHYSDEV_MICROPHONE, }; #endif diff --git a/boards/base/Olimex-STM32-LCD/board_ILI9320.h b/boards/base/Olimex-STM32-LCD/board_ILI9320.h index d0cb82d0..d22d9c82 100644 --- a/boards/base/Olimex-STM32-LCD/board_ILI9320.h +++ b/boards/base/Olimex-STM32-LCD/board_ILI9320.h @@ -10,8 +10,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */ +#define GDISP_REG (*((volatile gU16 *) 0x60000000)) /* RS = 0 */ +#define GDISP_RAM (*((volatile gU16 *) 0x60100000)) /* RS = 1 */ static GFXINLINE void init_board(GDisplay *g) { @@ -54,7 +54,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { palSetPad(GPIOE, GPIOE_TFT_RST); } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; if(percent) @@ -71,13 +71,13 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; @@ -91,7 +91,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; diff --git a/boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h b/boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h index c5e35346..67086233 100644 --- a/boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h +++ b/boards/base/Olimex-STM32-LCD/gmouse_lld_MCU_board.h @@ -75,7 +75,7 @@ static gBool init_board(GMouse *m, unsigned driverinstance) { static gBool read_xyz(GMouse *m, GMouseReading *prd) { adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH]; - uint16_t val1, val2; + gU16 val1, val2; (void) m; // No buttons and assume touch off diff --git a/boards/base/RaspberryPi/FreeRTOS/mmio.h b/boards/base/RaspberryPi/FreeRTOS/mmio.h index 1a7fb5c2..8bf3a363 100644 --- a/boards/base/RaspberryPi/FreeRTOS/mmio.h +++ b/boards/base/RaspberryPi/FreeRTOS/mmio.h @@ -6,16 +6,16 @@ #include // write to MMIO register -static GFXINLINE void mmio_write(uint32_t reg, uint32_t data) { - uint32_t *ptr = (uint32_t*)reg; +static GFXINLINE void mmio_write(gU32 reg, gU32 data) { + gU32 *ptr = (gU32*)reg; asm volatile("str %[data], [%[reg]]" : : [reg]"r"(ptr), [data]"r"(data)); } // read from MMIO register -static GFXINLINE uint32_t mmio_read(uint32_t reg) { - uint32_t *ptr = (uint32_t*)reg; - uint32_t data; +static GFXINLINE gU32 mmio_read(gU32 reg) { + gU32 *ptr = (gU32*)reg; + gU32 data; asm volatile("ldr %[data], [%[reg]]" : [data]"=r"(data) : [reg]"r"(ptr)); return data; diff --git a/boards/base/RaspberryPi/FreeRTOS/uart.c b/boards/base/RaspberryPi/FreeRTOS/uart.c index 92f837e7..ef040fca 100644 --- a/boards/base/RaspberryPi/FreeRTOS/uart.c +++ b/boards/base/RaspberryPi/FreeRTOS/uart.c @@ -46,12 +46,12 @@ enum { /* * delay function - * int32_t delay: number of cycles to delay + * gI32 delay: number of cycles to delay * * This just loops times in a way that the compiler * wont optimize away. */ -static void delay(int32_t count) { +static void delay(gI32 count) { asm volatile("__delay_%=: subs %[count], %[count], #1; bne __delay_%=\n" : : [count]"r"(count) : "cc"); } @@ -102,9 +102,9 @@ void uart_init() { /* * Transmit a byte via UART0. - * uint8_t Byte: byte to send. + * gU8 Byte: byte to send. */ -void uart_putc(uint8_t byte) { +void uart_putc(gU8 byte) { // wait for UART to become ready to transmit while (1) { if (!(mmio_read(UART0_FR) & (1 << 5))) { diff --git a/boards/base/RaspberryPi/FreeRTOS/uart.h b/boards/base/RaspberryPi/FreeRTOS/uart.h index fe7f64aa..ca9f377e 100644 --- a/boards/base/RaspberryPi/FreeRTOS/uart.h +++ b/boards/base/RaspberryPi/FreeRTOS/uart.h @@ -12,9 +12,9 @@ void uart_init(); /* * Transmit a byte via UART0. - * uint8_t Byte: byte to send. + * gU8 Byte: byte to send. */ -void uart_putc(uint8_t byte); +void uart_putc(gU8 byte); /* * print a string to the UART one character at a time diff --git a/boards/base/RaspberryPi/board_framebuffer.h b/boards/base/RaspberryPi/board_framebuffer.h index 9a7d233b..0ca40a52 100644 --- a/boards/base/RaspberryPi/board_framebuffer.h +++ b/boards/base/RaspberryPi/board_framebuffer.h @@ -26,16 +26,16 @@ #include "rpi_mailbox.h" typedef struct FrameBufferDescription { - uint32_t width; - uint32_t height; - uint32_t vWidth; - uint32_t vHeight; - uint32_t pitch; - uint32_t bitDepth; - uint32_t x; - uint32_t y; + gU32 width; + gU32 height; + gU32 vWidth; + gU32 vHeight; + gU32 pitch; + gU32 bitDepth; + gU32 x; + gU32 y; void * pointer; - uint32_t size; + gU32 size; } FrameBufferDescription; static FrameBufferDescription FrameBufferInfo __attribute__((aligned (16))) = { 1024, 768, 1024, 768, 0, 24, 0, 0, 0, 0 }; @@ -49,7 +49,7 @@ FrameBufferInfo.vHeight = GDISP_SCREEN_HEIGHT; FrameBufferInfo.bitDepth = LLDCOLOR_BITS; - rpi_writemailbox(1, 0x40000000 + (uint32_t) &FrameBufferInfo); + rpi_writemailbox(1, 0x40000000 + (gU32) &FrameBufferInfo); if (rpi_readmailbox(1) != 0) gfxHalt("Could not set display parameters") @@ -70,12 +70,12 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { (void) g; (void) percent; } diff --git a/boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h b/boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h index a135ec6b..20f028f9 100644 --- a/boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h +++ b/boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h @@ -82,8 +82,8 @@ static void release_bus(GDisplay *g) { spiUnselect(SPI_PORT); } -static void write_index(GDisplay *g, uint8_t index) { - static uint8_t sindex; +static void write_index(GDisplay *g, gU8 index) { + static gU8 sindex; (void) g; palClearPad(DC_PORT, DC_PIN); @@ -91,8 +91,8 @@ static void write_index(GDisplay *g, uint8_t index) { spiSend(SPI_PORT, 1, &sindex); } -static void write_data(GDisplay *g, uint8_t data) { - static uint8_t sdata; +static void write_data(GDisplay *g, gU8 data) { + static gU8 sdata; (void) g; palSetPad(DC_PORT, DC_PIN); @@ -108,7 +108,7 @@ static void Init9341(GDisplay *g) { #define REG_COMMAND 0x0100 #define REG_DELAY 0x0200 - static const uint16_t initdata[] = { + static const gU16 initdata[] = { REG_COMMAND | ILI9341_CMD_RESET, REG_DELAY | 5, REG_COMMAND | ILI9341_CMD_DISPLAY_OFF, @@ -152,7 +152,7 @@ static void Init9341(GDisplay *g) { REG_COMMAND | ILI9341_SET_MEM }; - const uint16_t *p; + const gU16 *p; acquire_bus(g); for(p = initdata; p < &initdata[sizeof(initdata)/sizeof(initdata[0])]; p++) { @@ -206,7 +206,7 @@ static GFXINLINE void post_init_board(GDisplay *g) { (void) g; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } diff --git a/boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h b/boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h index 604c3ead..47b5d1ba 100644 --- a/boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h +++ b/boards/base/STM32F429i-Discovery/chibios/gmouse_lld_STMPE811_board.h @@ -84,8 +84,8 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { - uint8_t txbuf[2]; +static void write_reg(GMouse* m, gU8 reg, gU8 val) { + gU8 txbuf[2]; (void) m; txbuf[0] = reg; @@ -96,8 +96,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { i2cReleaseBus(&I2CD3); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { - uint8_t rxbuf[1]; +static gU8 read_byte(GMouse* m, gU8 reg) { + gU8 rxbuf[1]; (void) m; rxbuf[0] = 0; @@ -109,8 +109,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) { return rxbuf[0]; } -static uint16_t read_word(GMouse* m, uint8_t reg) { - uint8_t rxbuf[2]; +static gU16 read_word(GMouse* m, gU8 reg) { + gU8 rxbuf[2]; (void) m; rxbuf[0] = 0; @@ -120,7 +120,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) { i2cMasterTransmitTimeout(&I2CD3, STMPE811_ADDR, ®, 1, rxbuf, 2, MS2ST(STMPE811_TIMEOUT)); i2cReleaseBus(&I2CD3); - return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1]; + return (((gU16)rxbuf[0]) << 8) | rxbuf[1]; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c b/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c index 3b467b4b..5a305cd2 100644 --- a/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c +++ b/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.c @@ -182,7 +182,7 @@ void SDRAM_Init(void) void SDRAM_InitSequence(void) { FMC_SDRAMCommandTypeDef FMC_SDRAMCommandStructure; - uint32_t tmpr = 0; + gU32 tmpr = 0; /* Step 3 --------------------------------------------------------------------*/ /* Configure a clock configuration enable command */ @@ -240,7 +240,7 @@ void SDRAM_InitSequence(void) /* Step 7 --------------------------------------------------------------------*/ /* Program the external memory mode register */ - tmpr = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_2 | + tmpr = (gU32)SDRAM_MODEREG_BURST_LENGTH_2 | SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL | SDRAM_MODEREG_CAS_LATENCY_3 | SDRAM_MODEREG_OPERATING_MODE_STANDARD | @@ -279,9 +279,9 @@ void SDRAM_InitSequence(void) * @param uwBufferSize: number of words to write. * @retval None. */ -void SDRAM_WriteBuffer(uint32_t* pBuffer, uint32_t uwWriteAddress, uint32_t uwBufferSize) +void SDRAM_WriteBuffer(gU32* pBuffer, gU32 uwWriteAddress, gU32 uwBufferSize) { - __IO uint32_t write_pointer = (uint32_t)uwWriteAddress; + __IO gU32 write_pointer = (gU32)uwWriteAddress; /* Disable write protection */ FMC_SDRAMWriteProtectionConfig(FMC_Bank2_SDRAM, DISABLE); @@ -295,7 +295,7 @@ void SDRAM_WriteBuffer(uint32_t* pBuffer, uint32_t uwWriteAddress, uint32_t uwBu for (; uwBufferSize != 0; uwBufferSize--) { /* Transfer data to the memory */ - *(uint32_t *) (SDRAM_BANK_ADDR + write_pointer) = *pBuffer++; + *(gU32 *) (SDRAM_BANK_ADDR + write_pointer) = *pBuffer++; /* Increment the address*/ write_pointer += 4; @@ -311,9 +311,9 @@ void SDRAM_WriteBuffer(uint32_t* pBuffer, uint32_t uwWriteAddress, uint32_t uwBu * @param uwBufferSize: number of words to write. * @retval None. */ -void SDRAM_ReadBuffer(uint32_t* pBuffer, uint32_t uwReadAddress, uint32_t uwBufferSize) +void SDRAM_ReadBuffer(gU32* pBuffer, gU32 uwReadAddress, gU32 uwBufferSize) { - __IO uint32_t write_pointer = (uint32_t)uwReadAddress; + __IO gU32 write_pointer = (gU32)uwReadAddress; /* Wait until the SDRAM controller is ready */ @@ -324,7 +324,7 @@ void SDRAM_ReadBuffer(uint32_t* pBuffer, uint32_t uwReadAddress, uint32_t uwBuff /* Read data */ for(; uwBufferSize != 0x00; uwBufferSize--) { - *pBuffer++ = *(__IO uint32_t *)(SDRAM_BANK_ADDR + write_pointer ); + *pBuffer++ = *(__IO gU32 *)(SDRAM_BANK_ADDR + write_pointer ); /* Increment the address*/ write_pointer += 4; diff --git a/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.h b/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.h index fba5115d..98076f73 100644 --- a/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.h +++ b/boards/base/STM32F429i-Discovery/chibios/stm32f429i_discovery_sdram.h @@ -43,7 +43,7 @@ /** * @brief FMC SDRAM Bank address */ -#define SDRAM_BANK_ADDR ((uint32_t)0xD0000000) +#define SDRAM_BANK_ADDR ((gU32)0xD0000000) /** * @brief FMC SDRAM Memory Width @@ -72,22 +72,22 @@ /** * @brief FMC SDRAM Mode definition register defines */ -#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001) -#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002) -#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004) -#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008) -#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020) -#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030) -#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) +#define SDRAM_MODEREG_BURST_LENGTH_1 ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_LENGTH_2 ((gU16)0x0001) +#define SDRAM_MODEREG_BURST_LENGTH_4 ((gU16)0x0002) +#define SDRAM_MODEREG_BURST_LENGTH_8 ((gU16)0x0004) +#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((gU16)0x0008) +#define SDRAM_MODEREG_CAS_LATENCY_2 ((gU16)0x0020) +#define SDRAM_MODEREG_CAS_LATENCY_3 ((gU16)0x0030) +#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((gU16)0x0200) void SDRAM_Init(void); void SDRAM_InitSequence(void); -void SDRAM_WriteBuffer(uint32_t* pBuffer, uint32_t uwWriteAddress, uint32_t uwBufferSize); -void SDRAM_ReadBuffer(uint32_t* pBuffer, uint32_t uwReadAddress, uint32_t uwBufferSize); +void SDRAM_WriteBuffer(gU32* pBuffer, gU32 uwWriteAddress, gU32 uwBufferSize); +void SDRAM_ReadBuffer(gU32* pBuffer, gU32 uwReadAddress, gU32 uwBufferSize); #ifdef __cplusplus } diff --git a/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c b/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c index 370dc549..010d6d51 100644 --- a/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c +++ b/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.c @@ -57,24 +57,24 @@ /* --------------------- FMC registers bit mask ---------------------------- */ /* FMC BCRx Mask */ -#define BCR_MBKEN_SET ((uint32_t)0x00000001) -#define BCR_MBKEN_RESET ((uint32_t)0x000FFFFE) -#define BCR_FACCEN_SET ((uint32_t)0x00000040) +#define BCR_MBKEN_SET ((gU32)0x00000001) +#define BCR_MBKEN_RESET ((gU32)0x000FFFFE) +#define BCR_FACCEN_SET ((gU32)0x00000040) /* FMC PCRx Mask */ -#define PCR_PBKEN_SET ((uint32_t)0x00000004) -#define PCR_PBKEN_RESET ((uint32_t)0x000FFFFB) -#define PCR_ECCEN_SET ((uint32_t)0x00000040) -#define PCR_ECCEN_RESET ((uint32_t)0x000FFFBF) -#define PCR_MEMORYTYPE_NAND ((uint32_t)0x00000008) +#define PCR_PBKEN_SET ((gU32)0x00000004) +#define PCR_PBKEN_RESET ((gU32)0x000FFFFB) +#define PCR_ECCEN_SET ((gU32)0x00000040) +#define PCR_ECCEN_RESET ((gU32)0x000FFFBF) +#define PCR_MEMORYTYPE_NAND ((gU32)0x00000008) /* FMC SDCRx write protection Mask*/ -#define SDCR_WriteProtection_RESET ((uint32_t)0x00007DFF) +#define SDCR_WriteProtection_RESET ((gU32)0x00007DFF) /* FMC SDCMR Mask*/ -#define SDCMR_CTB1_RESET ((uint32_t)0x003FFFEF) -#define SDCMR_CTB2_RESET ((uint32_t)0x003FFFF7) -#define SDCMR_CTB1_2_RESET ((uint32_t)0x003FFFE7) +#define SDCMR_CTB1_RESET ((gU32)0x003FFFEF) +#define SDCMR_CTB2_RESET ((gU32)0x003FFFF7) +#define SDCMR_CTB1_2_RESET ((gU32)0x003FFFE7) /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ @@ -134,7 +134,7 @@ * @arg FMC_Bank1_NORSRAM4: FMC Bank1 NOR/SRAM4 * @retval None */ -void FMC_NORSRAMDeInit(uint32_t FMC_Bank) +void FMC_NORSRAMDeInit(gU32 FMC_Bank) { /* Check the parameter */ assert_param(IS_FMC_NORSRAM_BANK(FMC_Bank)); @@ -163,7 +163,7 @@ void FMC_NORSRAMDeInit(uint32_t FMC_Bank) */ void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct) { - uint32_t tmpr = 0; + gU32 tmpr = 0; /* Check the parameters */ assert_param(IS_FMC_NORSRAM_BANK(FMC_NORSRAMInitStruct->FMC_Bank)); @@ -190,7 +190,7 @@ void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct) /* NOR/SRAM Bank control register configuration */ FMC_Bank1->BTCR[FMC_NORSRAMInitStruct->FMC_Bank] = - (uint32_t)FMC_NORSRAMInitStruct->FMC_DataAddressMux | + (gU32)FMC_NORSRAMInitStruct->FMC_DataAddressMux | FMC_NORSRAMInitStruct->FMC_MemoryType | FMC_NORSRAMInitStruct->FMC_MemoryDataWidth | FMC_NORSRAMInitStruct->FMC_BurstAccessMode | @@ -207,22 +207,22 @@ void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct) if(FMC_NORSRAMInitStruct->FMC_MemoryType == FMC_MemoryType_NOR) { - FMC_Bank1->BTCR[FMC_NORSRAMInitStruct->FMC_Bank] |= (uint32_t)BCR_FACCEN_SET; + FMC_Bank1->BTCR[FMC_NORSRAMInitStruct->FMC_Bank] |= (gU32)BCR_FACCEN_SET; } /* Configure Continuous clock feature when bank2..4 is used */ if((FMC_NORSRAMInitStruct->FMC_ContinousClock == FMC_CClock_SyncAsync) && (FMC_NORSRAMInitStruct->FMC_Bank != FMC_Bank1_NORSRAM1)) { - tmpr = (uint32_t)((FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1+1]) & ~(((uint32_t)0x0F) << 20)); + tmpr = (gU32)((FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1+1]) & ~(((gU32)0x0F) << 20)); FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1] |= FMC_NORSRAMInitStruct->FMC_ContinousClock; FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1] |= FMC_BurstAccessMode_Enable; - FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1+1] = (uint32_t)(tmpr | (((FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_CLKDivision)-1) << 20)); + FMC_Bank1->BTCR[FMC_Bank1_NORSRAM1+1] = (gU32)(tmpr | (((FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_CLKDivision)-1) << 20)); } /* NOR/SRAM Bank timing register configuration */ FMC_Bank1->BTCR[FMC_NORSRAMInitStruct->FMC_Bank+1] = - (uint32_t)FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_AddressSetupTime | + (gU32)FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_AddressSetupTime | (FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_AddressHoldTime << 4) | (FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_DataSetupTime << 8) | (FMC_NORSRAMInitStruct->FMC_ReadWriteTimingStruct->FMC_BusTurnAroundDuration << 16) | @@ -241,7 +241,7 @@ void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct) assert_param(IS_FMC_ACCESS_MODE(FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_AccessMode)); FMC_Bank1E->BWTR[FMC_NORSRAMInitStruct->FMC_Bank] = - (uint32_t)FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_AddressSetupTime | + (gU32)FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_AddressSetupTime | (FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_AddressHoldTime << 4 )| (FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_DataSetupTime << 8) | ((FMC_NORSRAMInitStruct->FMC_WriteTimingStruct->FMC_CLKDivision) << 20) | @@ -306,7 +306,7 @@ void FMC_NORSRAMStructInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct) * @param NewState: new state of the FMC_Bank. This parameter can be: ENABLE or DISABLE. * @retval None */ -void FMC_NORSRAMCmd(uint32_t FMC_Bank, FunctionalState NewState) +void FMC_NORSRAMCmd(gU32 FMC_Bank, FunctionalState NewState) { assert_param(IS_FMC_NORSRAM_BANK(FMC_Bank)); assert_param(IS_FUNCTIONAL_STATE(NewState)); @@ -379,7 +379,7 @@ void FMC_NORSRAMCmd(uint32_t FMC_Bank, FunctionalState NewState) * @arg FMC_Bank3_NAND: FMC Bank3 NAND * @retval None */ -void FMC_NANDDeInit(uint32_t FMC_Bank) +void FMC_NANDDeInit(gU32 FMC_Bank) { /* Check the parameter */ assert_param(IS_FMC_NAND_BANK(FMC_Bank)); @@ -412,7 +412,7 @@ void FMC_NANDDeInit(uint32_t FMC_Bank) */ void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct) { - uint32_t tmppcr = 0x00000000, tmppmem = 0x00000000, tmppatt = 0x00000000; + gU32 tmppcr = 0x00000000, tmppmem = 0x00000000, tmppatt = 0x00000000; /* Check the parameters */ assert_param(IS_FMC_NAND_BANK(FMC_NANDInitStruct->FMC_Bank)); @@ -432,7 +432,7 @@ void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct) assert_param(IS_FMC_HIZ_TIME(FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_HiZSetupTime)); /* Set the tmppcr value according to FMC_NANDInitStruct parameters */ - tmppcr = (uint32_t)FMC_NANDInitStruct->FMC_Waitfeature | + tmppcr = (gU32)FMC_NANDInitStruct->FMC_Waitfeature | PCR_MEMORYTYPE_NAND | FMC_NANDInitStruct->FMC_MemoryDataWidth | FMC_NANDInitStruct->FMC_ECC | @@ -441,13 +441,13 @@ void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct) (FMC_NANDInitStruct->FMC_TARSetupTime << 13); /* Set tmppmem value according to FMC_CommonSpaceTimingStructure parameters */ - tmppmem = (uint32_t)FMC_NANDInitStruct->FMC_CommonSpaceTimingStruct->FMC_SetupTime | + tmppmem = (gU32)FMC_NANDInitStruct->FMC_CommonSpaceTimingStruct->FMC_SetupTime | (FMC_NANDInitStruct->FMC_CommonSpaceTimingStruct->FMC_WaitSetupTime << 8) | (FMC_NANDInitStruct->FMC_CommonSpaceTimingStruct->FMC_HoldSetupTime << 16)| (FMC_NANDInitStruct->FMC_CommonSpaceTimingStruct->FMC_HiZSetupTime << 24); /* Set tmppatt value according to FMC_AttributeSpaceTimingStructure parameters */ - tmppatt = (uint32_t)FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_SetupTime | + tmppatt = (gU32)FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_SetupTime | (FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_WaitSetupTime << 8) | (FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_HoldSetupTime << 16)| (FMC_NANDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_HiZSetupTime << 24); @@ -504,7 +504,7 @@ void FMC_NANDStructInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct) * @param NewState: new state of the FMC_Bank. This parameter can be: ENABLE or DISABLE. * @retval None */ -void FMC_NANDCmd(uint32_t FMC_Bank, FunctionalState NewState) +void FMC_NANDCmd(gU32 FMC_Bank, FunctionalState NewState) { assert_param(IS_FMC_NAND_BANK(FMC_Bank)); assert_param(IS_FUNCTIONAL_STATE(NewState)); @@ -544,7 +544,7 @@ void FMC_NANDCmd(uint32_t FMC_Bank, FunctionalState NewState) * This parameter can be: ENABLE or DISABLE. * @retval None */ -void FMC_NANDECCCmd(uint32_t FMC_Bank, FunctionalState NewState) +void FMC_NANDECCCmd(gU32 FMC_Bank, FunctionalState NewState) { assert_param(IS_FMC_NAND_BANK(FMC_Bank)); assert_param(IS_FUNCTIONAL_STATE(NewState)); @@ -583,9 +583,9 @@ void FMC_NANDECCCmd(uint32_t FMC_Bank, FunctionalState NewState) * @arg FMC_Bank3_NAND: FMC Bank3 NAND * @retval The Error Correction Code (ECC) value. */ -uint32_t FMC_GetECC(uint32_t FMC_Bank) +gU32 FMC_GetECC(gU32 FMC_Bank) { - uint32_t eccval = 0x00000000; + gU32 eccval = 0x00000000; if(FMC_Bank == FMC_Bank2_NAND) { @@ -686,25 +686,25 @@ void FMC_PCCARDInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct) assert_param(IS_FMC_HIZ_TIME(FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_HiZSetupTime)); /* Set the PCR4 register value according to FMC_PCCARDInitStruct parameters */ - FMC_Bank4->PCR4 = (uint32_t)FMC_PCCARDInitStruct->FMC_Waitfeature | + FMC_Bank4->PCR4 = (gU32)FMC_PCCARDInitStruct->FMC_Waitfeature | FMC_NAND_MemoryDataWidth_16b | (FMC_PCCARDInitStruct->FMC_TCLRSetupTime << 9) | (FMC_PCCARDInitStruct->FMC_TARSetupTime << 13); /* Set PMEM4 register value according to FMC_CommonSpaceTimingStructure parameters */ - FMC_Bank4->PMEM4 = (uint32_t)FMC_PCCARDInitStruct->FMC_CommonSpaceTimingStruct->FMC_SetupTime | + FMC_Bank4->PMEM4 = (gU32)FMC_PCCARDInitStruct->FMC_CommonSpaceTimingStruct->FMC_SetupTime | (FMC_PCCARDInitStruct->FMC_CommonSpaceTimingStruct->FMC_WaitSetupTime << 8) | (FMC_PCCARDInitStruct->FMC_CommonSpaceTimingStruct->FMC_HoldSetupTime << 16)| (FMC_PCCARDInitStruct->FMC_CommonSpaceTimingStruct->FMC_HiZSetupTime << 24); /* Set PATT4 register value according to FMC_AttributeSpaceTimingStructure parameters */ - FMC_Bank4->PATT4 = (uint32_t)FMC_PCCARDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_SetupTime | + FMC_Bank4->PATT4 = (gU32)FMC_PCCARDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_SetupTime | (FMC_PCCARDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_WaitSetupTime << 8) | (FMC_PCCARDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_HoldSetupTime << 16)| (FMC_PCCARDInitStruct->FMC_AttributeSpaceTimingStruct->FMC_HiZSetupTime << 24); /* Set PIO4 register value according to FMC_IOSpaceTimingStructure parameters */ - FMC_Bank4->PIO4 = (uint32_t)FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_SetupTime | + FMC_Bank4->PIO4 = (gU32)FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_SetupTime | (FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_WaitSetupTime << 8) | (FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_HoldSetupTime << 16)| (FMC_PCCARDInitStruct->FMC_IOSpaceTimingStruct->FMC_HiZSetupTime << 24); @@ -814,7 +814,7 @@ void FMC_PCCARDCmd(FunctionalState NewState) * @arg FMC_Bank2_SDRAM: FMC Bank2 SDRAM * @retval None */ -void FMC_SDRAMDeInit(uint32_t FMC_Bank) +void FMC_SDRAMDeInit(gU32 FMC_Bank) { /* Check the parameter */ assert_param(IS_FMC_SDRAM_BANK(FMC_Bank)); @@ -837,10 +837,10 @@ void FMC_SDRAMDeInit(uint32_t FMC_Bank) void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) { /* temporary registers */ - uint32_t tmpr1 = 0; - uint32_t tmpr2 = 0; - uint32_t tmpr3 = 0; - uint32_t tmpr4 = 0; + gU32 tmpr1 = 0; + gU32 tmpr2 = 0; + gU32 tmpr3 = 0; + gU32 tmpr4 = 0; /* Check the parameters */ @@ -866,7 +866,7 @@ void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) assert_param(IS_FMC_RCD_DELAY(FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_RCDDelay)); /* SDRAM bank control register configuration */ - tmpr1 = (uint32_t)FMC_SDRAMInitStruct->FMC_ColumnBitsNumber | + tmpr1 = (gU32)FMC_SDRAMInitStruct->FMC_ColumnBitsNumber | FMC_SDRAMInitStruct->FMC_RowBitsNumber | FMC_SDRAMInitStruct->FMC_SDMemoryDataWidth | FMC_SDRAMInitStruct->FMC_InternalBankNumber | @@ -882,7 +882,7 @@ void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) } else /* SDCR2 "don't care" bits configuration */ { - tmpr3 = (uint32_t)FMC_SDRAMInitStruct->FMC_SDClockPeriod | + tmpr3 = (gU32)FMC_SDRAMInitStruct->FMC_SDClockPeriod | FMC_SDRAMInitStruct->FMC_ReadBurst | FMC_SDRAMInitStruct->FMC_ReadPipeDelay; @@ -892,7 +892,7 @@ void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) /* SDRAM bank timing register configuration */ if(FMC_SDRAMInitStruct->FMC_Bank == FMC_Bank1_SDRAM ) { - tmpr2 = (uint32_t)((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_LoadToActiveDelay)-1) | + tmpr2 = (gU32)((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_LoadToActiveDelay)-1) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_ExitSelfRefreshDelay)-1) << 4) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_SelfRefreshTime)-1) << 8) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_RowCycleDelay)-1) << 12) | @@ -904,12 +904,12 @@ void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) } else /* SDTR "don't care bits configuration */ { - tmpr2 = (uint32_t)((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_LoadToActiveDelay)-1) | + tmpr2 = (gU32)((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_LoadToActiveDelay)-1) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_ExitSelfRefreshDelay)-1) << 4) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_SelfRefreshTime)-1) << 8) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_WriteRecoveryTime)-1) << 16); - tmpr4 = (uint32_t)(((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_RowCycleDelay)-1) << 12) | + tmpr4 = (gU32)(((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_RowCycleDelay)-1) << 12) | (((FMC_SDRAMInitStruct->FMC_SDRAMTimingStruct->FMC_RPDelay)-1) << 20); FMC_Bank5_6->SDTR[FMC_Bank1_SDRAM] = tmpr4; @@ -956,7 +956,7 @@ void FMC_SDRAMStructInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct) */ void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct) { - uint32_t tmpr = 0x0; + gU32 tmpr = 0x0; /* check parameters */ assert_param(IS_FMC_COMMAND_MODE(FMC_SDRAMCommandStruct->FMC_CommandMode)); @@ -964,7 +964,7 @@ void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct) assert_param(IS_FMC_AUTOREFRESH_NUMBER(FMC_SDRAMCommandStruct->FMC_AutoRefreshNumber)); assert_param(IS_FMC_MODE_REGISTER(FMC_SDRAMCommandStruct->FMC_ModeRegisterDefinition)); - tmpr = (uint32_t)(FMC_SDRAMCommandStruct->FMC_CommandMode | + tmpr = (gU32)(FMC_SDRAMCommandStruct->FMC_CommandMode | FMC_SDRAMCommandStruct->FMC_CommandTarget | (((FMC_SDRAMCommandStruct->FMC_AutoRefreshNumber)-1)<<5) | ((FMC_SDRAMCommandStruct->FMC_ModeRegisterDefinition)<<9)); @@ -980,9 +980,9 @@ void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct) * FMC_Bank1_SDRAM or FMC_Bank2_SDRAM. * @retval The FMC SDRAM bank mode status */ -uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank) +gU32 FMC_GetModeStatus(gU32 SDRAM_Bank) { - uint32_t tmpreg = 0; + gU32 tmpreg = 0; /* Check the parameter */ assert_param(IS_FMC_SDRAM_BANK(SDRAM_Bank)); @@ -990,11 +990,11 @@ uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank) /* Get the busy flag status */ if(SDRAM_Bank == FMC_Bank1_SDRAM) { - tmpreg = (uint32_t)(FMC_Bank5_6->SDSR & FMC_SDSR_MODES1); + tmpreg = (gU32)(FMC_Bank5_6->SDSR & FMC_SDSR_MODES1); } else { - tmpreg = ((uint32_t)(FMC_Bank5_6->SDSR & FMC_SDSR_MODES2) >> 2); + tmpreg = ((gU32)(FMC_Bank5_6->SDSR & FMC_SDSR_MODES2) >> 2); } /* Return the mode status */ @@ -1006,7 +1006,7 @@ uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank) * @param FMC_Count: specifies the Refresh timer count. * @retval None */ -void FMC_SetRefreshCount(uint32_t FMC_Count) +void FMC_SetRefreshCount(gU32 FMC_Count) { /* check the parameters */ assert_param(IS_FMC_REFRESH_COUNT(FMC_Count)); @@ -1020,7 +1020,7 @@ void FMC_SetRefreshCount(uint32_t FMC_Count) * @param FMC_Number: specifies the auto Refresh number. * @retval None */ -void FMC_SetAutoRefresh_Number(uint32_t FMC_Number) +void FMC_SetAutoRefresh_Number(gU32 FMC_Number) { /* check the parameters */ assert_param(IS_FMC_AUTOREFRESH_NUMBER(FMC_Number)); @@ -1036,7 +1036,7 @@ void FMC_SetAutoRefresh_Number(uint32_t FMC_Number) * This parameter can be: ENABLE or DISABLE. * @retval None */ -void FMC_SDRAMWriteProtectionConfig(uint32_t SDRAM_Bank, FunctionalState NewState) +void FMC_SDRAMWriteProtectionConfig(gU32 SDRAM_Bank, FunctionalState NewState) { /* Check the parameter */ assert_param(IS_FUNCTIONAL_STATE(NewState)); @@ -1088,7 +1088,7 @@ void FMC_SDRAMWriteProtectionConfig(uint32_t SDRAM_Bank, FunctionalState NewStat * This parameter can be: ENABLE or DISABLE. * @retval None */ -void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState) +void FMC_ITConfig(gU32 FMC_Bank, gU32 FMC_IT, FunctionalState NewState) { assert_param(IS_FMC_IT_BANK(FMC_Bank)); assert_param(IS_FMC_IT(FMC_IT)); @@ -1124,23 +1124,23 @@ void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState) if(FMC_Bank == FMC_Bank2_NAND) { - FMC_Bank2->SR2 &= (uint32_t)~FMC_IT; + FMC_Bank2->SR2 &= (gU32)~FMC_IT; } /* Disable the selected FMC_Bank3 interrupts */ else if (FMC_Bank == FMC_Bank3_NAND) { - FMC_Bank3->SR3 &= (uint32_t)~FMC_IT; + FMC_Bank3->SR3 &= (gU32)~FMC_IT; } /* Disable the selected FMC_Bank4 interrupts */ else if(FMC_Bank == FMC_Bank4_PCCARD) { - FMC_Bank4->SR4 &= (uint32_t)~FMC_IT; + FMC_Bank4->SR4 &= (gU32)~FMC_IT; } /* Disable the selected FMC_Bank5_6 interrupt */ else { /* Disables the interrupt if the refresh error flag is not set */ - FMC_Bank5_6->SDRTR &= (uint32_t)~FMC_IT; + FMC_Bank5_6->SDRTR &= (gU32)~FMC_IT; } } } @@ -1165,10 +1165,10 @@ void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState) * @arg FMC_FLAG_Busy: Busy status Flag. * @retval The new state of FMC_FLAG (SET or RESET). */ -FlagStatus FMC_GetFlagStatus(uint32_t FMC_Bank, uint32_t FMC_FLAG) +FlagStatus FMC_GetFlagStatus(gU32 FMC_Bank, gU32 FMC_FLAG) { FlagStatus bitstatus = RESET; - uint32_t tmpsr = 0x00000000; + gU32 tmpsr = 0x00000000; /* Check the parameters */ assert_param(IS_FMC_GETFLAG_BANK(FMC_Bank)); @@ -1221,7 +1221,7 @@ FlagStatus FMC_GetFlagStatus(uint32_t FMC_Bank, uint32_t FMC_FLAG) * @arg FMC_FLAG_Refresh: Refresh error Flag. * @retval None */ -void FMC_ClearFlag(uint32_t FMC_Bank, uint32_t FMC_FLAG) +void FMC_ClearFlag(gU32 FMC_Bank, gU32 FMC_FLAG) { /* Check the parameters */ assert_param(IS_FMC_GETFLAG_BANK(FMC_Bank)); @@ -1264,13 +1264,13 @@ void FMC_ClearFlag(uint32_t FMC_Bank, uint32_t FMC_FLAG) * @arg FMC_IT_Refresh: Refresh error detection interrupt. * @retval The new state of FMC_IT (SET or RESET). */ -ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT) +ITStatus FMC_GetITStatus(gU32 FMC_Bank, gU32 FMC_IT) { ITStatus bitstatus = RESET; - uint32_t tmpsr = 0x0; - uint32_t tmpsr2 = 0x0; - uint32_t itstatus = 0x0; - uint32_t itenable = 0x0; + gU32 tmpsr = 0x0; + gU32 tmpsr2 = 0x0; + gU32 itstatus = 0x0; + gU32 itenable = 0x0; /* Check the parameters */ assert_param(IS_FMC_IT_BANK(FMC_Bank)); @@ -1308,7 +1308,7 @@ ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT) itstatus = tmpsr & (FMC_IT >> 3); } - if ((itstatus != (uint32_t)RESET) && (itenable != (uint32_t)RESET)) + if ((itstatus != (gU32)RESET) && (itenable != (gU32)RESET)) { bitstatus = SET; } @@ -1336,7 +1336,7 @@ ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT) * @arg FMC_IT_Refresh: Refresh error detection interrupt. * @retval None */ -void FMC_ClearITPendingBit(uint32_t FMC_Bank, uint32_t FMC_IT) +void FMC_ClearITPendingBit(gU32 FMC_Bank, gU32 FMC_IT) { /* Check the parameters */ assert_param(IS_FMC_IT_BANK(FMC_Bank)); diff --git a/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.h b/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.h index 1196f135..010d16bf 100644 --- a/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.h +++ b/boards/base/STM32F429i-Discovery/chibios/stm32f4xx_fmc.h @@ -57,31 +57,31 @@ */ typedef struct { - uint32_t FMC_AddressSetupTime; /*!< Defines the number of HCLK cycles to configure + gU32 FMC_AddressSetupTime; /*!< Defines the number of HCLK cycles to configure the duration of the address setup time. This parameter can be a value between 0 and 15. @note This parameter is not used with synchronous NOR Flash memories. */ - uint32_t FMC_AddressHoldTime; /*!< Defines the number of HCLK cycles to configure + gU32 FMC_AddressHoldTime; /*!< Defines the number of HCLK cycles to configure the duration of the address hold time. This parameter can be a value between 1 and 15. @note This parameter is not used with synchronous NOR Flash memories.*/ - uint32_t FMC_DataSetupTime; /*!< Defines the number of HCLK cycles to configure + gU32 FMC_DataSetupTime; /*!< Defines the number of HCLK cycles to configure the duration of the data setup time. This parameter can be a value between 1 and 255. @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed NOR Flash memories. */ - uint32_t FMC_BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure + gU32 FMC_BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure the duration of the bus turnaround. This parameter can be a value between 0 and 15. @note This parameter is only used for multiplexed NOR Flash memories. */ - uint32_t FMC_CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of HCLK cycles. + gU32 FMC_CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of HCLK cycles. This parameter can be a value between 1 and 15. @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM accesses. */ - uint32_t FMC_DataLatency; /*!< Defines the number of memory clock cycles to issue + gU32 FMC_DataLatency; /*!< Defines the number of memory clock cycles to issue to the memory before getting the first data. The parameter value depends on the memory type as shown below: - It must be set to 0 in case of a CRAM @@ -89,7 +89,7 @@ typedef struct - It may assume a value between 0 and 15 in NOR Flash memories with synchronous burst mode enable */ - uint32_t FMC_AccessMode; /*!< Specifies the asynchronous access mode. + gU32 FMC_AccessMode; /*!< Specifies the asynchronous access mode. This parameter can be a value of @ref FMC_Access_Mode */ }FMC_NORSRAMTimingInitTypeDef; @@ -98,55 +98,55 @@ typedef struct */ typedef struct { - uint32_t FMC_Bank; /*!< Specifies the NOR/SRAM memory bank that will be used. + gU32 FMC_Bank; /*!< Specifies the NOR/SRAM memory bank that will be used. This parameter can be a value of @ref FMC_NORSRAM_Bank */ - uint32_t FMC_DataAddressMux; /*!< Specifies whether the address and data values are + gU32 FMC_DataAddressMux; /*!< Specifies whether the address and data values are multiplexed on the databus or not. This parameter can be a value of @ref FMC_Data_Address_Bus_Multiplexing */ - uint32_t FMC_MemoryType; /*!< Specifies the type of external memory attached to + gU32 FMC_MemoryType; /*!< Specifies the type of external memory attached to the corresponding memory bank. This parameter can be a value of @ref FMC_Memory_Type */ - uint32_t FMC_MemoryDataWidth; /*!< Specifies the external memory device width. + gU32 FMC_MemoryDataWidth; /*!< Specifies the external memory device width. This parameter can be a value of @ref FMC_NORSRAM_Data_Width */ - uint32_t FMC_BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory, + gU32 FMC_BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory, valid only with synchronous burst Flash memories. This parameter can be a value of @ref FMC_Burst_Access_Mode */ - uint32_t FMC_WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing + gU32 FMC_WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing the Flash memory in burst mode. This parameter can be a value of @ref FMC_Wait_Signal_Polarity */ - uint32_t FMC_WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash + gU32 FMC_WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash memory, valid only when accessing Flash memories in burst mode. This parameter can be a value of @ref FMC_Wrap_Mode */ - uint32_t FMC_WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one + gU32 FMC_WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one clock cycle before the wait state or during the wait state, valid only when accessing memories in burst mode. This parameter can be a value of @ref FMC_Wait_Timing */ - uint32_t FMC_WriteOperation; /*!< Enables or disables the write operation in the selected bank by the FMC. + gU32 FMC_WriteOperation; /*!< Enables or disables the write operation in the selected bank by the FMC. This parameter can be a value of @ref FMC_Write_Operation */ - uint32_t FMC_WaitSignal; /*!< Enables or disables the wait state insertion via wait + gU32 FMC_WaitSignal; /*!< Enables or disables the wait state insertion via wait signal, valid for Flash memory access in burst mode. This parameter can be a value of @ref FMC_Wait_Signal */ - uint32_t FMC_ExtendedMode; /*!< Enables or disables the extended mode. + gU32 FMC_ExtendedMode; /*!< Enables or disables the extended mode. This parameter can be a value of @ref FMC_Extended_Mode */ - uint32_t FMC_AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers, + gU32 FMC_AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers, valid only with asynchronous Flash memories. This parameter can be a value of @ref FMC_AsynchronousWait */ - uint32_t FMC_WriteBurst; /*!< Enables or disables the write burst operation. + gU32 FMC_WriteBurst; /*!< Enables or disables the write burst operation. This parameter can be a value of @ref FMC_Write_Burst */ - uint32_t FMC_ContinousClock; /*!< Enables or disables the FMC clock output to external memory devices. + gU32 FMC_ContinousClock; /*!< Enables or disables the FMC clock output to external memory devices. This parameter is only enabled through the FMC_BCR1 register, and don't care through FMC_BCR2..4 registers. This parameter can be a value of @ref FMC_Continous_Clock */ @@ -162,26 +162,26 @@ typedef struct */ typedef struct { - uint32_t FMC_SetupTime; /*!< Defines the number of HCLK cycles to setup address before + gU32 FMC_SetupTime; /*!< Defines the number of HCLK cycles to setup address before the command assertion for NAND-Flash read or write access to common/Attribute or I/O memory space (depending on the memory space timing to be configured). This parameter can be a value between 0 and 255.*/ - uint32_t FMC_WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the + gU32 FMC_WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the command for NAND-Flash read or write access to common/Attribute or I/O memory space (depending on the memory space timing to be configured). This parameter can be a number between 0 and 255 */ - uint32_t FMC_HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address + gU32 FMC_HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address (and data for write access) after the command de-assertion for NAND-Flash read or write access to common/Attribute or I/O memory space (depending on the memory space timing to be configured). This parameter can be a number between 0 and 255 */ - uint32_t FMC_HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the + gU32 FMC_HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the databus is kept in HiZ after the start of a NAND-Flash write access to common/Attribute or I/O memory space (depending on the memory space timing to be configured). @@ -193,26 +193,26 @@ typedef struct */ typedef struct { - uint32_t FMC_Bank; /*!< Specifies the NAND memory bank that will be used. + gU32 FMC_Bank; /*!< Specifies the NAND memory bank that will be used. This parameter can be a value of @ref FMC_NAND_Bank */ - uint32_t FMC_Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory Bank. + gU32 FMC_Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory Bank. This parameter can be any value of @ref FMC_Wait_feature */ - uint32_t FMC_MemoryDataWidth; /*!< Specifies the external memory device width. + gU32 FMC_MemoryDataWidth; /*!< Specifies the external memory device width. This parameter can be any value of @ref FMC_NAND_Data_Width */ - uint32_t FMC_ECC; /*!< Enables or disables the ECC computation. + gU32 FMC_ECC; /*!< Enables or disables the ECC computation. This parameter can be any value of @ref FMC_ECC */ - uint32_t FMC_ECCPageSize; /*!< Defines the page size for the extended ECC. + gU32 FMC_ECCPageSize; /*!< Defines the page size for the extended ECC. This parameter can be any value of @ref FMC_ECC_Page_Size */ - uint32_t FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the + gU32 FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the delay between CLE low and RE low. This parameter can be a value between 0 and 255. */ - uint32_t FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the + gU32 FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the delay between ALE low and RE low. This parameter can be a number between 0 and 255 */ @@ -227,14 +227,14 @@ typedef struct typedef struct { - uint32_t FMC_Waitfeature; /*!< Enables or disables the Wait feature for the Memory Bank. + gU32 FMC_Waitfeature; /*!< Enables or disables the Wait feature for the Memory Bank. This parameter can be any value of @ref FMC_Wait_feature */ - uint32_t FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the + gU32 FMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the delay between CLE low and RE low. This parameter can be a value between 0 and 255. */ - uint32_t FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the + gU32 FMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the delay between ALE low and RE low. This parameter can be a number between 0 and 255 */ @@ -252,31 +252,31 @@ typedef struct typedef struct { - uint32_t FMC_LoadToActiveDelay; /*!< Defines the delay between a Load Mode Register command and + gU32 FMC_LoadToActiveDelay; /*!< Defines the delay between a Load Mode Register command and an active or Refresh command in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_ExitSelfRefreshDelay; /*!< Defines the delay from releasing the self refresh command to + gU32 FMC_ExitSelfRefreshDelay; /*!< Defines the delay from releasing the self refresh command to issuing the Activate command in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_SelfRefreshTime; /*!< Defines the minimum Self Refresh period in number of memory clock + gU32 FMC_SelfRefreshTime; /*!< Defines the minimum Self Refresh period in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_RowCycleDelay; /*!< Defines the delay between the Refresh command and the Activate command + gU32 FMC_RowCycleDelay; /*!< Defines the delay between the Refresh command and the Activate command and the delay between two consecutive Refresh commands in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_WriteRecoveryTime; /*!< Defines the Write recovery Time in number of memory clock cycles. + gU32 FMC_WriteRecoveryTime; /*!< Defines the Write recovery Time in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_RPDelay; /*!< Defines the delay between a Precharge Command and an other command + gU32 FMC_RPDelay; /*!< Defines the delay between a Precharge Command and an other command in number of memory clock cycles. This parameter can be a value between 1 and 16. */ - uint32_t FMC_RCDDelay; /*!< Defines the delay between the Activate Command and a Read/Write command + gU32 FMC_RCDDelay; /*!< Defines the delay between the Activate Command and a Read/Write command in number of memory clock cycles. This parameter can be a value between 1 and 16. */ @@ -289,17 +289,17 @@ typedef struct typedef struct { - uint32_t FMC_CommandMode; /*!< Defines the command issued to the SDRAM device. + gU32 FMC_CommandMode; /*!< Defines the command issued to the SDRAM device. This parameter can be a value of @ref FMC_Command_Mode. */ - uint32_t FMC_CommandTarget; /*!< Defines which bank (1 or 2) the command will be issued to. + gU32 FMC_CommandTarget; /*!< Defines which bank (1 or 2) the command will be issued to. This parameter can be a value of @ref FMC_Command_Target. */ - uint32_t FMC_AutoRefreshNumber; /*!< Defines the number of consecutive auto refresh command issued + gU32 FMC_AutoRefreshNumber; /*!< Defines the number of consecutive auto refresh command issued in auto refresh mode. This parameter can be a value between 1 and 16. */ - uint32_t FMC_ModeRegisterDefinition; /*!< Defines the SDRAM Mode register content */ + gU32 FMC_ModeRegisterDefinition; /*!< Defines the SDRAM Mode register content */ }FMC_SDRAMCommandTypeDef; @@ -309,36 +309,36 @@ typedef struct typedef struct { - uint32_t FMC_Bank; /*!< Specifies the SDRAM memory bank that will be used. + gU32 FMC_Bank; /*!< Specifies the SDRAM memory bank that will be used. This parameter can be a value of @ref FMC_SDRAM_Bank */ - uint32_t FMC_ColumnBitsNumber; /*!< Defines the number of bits of column address. + gU32 FMC_ColumnBitsNumber; /*!< Defines the number of bits of column address. This parameter can be a value of @ref FMC_ColumnBits_Number. */ - uint32_t FMC_RowBitsNumber; /*!< Defines the number of bits of column address.. + gU32 FMC_RowBitsNumber; /*!< Defines the number of bits of column address.. This parameter can be a value of @ref FMC_RowBits_Number. */ - uint32_t FMC_SDMemoryDataWidth; /*!< Defines the memory device width. + gU32 FMC_SDMemoryDataWidth; /*!< Defines the memory device width. This parameter can be a value of @ref FMC_SDMemory_Data_Width. */ - uint32_t FMC_InternalBankNumber; /*!< Defines the number of bits of column address. + gU32 FMC_InternalBankNumber; /*!< Defines the number of bits of column address. This parameter can be of @ref FMC_InternalBank_Number. */ - uint32_t FMC_CASLatency; /*!< Defines the SDRAM CAS latency in number of memory clock cycles. + gU32 FMC_CASLatency; /*!< Defines the SDRAM CAS latency in number of memory clock cycles. This parameter can be a value of @ref FMC_CAS_Latency. */ - uint32_t FMC_WriteProtection; /*!< Enables the SDRAM bank to be accessed in write mode. + gU32 FMC_WriteProtection; /*!< Enables the SDRAM bank to be accessed in write mode. This parameter can be a value of @ref FMC_Write_Protection. */ - uint32_t FMC_SDClockPeriod; /*!< Define the SDRAM Clock Period for both SDRAM Banks and they allow to disable + gU32 FMC_SDClockPeriod; /*!< Define the SDRAM Clock Period for both SDRAM Banks and they allow to disable the clock before changing frequency. This parameter can be a value of @ref FMC_SDClock_Period. */ - uint32_t FMC_ReadBurst; /*!< This bit enable the SDRAM controller to anticipate the next read commands + gU32 FMC_ReadBurst; /*!< This bit enable the SDRAM controller to anticipate the next read commands during the CAS latency and stores data in the Read FIFO. This parameter can be a value of @ref FMC_Read_Burst. */ - uint32_t FMC_ReadPipeDelay; /*!< Define the delay in system clock cycles on read data path. + gU32 FMC_ReadPipeDelay; /*!< Define the delay in system clock cycles on read data path. This parameter can be a value of @ref FMC_ReadPipe_Delay. */ FMC_SDRAMTimingInitTypeDef* FMC_SDRAMTimingStruct; /*!< Timing Parameters for write and read access*/ @@ -355,10 +355,10 @@ typedef struct /** @defgroup FMC_NORSRAM_Bank * @{ */ -#define FMC_Bank1_NORSRAM1 ((uint32_t)0x00000000) -#define FMC_Bank1_NORSRAM2 ((uint32_t)0x00000002) -#define FMC_Bank1_NORSRAM3 ((uint32_t)0x00000004) -#define FMC_Bank1_NORSRAM4 ((uint32_t)0x00000006) +#define FMC_Bank1_NORSRAM1 ((gU32)0x00000000) +#define FMC_Bank1_NORSRAM2 ((gU32)0x00000002) +#define FMC_Bank1_NORSRAM3 ((gU32)0x00000004) +#define FMC_Bank1_NORSRAM4 ((gU32)0x00000006) #define IS_FMC_NORSRAM_BANK(BANK) (((BANK) == FMC_Bank1_NORSRAM1) || \ ((BANK) == FMC_Bank1_NORSRAM2) || \ @@ -371,8 +371,8 @@ typedef struct /** @defgroup FMC_NAND_Bank * @{ */ -#define FMC_Bank2_NAND ((uint32_t)0x00000010) -#define FMC_Bank3_NAND ((uint32_t)0x00000100) +#define FMC_Bank2_NAND ((gU32)0x00000010) +#define FMC_Bank3_NAND ((gU32)0x00000100) #define IS_FMC_NAND_BANK(BANK) (((BANK) == FMC_Bank2_NAND) || \ ((BANK) == FMC_Bank3_NAND)) @@ -383,7 +383,7 @@ typedef struct /** @defgroup FMC_PCCARD_Bank * @{ */ -#define FMC_Bank4_PCCARD ((uint32_t)0x00001000) +#define FMC_Bank4_PCCARD ((gU32)0x00001000) /** * @} */ @@ -391,8 +391,8 @@ typedef struct /** @defgroup FMC_SDRAM_Bank * @{ */ -#define FMC_Bank1_SDRAM ((uint32_t)0x00000000) -#define FMC_Bank2_SDRAM ((uint32_t)0x00000001) +#define FMC_Bank1_SDRAM ((gU32)0x00000000) +#define FMC_Bank2_SDRAM ((gU32)0x00000001) #define IS_FMC_SDRAM_BANK(BANK) (((BANK) == FMC_Bank1_SDRAM) || \ ((BANK) == FMC_Bank2_SDRAM)) @@ -410,8 +410,8 @@ typedef struct * @{ */ -#define FMC_DataAddressMux_Disable ((uint32_t)0x00000000) -#define FMC_DataAddressMux_Enable ((uint32_t)0x00000002) +#define FMC_DataAddressMux_Disable ((gU32)0x00000000) +#define FMC_DataAddressMux_Enable ((gU32)0x00000002) #define IS_FMC_MUX(MUX) (((MUX) == FMC_DataAddressMux_Disable) || \ ((MUX) == FMC_DataAddressMux_Enable)) @@ -423,9 +423,9 @@ typedef struct * @{ */ -#define FMC_MemoryType_SRAM ((uint32_t)0x00000000) -#define FMC_MemoryType_PSRAM ((uint32_t)0x00000004) -#define FMC_MemoryType_NOR ((uint32_t)0x00000008) +#define FMC_MemoryType_SRAM ((gU32)0x00000000) +#define FMC_MemoryType_PSRAM ((gU32)0x00000004) +#define FMC_MemoryType_NOR ((gU32)0x00000008) #define IS_FMC_MEMORY(MEMORY) (((MEMORY) == FMC_MemoryType_SRAM) || \ ((MEMORY) == FMC_MemoryType_PSRAM)|| \ @@ -438,9 +438,9 @@ typedef struct * @{ */ -#define FMC_NORSRAM_MemoryDataWidth_8b ((uint32_t)0x00000000) -#define FMC_NORSRAM_MemoryDataWidth_16b ((uint32_t)0x00000010) -#define FMC_NORSRAM_MemoryDataWidth_32b ((uint32_t)0x00000020) +#define FMC_NORSRAM_MemoryDataWidth_8b ((gU32)0x00000000) +#define FMC_NORSRAM_MemoryDataWidth_16b ((gU32)0x00000010) +#define FMC_NORSRAM_MemoryDataWidth_32b ((gU32)0x00000020) #define IS_FMC_NORSRAM_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NORSRAM_MemoryDataWidth_8b) || \ ((WIDTH) == FMC_NORSRAM_MemoryDataWidth_16b) || \ @@ -453,8 +453,8 @@ typedef struct * @{ */ -#define FMC_BurstAccessMode_Disable ((uint32_t)0x00000000) -#define FMC_BurstAccessMode_Enable ((uint32_t)0x00000100) +#define FMC_BurstAccessMode_Disable ((gU32)0x00000000) +#define FMC_BurstAccessMode_Enable ((gU32)0x00000100) #define IS_FMC_BURSTMODE(STATE) (((STATE) == FMC_BurstAccessMode_Disable) || \ ((STATE) == FMC_BurstAccessMode_Enable)) @@ -465,8 +465,8 @@ typedef struct /** @defgroup FMC_AsynchronousWait * @{ */ -#define FMC_AsynchronousWait_Disable ((uint32_t)0x00000000) -#define FMC_AsynchronousWait_Enable ((uint32_t)0x00008000) +#define FMC_AsynchronousWait_Disable ((gU32)0x00000000) +#define FMC_AsynchronousWait_Enable ((gU32)0x00008000) #define IS_FMC_ASYNWAIT(STATE) (((STATE) == FMC_AsynchronousWait_Disable) || \ ((STATE) == FMC_AsynchronousWait_Enable)) @@ -477,8 +477,8 @@ typedef struct /** @defgroup FMC_Wait_Signal_Polarity * @{ */ -#define FMC_WaitSignalPolarity_Low ((uint32_t)0x00000000) -#define FMC_WaitSignalPolarity_High ((uint32_t)0x00000200) +#define FMC_WaitSignalPolarity_Low ((gU32)0x00000000) +#define FMC_WaitSignalPolarity_High ((gU32)0x00000200) #define IS_FMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FMC_WaitSignalPolarity_Low) || \ ((POLARITY) == FMC_WaitSignalPolarity_High)) @@ -489,8 +489,8 @@ typedef struct /** @defgroup FMC_Wrap_Mode * @{ */ -#define FMC_WrapMode_Disable ((uint32_t)0x00000000) -#define FMC_WrapMode_Enable ((uint32_t)0x00000400) +#define FMC_WrapMode_Disable ((gU32)0x00000000) +#define FMC_WrapMode_Enable ((gU32)0x00000400) #define IS_FMC_WRAP_MODE(MODE) (((MODE) == FMC_WrapMode_Disable) || \ ((MODE) == FMC_WrapMode_Enable)) @@ -501,8 +501,8 @@ typedef struct /** @defgroup FMC_Wait_Timing * @{ */ -#define FMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000) -#define FMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800) +#define FMC_WaitSignalActive_BeforeWaitState ((gU32)0x00000000) +#define FMC_WaitSignalActive_DuringWaitState ((gU32)0x00000800) #define IS_FMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FMC_WaitSignalActive_BeforeWaitState) || \ ((ACTIVE) == FMC_WaitSignalActive_DuringWaitState)) @@ -513,8 +513,8 @@ typedef struct /** @defgroup FMC_Write_Operation * @{ */ -#define FMC_WriteOperation_Disable ((uint32_t)0x00000000) -#define FMC_WriteOperation_Enable ((uint32_t)0x00001000) +#define FMC_WriteOperation_Disable ((gU32)0x00000000) +#define FMC_WriteOperation_Enable ((gU32)0x00001000) #define IS_FMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FMC_WriteOperation_Disable) || \ ((OPERATION) == FMC_WriteOperation_Enable)) @@ -525,8 +525,8 @@ typedef struct /** @defgroup FMC_Wait_Signal * @{ */ -#define FMC_WaitSignal_Disable ((uint32_t)0x00000000) -#define FMC_WaitSignal_Enable ((uint32_t)0x00002000) +#define FMC_WaitSignal_Disable ((gU32)0x00000000) +#define FMC_WaitSignal_Enable ((gU32)0x00002000) #define IS_FMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FMC_WaitSignal_Disable) || \ ((SIGNAL) == FMC_WaitSignal_Enable)) @@ -537,8 +537,8 @@ typedef struct /** @defgroup FMC_Extended_Mode * @{ */ -#define FMC_ExtendedMode_Disable ((uint32_t)0x00000000) -#define FMC_ExtendedMode_Enable ((uint32_t)0x00004000) +#define FMC_ExtendedMode_Disable ((gU32)0x00000000) +#define FMC_ExtendedMode_Enable ((gU32)0x00004000) #define IS_FMC_EXTENDED_MODE(MODE) (((MODE) == FMC_ExtendedMode_Disable) || \ ((MODE) == FMC_ExtendedMode_Enable)) @@ -550,8 +550,8 @@ typedef struct * @{ */ -#define FMC_WriteBurst_Disable ((uint32_t)0x00000000) -#define FMC_WriteBurst_Enable ((uint32_t)0x00080000) +#define FMC_WriteBurst_Disable ((gU32)0x00000000) +#define FMC_WriteBurst_Enable ((gU32)0x00080000) #define IS_FMC_WRITE_BURST(BURST) (((BURST) == FMC_WriteBurst_Disable) || \ ((BURST) == FMC_WriteBurst_Enable)) @@ -563,8 +563,8 @@ typedef struct * @{ */ -#define FMC_CClock_SyncOnly ((uint32_t)0x00000000) -#define FMC_CClock_SyncAsync ((uint32_t)0x00100000) +#define FMC_CClock_SyncOnly ((gU32)0x00000000) +#define FMC_CClock_SyncAsync ((gU32)0x00100000) #define IS_FMC_CONTINOUS_CLOCK(CCLOCK) (((CCLOCK) == FMC_CClock_SyncOnly) || \ ((CCLOCK) == FMC_CClock_SyncAsync)) @@ -623,10 +623,10 @@ typedef struct /** @defgroup FMC_Access_Mode * @{ */ -#define FMC_AccessMode_A ((uint32_t)0x00000000) -#define FMC_AccessMode_B ((uint32_t)0x10000000) -#define FMC_AccessMode_C ((uint32_t)0x20000000) -#define FMC_AccessMode_D ((uint32_t)0x30000000) +#define FMC_AccessMode_A ((gU32)0x00000000) +#define FMC_AccessMode_B ((gU32)0x10000000) +#define FMC_AccessMode_C ((gU32)0x20000000) +#define FMC_AccessMode_D ((gU32)0x30000000) #define IS_FMC_ACCESS_MODE(MODE) (((MODE) == FMC_AccessMode_A) || \ ((MODE) == FMC_AccessMode_B) || \ @@ -647,8 +647,8 @@ typedef struct /** @defgroup FMC_Wait_feature * @{ */ -#define FMC_Waitfeature_Disable ((uint32_t)0x00000000) -#define FMC_Waitfeature_Enable ((uint32_t)0x00000002) +#define FMC_Waitfeature_Disable ((gU32)0x00000000) +#define FMC_Waitfeature_Enable ((gU32)0x00000002) #define IS_FMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FMC_Waitfeature_Disable) || \ ((FEATURE) == FMC_Waitfeature_Enable)) @@ -659,8 +659,8 @@ typedef struct /** @defgroup FMC_NAND_Data_Width * @{ */ -#define FMC_NAND_MemoryDataWidth_8b ((uint32_t)0x00000000) -#define FMC_NAND_MemoryDataWidth_16b ((uint32_t)0x00000010) +#define FMC_NAND_MemoryDataWidth_8b ((gU32)0x00000000) +#define FMC_NAND_MemoryDataWidth_16b ((gU32)0x00000010) #define IS_FMC_NAND_MEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_NAND_MemoryDataWidth_8b) || \ ((WIDTH) == FMC_NAND_MemoryDataWidth_16b)) @@ -671,8 +671,8 @@ typedef struct /** @defgroup FMC_ECC * @{ */ -#define FMC_ECC_Disable ((uint32_t)0x00000000) -#define FMC_ECC_Enable ((uint32_t)0x00000040) +#define FMC_ECC_Disable ((gU32)0x00000000) +#define FMC_ECC_Enable ((gU32)0x00000040) #define IS_FMC_ECC_STATE(STATE) (((STATE) == FMC_ECC_Disable) || \ ((STATE) == FMC_ECC_Enable)) @@ -683,12 +683,12 @@ typedef struct /** @defgroup FMC_ECC_Page_Size * @{ */ -#define FMC_ECCPageSize_256Bytes ((uint32_t)0x00000000) -#define FMC_ECCPageSize_512Bytes ((uint32_t)0x00020000) -#define FMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000) -#define FMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000) -#define FMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000) -#define FMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000) +#define FMC_ECCPageSize_256Bytes ((gU32)0x00000000) +#define FMC_ECCPageSize_512Bytes ((gU32)0x00020000) +#define FMC_ECCPageSize_1024Bytes ((gU32)0x00040000) +#define FMC_ECCPageSize_2048Bytes ((gU32)0x00060000) +#define FMC_ECCPageSize_4096Bytes ((gU32)0x00080000) +#define FMC_ECCPageSize_8192Bytes ((gU32)0x000A0000) #define IS_FMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FMC_ECCPageSize_256Bytes) || \ ((SIZE) == FMC_ECCPageSize_512Bytes) || \ @@ -760,10 +760,10 @@ typedef struct /** @defgroup FMC_ColumnBits_Number * @{ */ -#define FMC_ColumnBits_Number_8b ((uint32_t)0x00000000) -#define FMC_ColumnBits_Number_9b ((uint32_t)0x00000001) -#define FMC_ColumnBits_Number_10b ((uint32_t)0x00000002) -#define FMC_ColumnBits_Number_11b ((uint32_t)0x00000003) +#define FMC_ColumnBits_Number_8b ((gU32)0x00000000) +#define FMC_ColumnBits_Number_9b ((gU32)0x00000001) +#define FMC_ColumnBits_Number_10b ((gU32)0x00000002) +#define FMC_ColumnBits_Number_11b ((gU32)0x00000003) #define IS_FMC_COLUMNBITS_NUMBER(COLUMN) (((COLUMN) == FMC_ColumnBits_Number_8b) || \ ((COLUMN) == FMC_ColumnBits_Number_9b) || \ @@ -777,9 +777,9 @@ typedef struct /** @defgroup FMC_RowBits_Number * @{ */ -#define FMC_RowBits_Number_11b ((uint32_t)0x00000000) -#define FMC_RowBits_Number_12b ((uint32_t)0x00000004) -#define FMC_RowBits_Number_13b ((uint32_t)0x00000008) +#define FMC_RowBits_Number_11b ((gU32)0x00000000) +#define FMC_RowBits_Number_12b ((gU32)0x00000004) +#define FMC_RowBits_Number_13b ((gU32)0x00000008) #define IS_FMC_ROWBITS_NUMBER(ROW) (((ROW) == FMC_RowBits_Number_11b) || \ ((ROW) == FMC_RowBits_Number_12b) || \ @@ -792,9 +792,9 @@ typedef struct /** @defgroup FMC_SDMemory_Data_Width * @{ */ -#define FMC_SDMemory_Width_8b ((uint32_t)0x00000000) -#define FMC_SDMemory_Width_16b ((uint32_t)0x00000010) -#define FMC_SDMemory_Width_32b ((uint32_t)0x00000020) +#define FMC_SDMemory_Width_8b ((gU32)0x00000000) +#define FMC_SDMemory_Width_16b ((gU32)0x00000010) +#define FMC_SDMemory_Width_32b ((gU32)0x00000020) #define IS_FMC_SDMEMORY_WIDTH(WIDTH) (((WIDTH) == FMC_SDMemory_Width_8b) || \ ((WIDTH) == FMC_SDMemory_Width_16b) || \ @@ -807,8 +807,8 @@ typedef struct /** @defgroup FMC_InternalBank_Number * @{ */ -#define FMC_InternalBank_Number_2 ((uint32_t)0x00000000) -#define FMC_InternalBank_Number_4 ((uint32_t)0x00000040) +#define FMC_InternalBank_Number_2 ((gU32)0x00000000) +#define FMC_InternalBank_Number_4 ((gU32)0x00000040) #define IS_FMC_INTERNALBANK_NUMBER(NUMBER) (((NUMBER) == FMC_InternalBank_Number_2) || \ ((NUMBER) == FMC_InternalBank_Number_4)) @@ -821,9 +821,9 @@ typedef struct /** @defgroup FMC_CAS_Latency * @{ */ -#define FMC_CAS_Latency_1 ((uint32_t)0x00000080) -#define FMC_CAS_Latency_2 ((uint32_t)0x00000100) -#define FMC_CAS_Latency_3 ((uint32_t)0x00000180) +#define FMC_CAS_Latency_1 ((gU32)0x00000080) +#define FMC_CAS_Latency_2 ((gU32)0x00000100) +#define FMC_CAS_Latency_3 ((gU32)0x00000180) #define IS_FMC_CAS_LATENCY(LATENCY) (((LATENCY) == FMC_CAS_Latency_1) || \ ((LATENCY) == FMC_CAS_Latency_2) || \ @@ -836,8 +836,8 @@ typedef struct /** @defgroup FMC_Write_Protection * @{ */ -#define FMC_Write_Protection_Disable ((uint32_t)0x00000000) -#define FMC_Write_Protection_Enable ((uint32_t)0x00000200) +#define FMC_Write_Protection_Disable ((gU32)0x00000000) +#define FMC_Write_Protection_Enable ((gU32)0x00000200) #define IS_FMC_WRITE_PROTECTION(WRITE) (((WRITE) == FMC_Write_Protection_Disable) || \ ((WRITE) == FMC_Write_Protection_Enable)) @@ -850,9 +850,9 @@ typedef struct /** @defgroup FMC_SDClock_Period * @{ */ -#define FMC_SDClock_Disable ((uint32_t)0x00000000) -#define FMC_SDClock_Period_2 ((uint32_t)0x00000800) -#define FMC_SDClock_Period_3 ((uint32_t)0x00000C00) +#define FMC_SDClock_Disable ((gU32)0x00000000) +#define FMC_SDClock_Period_2 ((gU32)0x00000800) +#define FMC_SDClock_Period_3 ((gU32)0x00000C00) #define IS_FMC_SDCLOCK_PERIOD(PERIOD) (((PERIOD) == FMC_SDClock_Disable) || \ ((PERIOD) == FMC_SDClock_Period_2) || \ @@ -865,8 +865,8 @@ typedef struct /** @defgroup FMC_Read_Burst * @{ */ -#define FMC_Read_Burst_Disable ((uint32_t)0x00000000) -#define FMC_Read_Burst_Enable ((uint32_t)0x00001000) +#define FMC_Read_Burst_Disable ((gU32)0x00000000) +#define FMC_Read_Burst_Enable ((gU32)0x00001000) #define IS_FMC_READ_BURST(RBURST) (((RBURST) == FMC_Read_Burst_Disable) || \ ((RBURST) == FMC_Read_Burst_Enable)) @@ -878,9 +878,9 @@ typedef struct /** @defgroup FMC_ReadPipe_Delay * @{ */ -#define FMC_ReadPipe_Delay_0 ((uint32_t)0x00000000) -#define FMC_ReadPipe_Delay_1 ((uint32_t)0x00002000) -#define FMC_ReadPipe_Delay_2 ((uint32_t)0x00004000) +#define FMC_ReadPipe_Delay_0 ((gU32)0x00000000) +#define FMC_ReadPipe_Delay_1 ((gU32)0x00002000) +#define FMC_ReadPipe_Delay_2 ((gU32)0x00004000) #define IS_FMC_READPIPE_DELAY(DELAY) (((DELAY) == FMC_ReadPipe_Delay_0) || \ ((DELAY) == FMC_ReadPipe_Delay_1) || \ @@ -950,13 +950,13 @@ typedef struct /** @defgroup FMC_Command_Mode * @{ */ -#define FMC_Command_Mode_normal ((uint32_t)0x00000000) -#define FMC_Command_Mode_CLK_Enabled ((uint32_t)0x00000001) -#define FMC_Command_Mode_PALL ((uint32_t)0x00000002) -#define FMC_Command_Mode_AutoRefresh ((uint32_t)0x00000003) -#define FMC_Command_Mode_LoadMode ((uint32_t)0x00000004) -#define FMC_Command_Mode_Selfrefresh ((uint32_t)0x00000005) -#define FMC_Command_Mode_PowerDown ((uint32_t)0x00000006) +#define FMC_Command_Mode_normal ((gU32)0x00000000) +#define FMC_Command_Mode_CLK_Enabled ((gU32)0x00000001) +#define FMC_Command_Mode_PALL ((gU32)0x00000002) +#define FMC_Command_Mode_AutoRefresh ((gU32)0x00000003) +#define FMC_Command_Mode_LoadMode ((gU32)0x00000004) +#define FMC_Command_Mode_Selfrefresh ((gU32)0x00000005) +#define FMC_Command_Mode_PowerDown ((gU32)0x00000006) #define IS_FMC_COMMAND_MODE(COMMAND) (((COMMAND) == FMC_Command_Mode_normal) || \ ((COMMAND) == FMC_Command_Mode_CLK_Enabled) || \ @@ -973,9 +973,9 @@ typedef struct /** @defgroup FMC_Command_Target * @{ */ -#define FMC_Command_Target_bank2 ((uint32_t)0x00000008) -#define FMC_Command_Target_bank1 ((uint32_t)0x00000010) -#define FMC_Command_Target_bank1_2 ((uint32_t)0x00000018) +#define FMC_Command_Target_bank2 ((gU32)0x00000008) +#define FMC_Command_Target_bank1 ((gU32)0x00000010) +#define FMC_Command_Target_bank1_2 ((gU32)0x00000018) #define IS_FMC_COMMAND_TARGET(TARGET) (((TARGET) == FMC_Command_Target_bank1) || \ ((TARGET) == FMC_Command_Target_bank2) || \ @@ -1007,7 +1007,7 @@ typedef struct /** @defgroup FMC_Mode_Status * @{ */ -#define FMC_NormalMode_Status ((uint32_t)0x00000000) +#define FMC_NormalMode_Status ((gU32)0x00000000) #define FMC_SelfRefreshMode_Status FMC_SDSR_MODES1_0 #define FMC_PowerDownMode_Status FMC_SDSR_MODES1_1 @@ -1027,12 +1027,12 @@ typedef struct /** @defgroup FMC_Interrupt_sources * @{ */ -#define FMC_IT_RisingEdge ((uint32_t)0x00000008) -#define FMC_IT_Level ((uint32_t)0x00000010) -#define FMC_IT_FallingEdge ((uint32_t)0x00000020) -#define FMC_IT_Refresh ((uint32_t)0x00004000) +#define FMC_IT_RisingEdge ((gU32)0x00000008) +#define FMC_IT_Level ((gU32)0x00000010) +#define FMC_IT_FallingEdge ((gU32)0x00000020) +#define FMC_IT_Refresh ((gU32)0x00004000) -#define IS_FMC_IT(IT) ((((IT) & (uint32_t)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000)) +#define IS_FMC_IT(IT) ((((IT) & (gU32)0xFFFFBFC7) == 0x00000000) && ((IT) != 0x00000000)) #define IS_FMC_GET_IT(IT) (((IT) == FMC_IT_RisingEdge) || \ ((IT) == FMC_IT_Level) || \ ((IT) == FMC_IT_FallingEdge) || \ @@ -1050,10 +1050,10 @@ typedef struct /** @defgroup FMC_Flags * @{ */ -#define FMC_FLAG_RisingEdge ((uint32_t)0x00000001) -#define FMC_FLAG_Level ((uint32_t)0x00000002) -#define FMC_FLAG_FallingEdge ((uint32_t)0x00000004) -#define FMC_FLAG_FEMPT ((uint32_t)0x00000040) +#define FMC_FLAG_RisingEdge ((gU32)0x00000001) +#define FMC_FLAG_Level ((gU32)0x00000002) +#define FMC_FLAG_FallingEdge ((gU32)0x00000004) +#define FMC_FLAG_FEMPT ((gU32)0x00000040) #define FMC_FLAG_Refresh FMC_SDSR_RE #define FMC_FLAG_Busy FMC_SDSR_BUSY @@ -1071,7 +1071,7 @@ typedef struct ((BANK) == FMC_Bank2_SDRAM) || \ ((BANK) == (FMC_Bank1_SDRAM | FMC_Bank2_SDRAM))) -#define IS_FMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000)) +#define IS_FMC_CLEAR_FLAG(FLAG) ((((FLAG) & (gU32)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000)) /** @@ -1096,18 +1096,18 @@ typedef struct /* Exported functions --------------------------------------------------------*/ /* NOR/SRAM Controller functions **********************************************/ -void FMC_NORSRAMDeInit(uint32_t FMC_Bank); +void FMC_NORSRAMDeInit(gU32 FMC_Bank); void FMC_NORSRAMInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct); void FMC_NORSRAMStructInit(FMC_NORSRAMInitTypeDef* FMC_NORSRAMInitStruct); -void FMC_NORSRAMCmd(uint32_t FMC_Bank, FunctionalState NewState); +void FMC_NORSRAMCmd(gU32 FMC_Bank, FunctionalState NewState); /* NAND Controller functions **************************************************/ -void FMC_NANDDeInit(uint32_t FMC_Bank); +void FMC_NANDDeInit(gU32 FMC_Bank); void FMC_NANDInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct); void FMC_NANDStructInit(FMC_NANDInitTypeDef* FMC_NANDInitStruct); -void FMC_NANDCmd(uint32_t FMC_Bank, FunctionalState NewState); -void FMC_NANDECCCmd(uint32_t FMC_Bank, FunctionalState NewState); -uint32_t FMC_GetECC(uint32_t FMC_Bank); +void FMC_NANDCmd(gU32 FMC_Bank, FunctionalState NewState); +void FMC_NANDECCCmd(gU32 FMC_Bank, FunctionalState NewState); +gU32 FMC_GetECC(gU32 FMC_Bank); /* PCCARD Controller functions ************************************************/ void FMC_PCCARDDeInit(void); @@ -1116,21 +1116,21 @@ void FMC_PCCARDStructInit(FMC_PCCARDInitTypeDef* FMC_PCCARDInitStruct); void FMC_PCCARDCmd(FunctionalState NewState); /* SDRAM Controller functions ************************************************/ -void FMC_SDRAMDeInit(uint32_t FMC_Bank); +void FMC_SDRAMDeInit(gU32 FMC_Bank); void FMC_SDRAMInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct); void FMC_SDRAMStructInit(FMC_SDRAMInitTypeDef* FMC_SDRAMInitStruct); void FMC_SDRAMCmdConfig(FMC_SDRAMCommandTypeDef* FMC_SDRAMCommandStruct); -uint32_t FMC_GetModeStatus(uint32_t SDRAM_Bank); -void FMC_SetRefreshCount(uint32_t FMC_Count); -void FMC_SetAutoRefresh_Number(uint32_t FMC_Number); -void FMC_SDRAMWriteProtectionConfig(uint32_t SDRAM_Bank, FunctionalState NewState); +gU32 FMC_GetModeStatus(gU32 SDRAM_Bank); +void FMC_SetRefreshCount(gU32 FMC_Count); +void FMC_SetAutoRefresh_Number(gU32 FMC_Number); +void FMC_SDRAMWriteProtectionConfig(gU32 SDRAM_Bank, FunctionalState NewState); /* Interrupts and flags management functions **********************************/ -void FMC_ITConfig(uint32_t FMC_Bank, uint32_t FMC_IT, FunctionalState NewState); -FlagStatus FMC_GetFlagStatus(uint32_t FMC_Bank, uint32_t FMC_FLAG); -void FMC_ClearFlag(uint32_t FMC_Bank, uint32_t FMC_FLAG); -ITStatus FMC_GetITStatus(uint32_t FMC_Bank, uint32_t FMC_IT); -void FMC_ClearITPendingBit(uint32_t FMC_Bank, uint32_t FMC_IT); +void FMC_ITConfig(gU32 FMC_Bank, gU32 FMC_IT, FunctionalState NewState); +FlagStatus FMC_GetFlagStatus(gU32 FMC_Bank, gU32 FMC_FLAG); +void FMC_ClearFlag(gU32 FMC_Bank, gU32 FMC_FLAG); +ITStatus FMC_GetITStatus(gU32 FMC_Bank, gU32 FMC_IT); +void FMC_ClearITPendingBit(gU32 FMC_Bank, gU32 FMC_IT); #ifdef __cplusplus } diff --git a/boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h b/boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h index 6c2daff8..d598efac 100644 --- a/boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h +++ b/boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h @@ -153,7 +153,7 @@ static GFXINLINE void post_init_board(GDisplay* g) (void) g; } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { (void) g; (void) percent; diff --git a/boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h b/boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h index b5221244..380ac0ed 100644 --- a/boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h +++ b/boards/base/STM32F439i-Eval/CubeHal/gmouse_lld_EXC7200_board.h @@ -82,12 +82,12 @@ static gBool init_board(GMouse* m, unsigned driverinstance) return gTrue; } -static gBool read_bytes(GMouse* m, uint8_t reg, uint8_t* buffer, uint8_t nbrBytes) +static gBool read_bytes(GMouse* m, gU8 reg, gU8* buffer, gU8 nbrBytes) { (void)m; - HAL_I2C_Master_Transmit(&_i2cHandle, (uint16_t)EXC7200_SLAVE_ADDR, (uint8_t*)®, 1, 10000); - HAL_I2C_Master_Receive(&_i2cHandle, (uint16_t)EXC7200_SLAVE_ADDR, buffer, nbrBytes, 10000); + HAL_I2C_Master_Transmit(&_i2cHandle, (gU16)EXC7200_SLAVE_ADDR, (gU8*)®, 1, 10000); + HAL_I2C_Master_Receive(&_i2cHandle, (gU16)EXC7200_SLAVE_ADDR, buffer, nbrBytes, 10000); return gTrue; } diff --git a/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.c b/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.c index 65b78a76..b2cbda39 100644 --- a/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.c +++ b/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.c @@ -144,9 +144,9 @@ static void SDRAM_MspInit(void); * @brief Initializes the SDRAM device. * @retval SDRAM status */ -uint8_t BSP_SDRAM_Init(void) +gU8 BSP_SDRAM_Init(void) { - static uint8_t sdramstatus = SDRAM_ERROR; + static gU8 sdramstatus = SDRAM_ERROR; /* SDRAM device configuration */ sdramHandle.Instance = FMC_SDRAM_DEVICE; @@ -191,9 +191,9 @@ uint8_t BSP_SDRAM_Init(void) * @brief Programs the SDRAM device. * @param RefreshCount: SDRAM refresh counter value */ -void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) +void BSP_SDRAM_Initialization_sequence(gU32 RefreshCount) { - __IO uint32_t tmpmrd = 0; + __IO gU32 tmpmrd = 0; /* Step 1: Configure a clock configuration enable command */ Command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE; @@ -227,7 +227,7 @@ void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT); /* Step 5: Program the external memory mode register */ - tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1 |\ + tmpmrd = (gU32)SDRAM_MODEREG_BURST_LENGTH_1 |\ SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL |\ SDRAM_MODEREG_CAS_LATENCY_3 |\ SDRAM_MODEREG_OPERATING_MODE_STANDARD |\ @@ -253,9 +253,9 @@ void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) * @param uwDataSize: Size of read data from the memory * @retval SDRAM status */ -uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_ReadData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Read_32b(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -272,9 +272,9 @@ uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uw * @param uwDataSize: Size of read data from the memory * @retval SDRAM status */ -uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_ReadData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Read_DMA(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -291,9 +291,9 @@ uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_ * @param uwDataSize: Size of written data from the memory * @retval SDRAM status */ -uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_WriteData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Write_32b(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -310,9 +310,9 @@ uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t u * @param uwDataSize: Size of written data from the memory * @retval SDRAM status */ -uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_WriteData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Write_DMA(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -327,7 +327,7 @@ uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32 * @param SdramCmd: Pointer to SDRAM command structure * @retval HAL status */ -uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd) +gU8 BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd) { if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK) { diff --git a/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.h b/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.h index 0f572a03..09d5c3ac 100644 --- a/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.h +++ b/boards/base/STM32F439i-Eval/CubeHal/stm324x9i_eval_sdram.h @@ -82,8 +82,8 @@ /** @defgroup STM324x9I_EVAL_SDRAM_Exported_Constants STM324x9I EVAL SDRAM Exported Constants * @{ */ -#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000) -#define SDRAM_DEVICE_SIZE ((uint32_t)0x800000) /* SDRAM device size in MBytes */ +#define SDRAM_DEVICE_ADDR ((gU32)0xC0000000) +#define SDRAM_DEVICE_SIZE ((gU32)0x800000) /* SDRAM device size in MBytes */ /* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_8 */ /* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16 */ @@ -92,9 +92,9 @@ #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2 /* #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_3 */ -#define REFRESH_COUNT ((uint32_t)0x0569) /* SDRAM refresh counter (90Mhz SD clock) */ +#define REFRESH_COUNT ((gU32)0x0569) /* SDRAM refresh counter (90Mhz SD clock) */ -#define SDRAM_TIMEOUT ((uint32_t)0xFFFF) +#define SDRAM_TIMEOUT ((gU32)0xFFFF) /* DMA definitions for SDRAM DMA transfer */ #define __DMAx_CLK_ENABLE __DMA2_CLK_ENABLE @@ -106,17 +106,17 @@ /** * @brief FMC SDRAM Mode definition register defines */ -#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001) -#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002) -#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004) -#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008) -#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020) -#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030) -#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) +#define SDRAM_MODEREG_BURST_LENGTH_1 ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_LENGTH_2 ((gU16)0x0001) +#define SDRAM_MODEREG_BURST_LENGTH_4 ((gU16)0x0002) +#define SDRAM_MODEREG_BURST_LENGTH_8 ((gU16)0x0004) +#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((gU16)0x0008) +#define SDRAM_MODEREG_CAS_LATENCY_2 ((gU16)0x0020) +#define SDRAM_MODEREG_CAS_LATENCY_3 ((gU16)0x0030) +#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((gU16)0x0200) /** * @} */ @@ -131,13 +131,13 @@ /** @defgroup STM324x9I_EVAL_SDRAM_Exported_Functions STM324x9I EVAL SDRAM Exported Functions * @{ */ -uint8_t BSP_SDRAM_Init(void); -void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount); -uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd); +gU8 BSP_SDRAM_Init(void); +void BSP_SDRAM_Initialization_sequence(gU32 RefreshCount); +gU8 BSP_SDRAM_ReadData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_ReadData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_WriteData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_WriteData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd); void BSP_SDRAM_DMA_IRQHandler(void); /** diff --git a/boards/base/STM32F439i-Eval/CubeHal/stm32f439i_raw32_system.c b/boards/base/STM32F439i-Eval/CubeHal/stm32f439i_raw32_system.c index 63df499b..76771e8e 100644 --- a/boards/base/STM32F439i-Eval/CubeHal/stm32f439i_raw32_system.c +++ b/boards/base/STM32F439i-Eval/CubeHal/stm32f439i_raw32_system.c @@ -71,11 +71,11 @@ #include "stm32f4xx.h" #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */ + #define HSE_VALUE ((gU32)8000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE ((gU32)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** @@ -135,8 +135,8 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 16000000; - __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + gU32 SystemCoreClock = 16000000; + __I gU8 AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @} @@ -173,19 +173,19 @@ void SystemInit(void) #endif /* Reset the RCC clock configuration to the default reset state ------------*/ /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001; + RCC->CR |= (gU32)0x00000001; /* Reset CFGR register */ RCC->CFGR = 0x00000000; /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFF; + RCC->CR &= (gU32)0xFEF6FFFF; /* Reset PLLCFGR register */ RCC->PLLCFGR = 0x24003010; /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFF; + RCC->CR &= (gU32)0xFFFBFFFF; /* Disable all interrupts */ RCC->CIR = 0x00000000; @@ -240,7 +240,7 @@ void SystemInit(void) */ void SystemCoreClockUpdate(void) { - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; + gU32 tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -299,10 +299,10 @@ void SystemCoreClockUpdate(void) */ void SystemInit_ExtMemCtl(void) { - __IO uint32_t tmp = 0x00; + __IO gU32 tmp = 0x00; - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; + register gU32 tmpreg = 0, timeout = 0xFFFF; + register __IO gU32 index; /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ RCC->AHB1ENR |= 0x000001F8; @@ -464,8 +464,8 @@ void SystemInit_ExtMemCtl(void) { #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) #if defined (DATA_IN_ExtSDRAM) - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; + register gU32 tmpreg = 0, timeout = 0xFFFF; + register __IO gU32 index; /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ diff --git a/boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h b/boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h index 59555bba..1571966b 100644 --- a/boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h +++ b/boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h @@ -118,7 +118,7 @@ static GFXINLINE void init_board(GDisplay *g) { dsiHandle.Instance = DSI; // There is only one DSI interface dsiHandle.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_ENABLE; // Automatic clock lane control: powers down the clock lane when not in use /* Highest speed = 500MHz. */ - uint16_t laneByteClk_kHz = 62500; /* 500 MHz / 8 = 62.5 MHz = 62500 kHz */ + gU16 laneByteClk_kHz = 62500; /* 500 MHz / 8 = 62.5 MHz = 62500 kHz */ /* TXEscapeCkdiv = f(LaneByteClk)/15.62 = 4 -> 500MHz/4 = 25MHz datasheet says around 20MHz */ dsiHandle.Init.TXEscapeCkdiv = laneByteClk_kHz/15620; // Low power clock relative to the laneByteClock dsiHandle.Init.NumberOfLanes = DSI_TWO_DATA_LANES; // Two data lines for the fastest transfer speed @@ -201,7 +201,7 @@ static GFXINLINE void init_board(GDisplay *g) { BSP_SDRAM_Init(); } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { (void)g; (void)percent; @@ -287,7 +287,7 @@ static GFXINLINE void post_init_board(GDisplay* g) * @param pParams: Pointer to parameter values table. * @retval HAL status */ -void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams) +void DSI_IO_WriteCmd(gU32 NbrParams, gU8 *pParams) { if(NbrParams <= 1) { @@ -304,7 +304,7 @@ void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams) * * @param Delay: The requested delay in ms. */ -void OTM8009A_IO_Delay(uint32_t Delay) +void OTM8009A_IO_Delay(gU32 Delay) { gfxSleepMilliseconds(Delay); } diff --git a/boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h b/boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h index c51514a5..d185f3ad 100644 --- a/boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h +++ b/boards/base/STM32F469i-Discovery/CubeHAL/gmouse_lld_FT6x06_board.h @@ -82,26 +82,26 @@ static GFXINLINE void release_bus(GMouse* m) { (void)m; } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { (void)m; - HAL_I2C_Mem_Write(&i2cHandle, FT6x06_SLAVE_ADDR, (uint16_t)reg, I2C_MEMADD_SIZE_8BIT, &val, 1, 1000); + HAL_I2C_Mem_Write(&i2cHandle, FT6x06_SLAVE_ADDR, (gU16)reg, I2C_MEMADD_SIZE_8BIT, &val, 1, 1000); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { (void)m; - uint8_t result; + gU8 result; - HAL_I2C_Mem_Read(&i2cHandle, FT6x06_SLAVE_ADDR, (uint16_t)reg, I2C_MEMADD_SIZE_8BIT, &result, 1, 1000); + HAL_I2C_Mem_Read(&i2cHandle, FT6x06_SLAVE_ADDR, (gU16)reg, I2C_MEMADD_SIZE_8BIT, &result, 1, 1000); return result; } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { (void)m; - uint8_t result[2]; + gU8 result[2]; - HAL_I2C_Mem_Read(&i2cHandle, FT6x06_SLAVE_ADDR, (uint16_t)reg, I2C_MEMADD_SIZE_8BIT, result, 2, 1000); + HAL_I2C_Mem_Read(&i2cHandle, FT6x06_SLAVE_ADDR, (gU16)reg, I2C_MEMADD_SIZE_8BIT, result, 2, 1000); return (result[0]<<8 | result[1]); diff --git a/boards/base/STM32F469i-Discovery/otm8009a.c b/boards/base/STM32F469i-Discovery/otm8009a.c index d408efe6..e830d53a 100644 --- a/boards/base/STM32F469i-Discovery/otm8009a.c +++ b/boards/base/STM32F469i-Discovery/otm8009a.c @@ -64,31 +64,31 @@ * @brief Constant tables of register settings used to transmit DSI * command packets as power up initialization sequence of the KoD LCD (OTM8009A LCD Driver) */ -const uint8_t lcdRegData1[] = {0x80,0x09,0x01,0xFF}; -const uint8_t lcdRegData2[] = {0x80,0x09,0xFF}; -const uint8_t lcdRegData3[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE1}; -const uint8_t lcdRegData4[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE2}; -const uint8_t lcdRegData5[] = {0x79,0x79,0xD8}; -const uint8_t lcdRegData6[] = {0x00,0x01,0xB3}; -const uint8_t lcdRegData7[] = {0x85,0x01,0x00,0x84,0x01,0x00,0xCE}; -const uint8_t lcdRegData8[] = {0x18,0x04,0x03,0x39,0x00,0x00,0x00,0x18,0x03,0x03,0x3A,0x00,0x00,0x00,0xCE}; -const uint8_t lcdRegData9[] = {0x18,0x02,0x03,0x3B,0x00,0x00,0x00,0x18,0x01,0x03,0x3C,0x00,0x00,0x00,0xCE}; -const uint8_t lcdRegData10[] = {0x01,0x01,0x20,0x20,0x00,0x00,0x01,0x02,0x00,0x00,0xCF}; -const uint8_t lcdRegData11[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData12[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData13[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData14[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData15[] = {0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData16[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData17[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; -const uint8_t lcdRegData18[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB}; -const uint8_t lcdRegData19[] = {0x00,0x26,0x09,0x0B,0x01,0x25,0x00,0x00,0x00,0x00,0xCC}; -const uint8_t lcdRegData20[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0A,0x0C,0x02,0xCC}; -const uint8_t lcdRegData21[] = {0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC}; -const uint8_t lcdRegData22[] = {0x00,0x25,0x0C,0x0A,0x02,0x26,0x00,0x00,0x00,0x00,0xCC}; -const uint8_t lcdRegData23[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x0B,0x09,0x01,0xCC}; -const uint8_t lcdRegData24[] = {0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC}; -const uint8_t lcdRegData25[] = {0xFF,0xFF,0xFF,0xFF}; +const gU8 lcdRegData1[] = {0x80,0x09,0x01,0xFF}; +const gU8 lcdRegData2[] = {0x80,0x09,0xFF}; +const gU8 lcdRegData3[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE1}; +const gU8 lcdRegData4[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE2}; +const gU8 lcdRegData5[] = {0x79,0x79,0xD8}; +const gU8 lcdRegData6[] = {0x00,0x01,0xB3}; +const gU8 lcdRegData7[] = {0x85,0x01,0x00,0x84,0x01,0x00,0xCE}; +const gU8 lcdRegData8[] = {0x18,0x04,0x03,0x39,0x00,0x00,0x00,0x18,0x03,0x03,0x3A,0x00,0x00,0x00,0xCE}; +const gU8 lcdRegData9[] = {0x18,0x02,0x03,0x3B,0x00,0x00,0x00,0x18,0x01,0x03,0x3C,0x00,0x00,0x00,0xCE}; +const gU8 lcdRegData10[] = {0x01,0x01,0x20,0x20,0x00,0x00,0x01,0x02,0x00,0x00,0xCF}; +const gU8 lcdRegData11[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData12[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData13[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData14[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData15[] = {0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData16[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData17[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB}; +const gU8 lcdRegData18[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB}; +const gU8 lcdRegData19[] = {0x00,0x26,0x09,0x0B,0x01,0x25,0x00,0x00,0x00,0x00,0xCC}; +const gU8 lcdRegData20[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0A,0x0C,0x02,0xCC}; +const gU8 lcdRegData21[] = {0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC}; +const gU8 lcdRegData22[] = {0x00,0x25,0x0C,0x0A,0x02,0x26,0x00,0x00,0x00,0x00,0xCC}; +const gU8 lcdRegData23[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x0B,0x09,0x01,0xCC}; +const gU8 lcdRegData24[] = {0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC}; +const gU8 lcdRegData25[] = {0xFF,0xFF,0xFF,0xFF}; /* * CASET value (Column Address Set) : X direction LCD GRAM boundaries * depending on LCD orientation mode and PASET value (Page Address Set) : Y direction @@ -96,65 +96,65 @@ const uint8_t lcdRegData25[] = {0xFF,0xFF,0xFF,0xFF}; * XS[15:0] = 0x000 = 0, XE[15:0] = 0x31F = 799 for landscape mode : apply to CASET * YS[15:0] = 0x000 = 0, YE[15:0] = 0x31F = 799 for portrait mode : : apply to PASET */ -const uint8_t lcdRegData27[] = {0x00, 0x00, 0x03, 0x1F, OTM8009A_CMD_CASET}; +const gU8 lcdRegData27[] = {0x00, 0x00, 0x03, 0x1F, OTM8009A_CMD_CASET}; /* * XS[15:0] = 0x000 = 0, XE[15:0] = 0x1DF = 479 for portrait mode : apply to CASET * YS[15:0] = 0x000 = 0, YE[15:0] = 0x1DF = 479 for landscape mode : apply to PASET */ -const uint8_t lcdRegData28[] = {0x00, 0x00, 0x01, 0xDF, OTM8009A_CMD_PASET}; +const gU8 lcdRegData28[] = {0x00, 0x00, 0x01, 0xDF, OTM8009A_CMD_PASET}; -const uint8_t ShortRegData1[] = {OTM8009A_CMD_NOP, 0x00}; -const uint8_t ShortRegData2[] = {OTM8009A_CMD_NOP, 0x80}; -const uint8_t ShortRegData3[] = {0xC4, 0x30}; -const uint8_t ShortRegData4[] = {OTM8009A_CMD_NOP, 0x8A}; -const uint8_t ShortRegData5[] = {0xC4, 0x40}; -const uint8_t ShortRegData6[] = {OTM8009A_CMD_NOP, 0xB1}; -const uint8_t ShortRegData7[] = {0xC5, 0xA9}; -const uint8_t ShortRegData8[] = {OTM8009A_CMD_NOP, 0x91}; -const uint8_t ShortRegData9[] = {0xC5, 0x34}; -const uint8_t ShortRegData10[] = {OTM8009A_CMD_NOP, 0xB4}; -const uint8_t ShortRegData11[] = {0xC0, 0x50}; -const uint8_t ShortRegData12[] = {0xD9, 0x4E}; -const uint8_t ShortRegData13[] = {OTM8009A_CMD_NOP, 0x81}; -const uint8_t ShortRegData14[] = {0xC1, 0x66}; -const uint8_t ShortRegData15[] = {OTM8009A_CMD_NOP, 0xA1}; -const uint8_t ShortRegData16[] = {0xC1, 0x08}; -const uint8_t ShortRegData17[] = {OTM8009A_CMD_NOP, 0x92}; -const uint8_t ShortRegData18[] = {0xC5, 0x01}; -const uint8_t ShortRegData19[] = {OTM8009A_CMD_NOP, 0x95}; -const uint8_t ShortRegData20[] = {OTM8009A_CMD_NOP, 0x94}; -const uint8_t ShortRegData21[] = {0xC5, 0x33}; -const uint8_t ShortRegData22[] = {OTM8009A_CMD_NOP, 0xA3}; -const uint8_t ShortRegData23[] = {0xC0, 0x1B}; -const uint8_t ShortRegData24[] = {OTM8009A_CMD_NOP, 0x82}; -const uint8_t ShortRegData25[] = {0xC5, 0x83}; -const uint8_t ShortRegData26[] = {0xC4, 0x83}; -const uint8_t ShortRegData27[] = {0xC1, 0x0E}; -const uint8_t ShortRegData28[] = {OTM8009A_CMD_NOP, 0xA6}; -const uint8_t ShortRegData29[] = {OTM8009A_CMD_NOP, 0xA0}; -const uint8_t ShortRegData30[] = {OTM8009A_CMD_NOP, 0xB0}; -const uint8_t ShortRegData31[] = {OTM8009A_CMD_NOP, 0xC0}; -const uint8_t ShortRegData32[] = {OTM8009A_CMD_NOP, 0xD0}; -const uint8_t ShortRegData33[] = {OTM8009A_CMD_NOP, 0x90}; -const uint8_t ShortRegData34[] = {OTM8009A_CMD_NOP, 0xE0}; -const uint8_t ShortRegData35[] = {OTM8009A_CMD_NOP, 0xF0}; -const uint8_t ShortRegData36[] = {OTM8009A_CMD_SLPOUT, 0x00}; -const uint8_t ShortRegData37[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB565}; -const uint8_t ShortRegData38[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB888}; -const uint8_t ShortRegData39[] = {OTM8009A_CMD_MADCTR, OTM8009A_MADCTR_MODE_LANDSCAPE}; -const uint8_t ShortRegData40[] = {OTM8009A_CMD_WRDISBV, 0x7F}; -const uint8_t ShortRegData41[] = {OTM8009A_CMD_WRCTRLD, 0x2C}; -const uint8_t ShortRegData42[] = {OTM8009A_CMD_WRCABC, 0x02}; -const uint8_t ShortRegData43[] = {OTM8009A_CMD_WRCABCMB, 0xFF}; -const uint8_t ShortRegData44[] = {OTM8009A_CMD_DISPON, 0x00}; -const uint8_t ShortRegData45[] = {OTM8009A_CMD_RAMWR, 0x00}; -const uint8_t ShortRegData46[] = {0xCF, 0x00}; -const uint8_t ShortRegData47[] = {0xC5, 0x66}; -const uint8_t ShortRegData48[] = {OTM8009A_CMD_NOP, 0xB6}; -const uint8_t ShortRegData49[] = {0xF5, 0x06}; -const uint8_t ShortRegData50[] = {OTM8009A_CMD_NOP, 0xB1}; -const uint8_t ShortRegData51[] = {0xC6, 0x06}; +const gU8 ShortRegData1[] = {OTM8009A_CMD_NOP, 0x00}; +const gU8 ShortRegData2[] = {OTM8009A_CMD_NOP, 0x80}; +const gU8 ShortRegData3[] = {0xC4, 0x30}; +const gU8 ShortRegData4[] = {OTM8009A_CMD_NOP, 0x8A}; +const gU8 ShortRegData5[] = {0xC4, 0x40}; +const gU8 ShortRegData6[] = {OTM8009A_CMD_NOP, 0xB1}; +const gU8 ShortRegData7[] = {0xC5, 0xA9}; +const gU8 ShortRegData8[] = {OTM8009A_CMD_NOP, 0x91}; +const gU8 ShortRegData9[] = {0xC5, 0x34}; +const gU8 ShortRegData10[] = {OTM8009A_CMD_NOP, 0xB4}; +const gU8 ShortRegData11[] = {0xC0, 0x50}; +const gU8 ShortRegData12[] = {0xD9, 0x4E}; +const gU8 ShortRegData13[] = {OTM8009A_CMD_NOP, 0x81}; +const gU8 ShortRegData14[] = {0xC1, 0x66}; +const gU8 ShortRegData15[] = {OTM8009A_CMD_NOP, 0xA1}; +const gU8 ShortRegData16[] = {0xC1, 0x08}; +const gU8 ShortRegData17[] = {OTM8009A_CMD_NOP, 0x92}; +const gU8 ShortRegData18[] = {0xC5, 0x01}; +const gU8 ShortRegData19[] = {OTM8009A_CMD_NOP, 0x95}; +const gU8 ShortRegData20[] = {OTM8009A_CMD_NOP, 0x94}; +const gU8 ShortRegData21[] = {0xC5, 0x33}; +const gU8 ShortRegData22[] = {OTM8009A_CMD_NOP, 0xA3}; +const gU8 ShortRegData23[] = {0xC0, 0x1B}; +const gU8 ShortRegData24[] = {OTM8009A_CMD_NOP, 0x82}; +const gU8 ShortRegData25[] = {0xC5, 0x83}; +const gU8 ShortRegData26[] = {0xC4, 0x83}; +const gU8 ShortRegData27[] = {0xC1, 0x0E}; +const gU8 ShortRegData28[] = {OTM8009A_CMD_NOP, 0xA6}; +const gU8 ShortRegData29[] = {OTM8009A_CMD_NOP, 0xA0}; +const gU8 ShortRegData30[] = {OTM8009A_CMD_NOP, 0xB0}; +const gU8 ShortRegData31[] = {OTM8009A_CMD_NOP, 0xC0}; +const gU8 ShortRegData32[] = {OTM8009A_CMD_NOP, 0xD0}; +const gU8 ShortRegData33[] = {OTM8009A_CMD_NOP, 0x90}; +const gU8 ShortRegData34[] = {OTM8009A_CMD_NOP, 0xE0}; +const gU8 ShortRegData35[] = {OTM8009A_CMD_NOP, 0xF0}; +const gU8 ShortRegData36[] = {OTM8009A_CMD_SLPOUT, 0x00}; +const gU8 ShortRegData37[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB565}; +const gU8 ShortRegData38[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB888}; +const gU8 ShortRegData39[] = {OTM8009A_CMD_MADCTR, OTM8009A_MADCTR_MODE_LANDSCAPE}; +const gU8 ShortRegData40[] = {OTM8009A_CMD_WRDISBV, 0x7F}; +const gU8 ShortRegData41[] = {OTM8009A_CMD_WRCTRLD, 0x2C}; +const gU8 ShortRegData42[] = {OTM8009A_CMD_WRCABC, 0x02}; +const gU8 ShortRegData43[] = {OTM8009A_CMD_WRCABCMB, 0xFF}; +const gU8 ShortRegData44[] = {OTM8009A_CMD_DISPON, 0x00}; +const gU8 ShortRegData45[] = {OTM8009A_CMD_RAMWR, 0x00}; +const gU8 ShortRegData46[] = {0xCF, 0x00}; +const gU8 ShortRegData47[] = {0xC5, 0x66}; +const gU8 ShortRegData48[] = {OTM8009A_CMD_NOP, 0xB6}; +const gU8 ShortRegData49[] = {0xF5, 0x06}; +const gU8 ShortRegData50[] = {OTM8009A_CMD_NOP, 0xB1}; +const gU8 ShortRegData51[] = {0xC6, 0x06}; /** * @} */ @@ -178,7 +178,7 @@ const uint8_t ShortRegData51[] = {0xC6, 0x06}; * @brief DSI IO write short/long command. * @note : Can be surcharged by application code implementation of the function. */ -__weak void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams) +__weak void DSI_IO_WriteCmd(gU32 NbrParams, gU8 *pParams) { /* NOTE : This function Should not be modified, when it is needed, the DSI_IO_WriteCmd could be implemented in the user file @@ -192,194 +192,194 @@ __weak void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams) * @param hdsivideo_handle : pointer on DSI video mode configuration structure * @retval Status */ -uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation) +gU8 OTM8009A_Init(gU32 ColorCoding, gU32 orientation) { /* Enable CMD2 to access vendor specific commands */ /* Enter in command 2 mode and set EXTC to enable address shift function (0x00) */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData1); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd( 3, (gU8 *)lcdRegData1); /* Enter ORISE Command 2 */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); /* Shift address to 0x80 */ - DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData2); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData2); /* Shift address to 0x80 */ + DSI_IO_WriteCmd( 2, (gU8 *)lcdRegData2); ///////////////////////////////////////////////////////////////////// /* SD_PCH_CTRL - 0xC480h - 129th parameter - Default 0x00 */ /* Set SD_PT */ /* -> Source output level during porch and non-display area to GND */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData3); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData2); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData3); OTM8009A_IO_Delay(10); /* Not documented */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData4); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData5); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData4); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData5); OTM8009A_IO_Delay(10); ///////////////////////////////////////////////////////////////////// /* PWR_CTRL4 - 0xC4B0h - 178th parameter - Default 0xA8 */ /* Set gvdd_en_test */ /* -> enable GVDD test mode !!! */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData6); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData7); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData6); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData7); /* PWR_CTRL2 - 0xC590h - 146th parameter - Default 0x79 */ /* Set pump 4 vgh voltage */ /* -> from 15.0v down to 13.0v */ /* Set pump 5 vgh voltage */ /* -> from -12.0v downto -9.0v */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData8); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData8); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData9); /* P_DRV_M - 0xC0B4h - 181th parameter - Default 0x00 */ /* -> Column inversion */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData10); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData11); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData10); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData11); /* VCOMDC - 0xD900h - 1st parameter - Default 0x39h */ /* VCOM Voltage settings */ /* -> from -1.0000v downto -1.2625v */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData12); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData12); /* Oscillator adjustment for Idle/Normal mode (LPDT only) set to 65Hz (default is 60Hz) */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData14); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData13); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData14); /* Video mode internal */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData16); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData15); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData16); /* PWR_CTRL2 - 0xC590h - 147h parameter - Default 0x00 */ /* Set pump 4&5 x6 */ /* -> ONLY VALID when PUMP4_EN_ASDM_HV = "0" */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData17); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData18); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData17); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData18); /* PWR_CTRL2 - 0xC590h - 150th parameter - Default 0x33h */ /* Change pump4 clock ratio */ /* -> from 1 line to 1/2 line */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData19); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData19); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData9); /* GVDD/NGVDD settings */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData5); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd( 2, (gU8 *)lcdRegData5); /* PWR_CTRL2 - 0xC590h - 149th parameter - Default 0x33h */ /* Rewrite the default value ! */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData20); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData21); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData20); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData21); /* Panel display timing Setting 3 */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData22); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData23); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData22); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData23); /* Power control 1 */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData24); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData25); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData24); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData25); /* Source driver precharge */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData26); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData13); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData26); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData27); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData15); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData27); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData28); - DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData6); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData28); + DSI_IO_WriteCmd( 2, (gU8 *)lcdRegData6); /* GOAVST */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); - DSI_IO_WriteCmd( 6, (uint8_t *)lcdRegData7); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData2); + DSI_IO_WriteCmd( 6, (gU8 *)lcdRegData7); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29); - DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData8); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData29); + DSI_IO_WriteCmd( 14, (gU8 *)lcdRegData8); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30); - DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData9); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData30); + DSI_IO_WriteCmd( 14, (gU8 *)lcdRegData9); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData10); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData31); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData10); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData46); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData32); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData46); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData11); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData2); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData11); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData12); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData33); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData12); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData13); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData29); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData13); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData14); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData30); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData14); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData15); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData31); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData15); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData16); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData32); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData16); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData34); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData17); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData34); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData17); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData35); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData18); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData35); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData18); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData19); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData2); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData19); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData20); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData33); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData20); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData21); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData29); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData21); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30); - DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData22); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData30); + DSI_IO_WriteCmd( 10, (gU8 *)lcdRegData22); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData23); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData31); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData23); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32); - DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData24); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData32); + DSI_IO_WriteCmd( 15, (gU8 *)lcdRegData24); ///////////////////////////////////////////////////////////////////////////// /* PWR_CTRL1 - 0xc580h - 130th parameter - default 0x00 */ /* Pump 1 min and max DM */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData47); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData48); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData49); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData13); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData47); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData48); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData49); ///////////////////////////////////////////////////////////////////////////// /* CABC LEDPWM frequency adjusted to 19,5kHz */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData50); - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData51); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData50); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData51); /* Exit CMD2 mode */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData25); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd( 3, (gU8 *)lcdRegData25); /*************************************************************************** */ /* Standard DCS Initialization TO KEEP CAN BE DONE IN HSDT */ /*************************************************************************** */ /* NOP - goes back to DCS std command ? */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); /* Gamma correction 2.2+ table (HSDT possible) */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData3); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd( 16, (gU8 *)lcdRegData3); /* Gamma correction 2.2- table (HSDT possible) */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); - DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData4); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); + DSI_IO_WriteCmd( 16, (gU8 *)lcdRegData4); /* Send Sleep Out command to display : no parameter */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData36); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData36); /* Wait for sleep out exit */ OTM8009A_IO_Delay(120); @@ -388,11 +388,11 @@ uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation) { case OTM8009A_FORMAT_RBG565 : /* Set Pixel color format to RGB565 */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData37); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData37); break; case OTM8009A_FORMAT_RGB888 : /* Set Pixel color format to RGB888 */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData38); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData38); break; default : break; @@ -402,35 +402,35 @@ uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation) the orientation mode is portrait */ if(orientation == OTM8009A_ORIENTATION_LANDSCAPE) { - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData39); - DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData27); - DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData28); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData39); + DSI_IO_WriteCmd( 4, (gU8 *)lcdRegData27); + DSI_IO_WriteCmd( 4, (gU8 *)lcdRegData28); } /** CABC : Content Adaptive Backlight Control section start >> */ /* Note : defaut is 0 (lowest Brightness), 0xFF is highest Brightness, try 0x7F : intermediate value */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData40); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData40); /* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData41); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData41); /* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData42); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData42); /* defaut is 0 (lowest Brightness), 0xFF is highest Brightness */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData43); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData43); /** CABC : Content Adaptive Backlight Control section end << */ /* Send Command Display On */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData44); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData44); /* NOP command */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData1); /* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */ /* DSI host from LTDC incoming pixels in video mode */ - DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData45); + DSI_IO_WriteCmd(0, (gU8 *)ShortRegData45); return 0; } diff --git a/boards/base/STM32F469i-Discovery/otm8009a.h b/boards/base/STM32F469i-Discovery/otm8009a.h index 417d9b9b..52fc107c 100644 --- a/boards/base/STM32F469i-Discovery/otm8009a.h +++ b/boards/base/STM32F469i-Discovery/otm8009a.h @@ -73,37 +73,37 @@ * @brief LCD_OrientationTypeDef * Possible values of Display Orientation */ -#define OTM8009A_ORIENTATION_PORTRAIT ((uint32_t)0x00) /* Portrait orientation choice of LCD screen */ -#define OTM8009A_ORIENTATION_LANDSCAPE ((uint32_t)0x01) /* Landscape orientation choice of LCD screen */ +#define OTM8009A_ORIENTATION_PORTRAIT ((gU32)0x00) /* Portrait orientation choice of LCD screen */ +#define OTM8009A_ORIENTATION_LANDSCAPE ((gU32)0x01) /* Landscape orientation choice of LCD screen */ /** * @brief Possible values of * pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets */ -#define OTM8009A_FORMAT_RGB888 ((uint32_t)0x00) /* Pixel format chosen is RGB888 : 24 bpp */ -#define OTM8009A_FORMAT_RBG565 ((uint32_t)0x02) /* Pixel format chosen is RGB565 : 16 bpp */ +#define OTM8009A_FORMAT_RGB888 ((gU32)0x00) /* Pixel format chosen is RGB888 : 24 bpp */ +#define OTM8009A_FORMAT_RBG565 ((gU32)0x02) /* Pixel format chosen is RGB565 : 16 bpp */ /** * @brief otm8009a_480x800 Size */ /* Width and Height in Portrait mode */ -#define OTM8009A_480X800_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */ -#define OTM8009A_480X800_HEIGHT ((uint16_t)800) /* LCD PIXEL HEIGHT */ +#define OTM8009A_480X800_WIDTH ((gU16)480) /* LCD PIXEL WIDTH */ +#define OTM8009A_480X800_HEIGHT ((gU16)800) /* LCD PIXEL HEIGHT */ /* Width and Height in Landscape mode */ -#define OTM8009A_800X480_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */ -#define OTM8009A_800X480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */ +#define OTM8009A_800X480_WIDTH ((gU16)800) /* LCD PIXEL WIDTH */ +#define OTM8009A_800X480_HEIGHT ((gU16)480) /* LCD PIXEL HEIGHT */ /** * @brief OTM8009A_480X800 Timing parameters for Portrait orientation mode */ -#define OTM8009A_480X800_HSYNC ((uint16_t)2) /* Horizontal synchronization */ -#define OTM8009A_480X800_HBP ((uint16_t)34) /* Horizontal back porch */ -#define OTM8009A_480X800_HFP ((uint16_t)34) /* Horizontal front porch */ -#define OTM8009A_480X800_VSYNC ((uint16_t)1) /* Vertical synchronization */ -#define OTM8009A_480X800_VBP ((uint16_t)15) /* Vertical back porch */ -#define OTM8009A_480X800_VFP ((uint16_t)16) /* Vertical front porch */ +#define OTM8009A_480X800_HSYNC ((gU16)2) /* Horizontal synchronization */ +#define OTM8009A_480X800_HBP ((gU16)34) /* Horizontal back porch */ +#define OTM8009A_480X800_HFP ((gU16)34) /* Horizontal front porch */ +#define OTM8009A_480X800_VSYNC ((gU16)1) /* Vertical synchronization */ +#define OTM8009A_480X800_VBP ((gU16)15) /* Vertical back porch */ +#define OTM8009A_480X800_VFP ((gU16)16) /* Vertical front porch */ /** * @brief OTM8009A_800X480 Timing parameters for Landscape orientation mode @@ -198,9 +198,9 @@ /** @addtogroup OTM8009A_Exported_Functions * @{ */ -void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams); -uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation); -void OTM8009A_IO_Delay(uint32_t Delay); +void DSI_IO_WriteCmd(gU32 NbrParams, gU8 *pParams); +gU8 OTM8009A_Init(gU32 ColorCoding, gU32 orientation); +void OTM8009A_IO_Delay(gU32 Delay); /** * @} */ diff --git a/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.c b/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.c index 8068db36..eeda4fdd 100644 --- a/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.c +++ b/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.c @@ -147,9 +147,9 @@ static FMC_SDRAM_CommandTypeDef Command; * @brief Initializes the SDRAM device. * @retval SDRAM status */ -uint8_t BSP_SDRAM_Init(void) +gU8 BSP_SDRAM_Init(void) { - static uint8_t sdramstatus = SDRAM_ERROR; + static gU8 sdramstatus = SDRAM_ERROR; /* SDRAM device configuration */ sdramHandle.Instance = FMC_SDRAM_DEVICE; @@ -196,9 +196,9 @@ uint8_t BSP_SDRAM_Init(void) * @brief DeInitializes the SDRAM device. * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_DeInit(void) +gU8 BSP_SDRAM_DeInit(void) { - static uint8_t sdramstatus = SDRAM_ERROR; + static gU8 sdramstatus = SDRAM_ERROR; /* SDRAM device configuration */ sdramHandle.Instance = FMC_SDRAM_DEVICE; @@ -219,9 +219,9 @@ uint8_t BSP_SDRAM_DeInit(void) * @brief Programs the SDRAM device. * @param RefreshCount: SDRAM refresh counter value */ -void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) +void BSP_SDRAM_Initialization_sequence(gU32 RefreshCount) { - __IO uint32_t tmpmrd = 0; + __IO gU32 tmpmrd = 0; /* Step 1: Configure a clock configuration enable command */ Command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE; @@ -255,7 +255,7 @@ void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT); /* Step 5: Program the external memory mode register */ - tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1 |\ + tmpmrd = (gU32)SDRAM_MODEREG_BURST_LENGTH_1 |\ SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL |\ SDRAM_MODEREG_CAS_LATENCY_3 |\ SDRAM_MODEREG_OPERATING_MODE_STANDARD |\ @@ -281,9 +281,9 @@ void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount) * @param uwDataSize: Size of read data from the memory * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_ReadData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Read_32b(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -300,9 +300,9 @@ uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uw * @param uwDataSize: Size of read data from the memory * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_ReadData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Read_DMA(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -319,9 +319,9 @@ uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_ * @param uwDataSize: Size of written data from the memory * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_WriteData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Write_32b(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -338,9 +338,9 @@ uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t u * @param uwDataSize: Size of written data from the memory * @retval SDRAM status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) +gU8 BSP_SDRAM_WriteData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize) { - if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK) + if(HAL_SDRAM_Write_DMA(&sdramHandle, (gU32 *)uwStartAddress, pData, uwDataSize) != HAL_OK) { return SDRAM_ERROR; } @@ -355,7 +355,7 @@ uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32 * @param SdramCmd: Pointer to SDRAM command structure * @retval HAL status : SDRAM_OK or SDRAM_ERROR. */ -uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd) +gU8 BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd) { if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK) { diff --git a/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.h b/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.h index 6068644f..de731a2d 100644 --- a/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.h +++ b/boards/base/STM32F469i-Discovery/stm32f469i_discovery_sdram.h @@ -66,8 +66,8 @@ /** * @brief SDRAM status structure definition */ -#define SDRAM_OK ((uint8_t)0x00) -#define SDRAM_ERROR ((uint8_t)0x01) +#define SDRAM_OK ((gU8)0x00) +#define SDRAM_ERROR ((gU8)0x01) /** * @} @@ -76,17 +76,17 @@ /** @defgroup STM32469I-Discovery_SDRAM_Exported_Constants STM32469I Discovery SDRAM Exported Constants * @{ */ -#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000) +#define SDRAM_DEVICE_ADDR ((gU32)0xC0000000) /* SDRAM device size in Bytes */ - #define SDRAM_DEVICE_SIZE ((uint32_t)0x1000000) + #define SDRAM_DEVICE_SIZE ((gU32)0x1000000) #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_32 #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2 /* SDRAM refresh counter (90 MHz SD clock) */ -#define REFRESH_COUNT ((uint32_t)0x0569) -#define SDRAM_TIMEOUT ((uint32_t)0xFFFF) +#define REFRESH_COUNT ((gU32)0x0569) +#define SDRAM_TIMEOUT ((gU32)0xFFFF) /* DMA definitions for SDRAM DMA transfer */ #define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE @@ -100,17 +100,17 @@ /** * @brief FMC SDRAM Mode definition register defines */ -#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001) -#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002) -#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004) -#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008) -#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020) -#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030) -#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) +#define SDRAM_MODEREG_BURST_LENGTH_1 ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_LENGTH_2 ((gU16)0x0001) +#define SDRAM_MODEREG_BURST_LENGTH_4 ((gU16)0x0002) +#define SDRAM_MODEREG_BURST_LENGTH_8 ((gU16)0x0004) +#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((gU16)0x0008) +#define SDRAM_MODEREG_CAS_LATENCY_2 ((gU16)0x0020) +#define SDRAM_MODEREG_CAS_LATENCY_3 ((gU16)0x0030) +#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((gU16)0x0200) /** * @} */ @@ -125,14 +125,14 @@ /** @addtogroup STM32469I_Discovery_SDRAM_Exported_Functions * @{ */ -uint8_t BSP_SDRAM_Init(void); -uint8_t BSP_SDRAM_DeInit(void); -void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount); -uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize); -uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd); +gU8 BSP_SDRAM_Init(void); +gU8 BSP_SDRAM_DeInit(void); +void BSP_SDRAM_Initialization_sequence(gU32 RefreshCount); +gU8 BSP_SDRAM_ReadData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_ReadData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_WriteData(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_WriteData_DMA(gU32 uwStartAddress, gU32 *pData, gU32 uwDataSize); +gU8 BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd); void BSP_SDRAM_DMA_IRQHandler(void); /* These function can be modified in case the current settings (e.g. DMA stream) diff --git a/boards/base/STM32F469i-Discovery/stm32f469i_raw32_system.c b/boards/base/STM32F469i-Discovery/stm32f469i_raw32_system.c index bfeaf3b4..d6f02d94 100644 --- a/boards/base/STM32F469i-Discovery/stm32f469i_raw32_system.c +++ b/boards/base/STM32F469i-Discovery/stm32f469i_raw32_system.c @@ -68,14 +68,14 @@ #if !defined (HSE_VALUE) #if defined(USE_STM32469I_DISCO_REVA) - #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ + #define HSE_VALUE ((gU32)25000000) /*!< Default value of the External oscillator in Hz */ #else - #define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */ + #define HSE_VALUE ((gU32)8000000) /*!< Default value of the External oscillator in Hz */ #endif /* USE_STM32469I_DISCO_REVA */ #endif /* HSE_VALUE */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE ((gU32)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** @@ -129,9 +129,9 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ -uint32_t SystemCoreClock = 16000000; -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; +gU32 SystemCoreClock = 16000000; +const gU8 AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const gU8 APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @} */ @@ -167,19 +167,19 @@ void SystemInit(void) #endif /* Reset the RCC clock configuration to the default reset state ------------*/ /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001; + RCC->CR |= (gU32)0x00000001; /* Reset CFGR register */ RCC->CFGR = 0x00000000; /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFF; + RCC->CR &= (gU32)0xFEF6FFFF; /* Reset PLLCFGR register */ RCC->PLLCFGR = 0x24003010; /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFF; + RCC->CR &= (gU32)0xFFFBFFFF; /* Disable all interrupts */ RCC->CIR = 0x00000000; @@ -234,7 +234,7 @@ void SystemInit(void) */ void SystemCoreClockUpdate(void) { - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; + gU32 tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -291,8 +291,8 @@ void SystemCoreClockUpdate(void) */ void SystemInit_ExtMemCtl(void) { - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; + register gU32 tmpreg = 0, timeout = 0xFFFF; + register __IO gU32 index; /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, and GPIOI interface clock */ diff --git a/boards/base/STM32F746-Discovery/board_STM32LTDC.h b/boards/base/STM32F746-Discovery/board_STM32LTDC.h index 575638d5..a3b02ca7 100644 --- a/boards/base/STM32F746-Discovery/board_STM32LTDC.h +++ b/boards/base/STM32F746-Discovery/board_STM32LTDC.h @@ -461,7 +461,7 @@ static GFXINLINE void post_init_board(GDisplay* g) { (void) g; } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { (void) g; // ST was stupid enought not to hook this up to a pin that diff --git a/boards/base/STM32F746-Discovery/example_chibios3/stm32f7xx_hal_conf.h b/boards/base/STM32F746-Discovery/example_chibios3/stm32f7xx_hal_conf.h index 5668e8c4..a1a47a70 100644 --- a/boards/base/STM32F746-Discovery/example_chibios3/stm32f7xx_hal_conf.h +++ b/boards/base/STM32F746-Discovery/example_chibios3/stm32f7xx_hal_conf.h @@ -202,39 +202,39 @@ /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ +#define PHY_BCR ((gU16)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((gU16)0x01U) /*!< Transceiver Basic Status Register */ -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ +#define PHY_RESET ((gU16)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((gU16)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((gU16)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((gU16)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((gU16)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((gU16)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((gU16)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((gU16)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((gU16)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((gU16)0x0400U) /*!< Isolate PHY from MII */ -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ +#define PHY_AUTONEGO_COMPLETE ((gU16)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((gU16)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((gU16)0x0002U) /*!< Jabber condition detected */ /* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11U) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12U) /*!< MII Interrupt Status and Misc. Control Register */ +#define PHY_SR ((gU16)0x10U) /*!< PHY status register Offset */ +#define PHY_MICR ((gU16)0x11U) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((gU16)0x12U) /*!< MII Interrupt Status and Misc. Control Register */ -#define PHY_LINK_STATUS ((uint16_t)0x0001U) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ +#define PHY_LINK_STATUS ((gU16)0x0001U) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((gU16)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((gU16)0x0004U) /*!< PHY Duplex mask */ -#define PHY_MICR_INT_EN ((uint16_t)0x0002U) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001U) /*!< PHY Enable output interrupt events */ +#define PHY_MICR_INT_EN ((gU16)0x0002U) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((gU16)0x0001U) /*!< PHY Enable output interrupt events */ -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020U) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000U) /*!< PHY link status interrupt mask */ +#define PHY_MISR_LINK_INT_EN ((gU16)0x0020U) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((gU16)0x2000U) /*!< PHY link status interrupt mask */ /* ################## SPI peripheral configuration ########################## */ @@ -436,9 +436,9 @@ * If expr is true, it returns no value. * @retval None */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((gU8 *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); + void assert_failed(gU8* file, gU32 line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ diff --git a/boards/base/STM32F746-Discovery/example_raw32/stm32f7xx_hal_conf.h b/boards/base/STM32F746-Discovery/example_raw32/stm32f7xx_hal_conf.h index bedea770..94c2d2e4 100644 --- a/boards/base/STM32F746-Discovery/example_raw32/stm32f7xx_hal_conf.h +++ b/boards/base/STM32F746-Discovery/example_raw32/stm32f7xx_hal_conf.h @@ -100,11 +100,11 @@ * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */ + #define HSE_VALUE ((gU32)25000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ + #define HSE_STARTUP_TIMEOUT ((gU32)100U) /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** @@ -113,14 +113,14 @@ * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE ((gU32)16000000U) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ #if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ + #define LSI_VALUE ((gU32)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations in voltage and temperature. */ @@ -128,11 +128,11 @@ * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE ((gU32)32768U) /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ #if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ + #define LSE_STARTUP_TIMEOUT ((gU32)5000U) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ /** @@ -141,7 +141,7 @@ * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ + #define EXTERNAL_CLOCK_VALUE ((gU32)12288000U) /*!< Value of the Internal oscillator in Hz*/ #endif /* EXTERNAL_CLOCK_VALUE */ /* Tip: To avoid modifying this file each time you need to use different HSE, @@ -151,8 +151,8 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define VDD_VALUE ((gU32)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((gU32)0x0F) /*!< tick interrupt priority */ #define USE_RTOS 0 #define ART_ACCLERATOR_ENABLE 1 /* To enable instruction cache and prefetch */ @@ -178,50 +178,50 @@ /* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)5U) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)5U) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */ +#define ETH_RXBUFNB ((gU32)5U) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((gU32)5U) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */ /* Section 2: PHY configuration section */ /* LAN8742A PHY Address*/ #define LAN8742A_PHY_ADDRESS 0x00U /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x00000FFFU) +#define PHY_RESET_DELAY ((gU32)0x00000FFFU) /* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) +#define PHY_CONFIG_DELAY ((gU32)0x00000FFFU) -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) +#define PHY_READ_TO ((gU32)0x0000FFFFU) +#define PHY_WRITE_TO ((gU32)0x0000FFFFU) /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ +#define PHY_BCR ((gU16)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((gU16)0x01U) /*!< Transceiver Basic Status Register */ -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ +#define PHY_RESET ((gU16)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((gU16)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((gU16)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((gU16)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((gU16)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((gU16)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((gU16)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((gU16)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((gU16)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((gU16)0x0400U) /*!< Isolate PHY from MII */ -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ +#define PHY_AUTONEGO_COMPLETE ((gU16)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((gU16)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((gU16)0x0002U) /*!< Jabber condition detected */ /* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x1FU) /*!< PHY special control/ status register Offset */ +#define PHY_SR ((gU16)0x1FU) /*!< PHY special control/ status register Offset */ -#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ +#define PHY_SPEED_STATUS ((gU16)0x0004U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((gU16)0x0010U) /*!< PHY Duplex mask */ -#define PHY_ISFR ((uint16_t)0x1DU) /*!< PHY Interrupt Source Flag register Offset */ -#define PHY_ISFR_INT4 ((uint16_t)0x0010U) /*!< PHY Link down inturrupt */ +#define PHY_ISFR ((gU16)0x1DU) /*!< PHY Interrupt Source Flag register Offset */ +#define PHY_ISFR_INT4 ((gU16)0x0010U) /*!< PHY Link down inturrupt */ /* ################## SPI peripheral configuration ########################## */ @@ -407,9 +407,9 @@ * If expr is true, it returns no value. * @retval None */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((gU8 *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); + void assert_failed(gU8* file, gU32 line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ diff --git a/boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h b/boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h index 2482108d..99b8a852 100644 --- a/boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h +++ b/boards/base/STM32F746-Discovery/gmouse_lld_FT5336_board.h @@ -40,14 +40,14 @@ static gBool init_board(GMouse* m, unsigned instance) GPIOH->MODER |= GPIO_MODER_MODER7_1; // Alternate function GPIOH->OTYPER |= GPIO_OTYPER_OT_7; // OpenDrain GPIOH->OSPEEDR &= ~GPIO_OSPEEDER_OSPEEDR7; // LowSpeed - GPIOH->AFRL |= ((uint32_t)0x04 << 4*7); // AF4 + GPIOH->AFRL |= ((gU32)0x04 << 4*7); // AF4 // I2C3_SDA GPIOH8, alternate, opendrain, highspeed RCC->AHB1ENR |= RCC_AHB1ENR_GPIOHEN; // Enable clock GPIOH->MODER |= GPIO_MODER_MODER8_1; // Alternate function GPIOH->OTYPER |= GPIO_OTYPER_OT_8; // OpenDrain GPIOH->OSPEEDR &= ~GPIO_OSPEEDER_OSPEEDR8; // LowSpeed - GPIOH->AFRH |= ((uint32_t)0x04 << 4*0); // AF4 + GPIOH->AFRH |= ((gU32)0x04 << 4*0); // AF4 // Initialize the I2C3 peripheral if (!(i2cInit(I2C3))) { @@ -57,21 +57,21 @@ static gBool init_board(GMouse* m, unsigned instance) return gTrue; } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { (void)m; i2cWriteReg(I2C3, FT5336_SLAVE_ADDR, reg, val); } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { (void)m; return i2cReadByte(I2C3, FT5336_SLAVE_ADDR, reg); } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { (void)m; diff --git a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c index 35a60a97..e90d6793 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c @@ -16,8 +16,8 @@ #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16 #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2 -#define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */ -#define SDRAM_TIMEOUT ((uint32_t)0xFFFF) +#define REFRESH_COUNT ((gU32)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */ +#define SDRAM_TIMEOUT ((gU32)0xFFFF) /* DMA definitions for SDRAM DMA transfer */ #define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE @@ -26,25 +26,25 @@ #define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn /* FMC SDRAM Mode definition register defines */ -#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001) -#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002) -#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004) -#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000) -#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008) -#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020) -#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030) -#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) -#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) +#define SDRAM_MODEREG_BURST_LENGTH_1 ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_LENGTH_2 ((gU16)0x0001) +#define SDRAM_MODEREG_BURST_LENGTH_4 ((gU16)0x0002) +#define SDRAM_MODEREG_BURST_LENGTH_8 ((gU16)0x0004) +#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((gU16)0x0000) +#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((gU16)0x0008) +#define SDRAM_MODEREG_CAS_LATENCY_2 ((gU16)0x0020) +#define SDRAM_MODEREG_CAS_LATENCY_3 ((gU16)0x0030) +#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((gU16)0x0000) +#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((gU16)0x0200) -static void BSP_SDRAM_Initialization_sequence(SDRAM_HandleTypeDef *hsdram, uint32_t RefreshCount); +static void BSP_SDRAM_Initialization_sequence(SDRAM_HandleTypeDef *hsdram, gU32 RefreshCount); static void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram); static void _HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTypeDef *Timing); static HAL_StatusTypeDef _FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDef *Init); -static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank); -static HAL_StatusTypeDef _FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout); -static HAL_StatusTypeDef _FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate); +static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, gU32 Bank); +static HAL_StatusTypeDef _FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, gU32 Timeout); +static HAL_StatusTypeDef _FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, gU32 RefreshRate); static void _HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTypeDef *Timing) { @@ -73,8 +73,8 @@ static void _HAL_SDRAM_Init(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_TimingTypeDef static HAL_StatusTypeDef _FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_InitTypeDef *Init) { - uint32_t tmpr1 = 0; - uint32_t tmpr2 = 0; + gU32 tmpr1 = 0; + gU32 tmpr2 = 0; /* Set SDRAM bank configuration parameters */ if (Init->SDBank != FMC_SDRAM_BANK2) @@ -82,11 +82,11 @@ static HAL_StatusTypeDef _FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_In tmpr1 = Device->SDCR[FMC_SDRAM_BANK1]; /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ - tmpr1 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + tmpr1 &= ((gU32)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); - tmpr1 |= (uint32_t)(Init->ColumnBitsNumber |\ + tmpr1 |= (gU32)(Init->ColumnBitsNumber |\ Init->RowBitsNumber |\ Init->MemoryDataWidth |\ Init->InternalBankNumber |\ @@ -103,22 +103,22 @@ static HAL_StatusTypeDef _FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_In tmpr1 = Device->SDCR[FMC_SDRAM_BANK1]; /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ - tmpr1 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + tmpr1 &= ((gU32)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); - tmpr1 |= (uint32_t)(Init->SDClockPeriod |\ + tmpr1 |= (gU32)(Init->SDClockPeriod |\ Init->ReadBurst |\ Init->ReadPipeDelay); tmpr2 = Device->SDCR[FMC_SDRAM_BANK2]; /* Clear NC, NR, MWID, NB, CAS, WP, SDCLK, RBURST, and RPIPE bits */ - tmpr2 &= ((uint32_t)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ + tmpr2 &= ((gU32)~(FMC_SDCR1_NC | FMC_SDCR1_NR | FMC_SDCR1_MWID | \ FMC_SDCR1_NB | FMC_SDCR1_CAS | FMC_SDCR1_WP | \ FMC_SDCR1_SDCLK | FMC_SDCR1_RBURST | FMC_SDCR1_RPIPE)); - tmpr2 |= (uint32_t)(Init->ColumnBitsNumber |\ + tmpr2 |= (gU32)(Init->ColumnBitsNumber |\ Init->RowBitsNumber |\ Init->MemoryDataWidth |\ Init->InternalBankNumber |\ @@ -132,10 +132,10 @@ static HAL_StatusTypeDef _FMC_SDRAM_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_In return HAL_OK; } -static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, uint32_t Bank) +static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_TimingTypeDef *Timing, gU32 Bank) { - uint32_t tmpr1 = 0; - uint32_t tmpr2 = 0; + gU32 tmpr1 = 0; + gU32 tmpr2 = 0; /* Set SDRAM device timing parameters */ if (Bank != FMC_SDRAM_BANK2) @@ -143,11 +143,11 @@ static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_S tmpr1 = Device->SDTR[FMC_SDRAM_BANK1]; /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ - tmpr1 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + tmpr1 &= ((gU32)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ FMC_SDTR1_TRCD)); - tmpr1 |= (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ + tmpr1 |= (gU32)(((Timing->LoadToActiveDelay)-1) |\ (((Timing->ExitSelfRefreshDelay)-1) << 4) |\ (((Timing->SelfRefreshTime)-1) << 8) |\ (((Timing->RowCycleDelay)-1) << 12) |\ @@ -161,11 +161,11 @@ static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_S tmpr1 = Device->SDTR[FMC_SDRAM_BANK2]; /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ - tmpr1 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + tmpr1 &= ((gU32)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ FMC_SDTR1_TRCD)); - tmpr1 |= (uint32_t)(((Timing->LoadToActiveDelay)-1) |\ + tmpr1 |= (gU32)(((Timing->LoadToActiveDelay)-1) |\ (((Timing->ExitSelfRefreshDelay)-1) << 4) |\ (((Timing->SelfRefreshTime)-1) << 8) |\ (((Timing->WriteRecoveryTime)-1) <<16) |\ @@ -174,10 +174,10 @@ static HAL_StatusTypeDef _FMC_SDRAM_Timing_Init(FMC_SDRAM_TypeDef *Device, FMC_S tmpr2 = Device->SDTR[FMC_SDRAM_BANK1]; /* Clear TMRD, TXSR, TRAS, TRC, TWR, TRP and TRCD bits */ - tmpr2 &= ((uint32_t)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ + tmpr2 &= ((gU32)~(FMC_SDTR1_TMRD | FMC_SDTR1_TXSR | FMC_SDTR1_TRAS | \ FMC_SDTR1_TRC | FMC_SDTR1_TWR | FMC_SDTR1_TRP | \ FMC_SDTR1_TRCD)); - tmpr2 |= (uint32_t)((((Timing->RowCycleDelay)-1) << 12) |\ + tmpr2 |= (gU32)((((Timing->RowCycleDelay)-1) << 12) |\ (((Timing->RPDelay)-1) << 20)); Device->SDTR[FMC_SDRAM_BANK2] = tmpr1; @@ -229,7 +229,7 @@ void BSP_SDRAM_Init(void) BSP_SDRAM_Initialization_sequence(&sdramHandle, REFRESH_COUNT); } -static HAL_StatusTypeDef _HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout) +static HAL_StatusTypeDef _HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM_CommandTypeDef *Command, gU32 Timeout) { /* Check the SDRAM controller state */ if(hsdram->State == HAL_SDRAM_STATE_BUSY) @@ -256,13 +256,13 @@ static HAL_StatusTypeDef _HAL_SDRAM_SendCommand(SDRAM_HandleTypeDef *hsdram, FMC return HAL_OK; } -static HAL_StatusTypeDef _FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, uint32_t Timeout) +static HAL_StatusTypeDef _FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_SDRAM_CommandTypeDef *Command, gU32 Timeout) { - __IO uint32_t tmpr = 0; + __IO gU32 tmpr = 0; gTicks tickstart = 0; /* Set command register */ - tmpr = (uint32_t)((Command->CommandMode) |\ + tmpr = (gU32)((Command->CommandMode) |\ (Command->CommandTarget) |\ (((Command->AutoRefreshNumber)-1) << 5) |\ ((Command->ModeRegisterDefinition) << 9) @@ -291,7 +291,7 @@ static HAL_StatusTypeDef _FMC_SDRAM_SendCommand(FMC_SDRAM_TypeDef *Device, FMC_S return HAL_OK; } -static HAL_StatusTypeDef _HAL_SDRAM_ProgramRefreshRate(SDRAM_HandleTypeDef *hsdram, uint32_t RefreshRate) +static HAL_StatusTypeDef _HAL_SDRAM_ProgramRefreshRate(SDRAM_HandleTypeDef *hsdram, gU32 RefreshRate) { /* Check the SDRAM controller state */ if(hsdram->State == HAL_SDRAM_STATE_BUSY) @@ -311,7 +311,7 @@ static HAL_StatusTypeDef _HAL_SDRAM_ProgramRefreshRate(SDRAM_HandleTypeDef *hsdr return HAL_OK; } -static HAL_StatusTypeDef _FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, uint32_t RefreshRate) +static HAL_StatusTypeDef _FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device, gU32 RefreshRate) { /* Set the refresh rate in command register */ Device->SDRTR |= (RefreshRate<<1); @@ -321,7 +321,7 @@ static HAL_StatusTypeDef _FMC_SDRAM_ProgramRefreshRate(FMC_SDRAM_TypeDef *Device static HAL_StatusTypeDef _HAL_DMA_Init(DMA_HandleTypeDef *hdma) { - uint32_t tmp = 0; + gU32 tmp = 0; /* Check the DMA peripheral state */ if(hdma == NULL) @@ -336,7 +336,7 @@ static HAL_StatusTypeDef _HAL_DMA_Init(DMA_HandleTypeDef *hdma) tmp = hdma->Instance->CR; /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR, CT and DBM bits */ - tmp &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \ + tmp &= ((gU32)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \ DMA_SxCR_PL | DMA_SxCR_MSIZE | DMA_SxCR_PSIZE | \ DMA_SxCR_MINC | DMA_SxCR_PINC | DMA_SxCR_CIRC | \ DMA_SxCR_DIR | DMA_SxCR_CT | DMA_SxCR_DBM)); @@ -361,7 +361,7 @@ static HAL_StatusTypeDef _HAL_DMA_Init(DMA_HandleTypeDef *hdma) tmp = hdma->Instance->FCR; /* Clear Direct mode and FIFO threshold bits */ - tmp &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH); + tmp &= (gU32)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH); /* Prepare the DMA Stream FIFO configuration */ tmp |= hdma->Init.FIFOMode; @@ -424,7 +424,7 @@ static HAL_StatusTypeDef _HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) hdma->Instance->M1AR = 0; /* Reset DMA Streamx FIFO control register */ - hdma->Instance->FCR = (uint32_t)0x00000021; + hdma->Instance->FCR = (gU32)0x00000021; /* Clear all flags */ __HAL_DMA_CLEAR_FLAG(hdma, __HAL_DMA_GET_DME_FLAG_INDEX(hdma)); @@ -450,7 +450,7 @@ static HAL_StatusTypeDef _HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) * @param RefreshCount: SDRAM refresh counter value * @retval None */ -static void BSP_SDRAM_Initialization_sequence(SDRAM_HandleTypeDef *hsdram, uint32_t RefreshCount) +static void BSP_SDRAM_Initialization_sequence(SDRAM_HandleTypeDef *hsdram, gU32 RefreshCount) { FMC_SDRAM_CommandTypeDef Command; @@ -489,7 +489,7 @@ static void BSP_SDRAM_Initialization_sequence(SDRAM_HandleTypeDef *hsdram, uint3 Command.CommandMode = FMC_SDRAM_CMD_LOAD_MODE; Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1; Command.AutoRefreshNumber = 1; - Command.ModeRegisterDefinition = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1 |\ + Command.ModeRegisterDefinition = (gU32)SDRAM_MODEREG_BURST_LENGTH_1 |\ SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL |\ SDRAM_MODEREG_CAS_LATENCY_2 |\ SDRAM_MODEREG_OPERATING_MODE_STANDARD |\ diff --git a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.h b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.h index abf88291..42c49978 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.h +++ b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.h @@ -44,8 +44,8 @@ extern "C" { #endif -#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000) -#define SDRAM_DEVICE_SIZE ((uint32_t)0x800000) /* SDRAM device size in MBytes */ +#define SDRAM_DEVICE_ADDR ((gU32)0xC0000000) +#define SDRAM_DEVICE_SIZE ((gU32)0x800000) /* SDRAM device size in MBytes */ void BSP_SDRAM_Init(void); diff --git a/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c b/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c index 56d3b16a..e0be3b23 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c @@ -66,11 +66,11 @@ #include "stm32f7xx.h" #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ + #define HSE_VALUE ((gU32)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE ((gU32)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** @@ -125,9 +125,9 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 16000000; - const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; - const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + gU32 SystemCoreClock = 16000000; + const gU8 AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + const gU8 APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @} @@ -163,19 +163,19 @@ void SystemInit(void) #endif /* Reset the RCC clock configuration to the default reset state ------------*/ /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001; + RCC->CR |= (gU32)0x00000001; /* Reset CFGR register */ RCC->CFGR = 0x00000000; /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFF; + RCC->CR &= (gU32)0xFEF6FFFF; /* Reset PLLCFGR register */ RCC->PLLCFGR = 0x24003010; /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFF; + RCC->CR &= (gU32)0xFFFBFFFF; /* Disable all interrupts */ RCC->CIR = 0x00000000; @@ -230,7 +230,7 @@ void SystemInit(void) */ void SystemCoreClockUpdate(void) { - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; + gU32 tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -287,8 +287,8 @@ void SystemCoreClockUpdate(void) */ void SystemInit_ExtMemCtl(void) { - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; + register gU32 tmpreg = 0, timeout = 0xFFFF; + register __IO gU32 index; /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG and GPIOH interface clock */ diff --git a/boards/base/STM32F746-Discovery/stm32f7_i2c.c b/boards/base/STM32F746-Discovery/stm32f7_i2c.c index 75af9de7..00ad5111 100644 --- a/boards/base/STM32F746-Discovery/stm32f7_i2c.c +++ b/boards/base/STM32F746-Discovery/stm32f7_i2c.c @@ -9,18 +9,18 @@ /* * The CR2 register needs atomic access. Hence always use this function to setup a transfer configuration. */ -static void _i2cConfigTransfer(I2C_TypeDef* i2c, uint16_t slaveAddr, uint8_t numBytes, uint32_t mode, uint32_t request) +static void _i2cConfigTransfer(I2C_TypeDef* i2c, gU16 slaveAddr, gU8 numBytes, gU32 mode, gU32 request) { - uint32_t tmpreg = 0; + gU32 tmpreg = 0; // Get the current CR2 register value tmpreg = i2c->CR2; // Clear tmpreg specific bits - tmpreg &= (uint32_t) ~((uint32_t) (I2C_CR2_SADD | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_AUTOEND | I2C_CR2_RD_WRN | I2C_CR2_START | I2C_CR2_STOP)); + tmpreg &= (gU32) ~((gU32) (I2C_CR2_SADD | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_AUTOEND | I2C_CR2_RD_WRN | I2C_CR2_START | I2C_CR2_STOP)); // update tmpreg - tmpreg |= (uint32_t) (((uint32_t) slaveAddr & I2C_CR2_SADD) | (((uint32_t) numBytes << 16) & I2C_CR2_NBYTES) | (uint32_t) mode | (uint32_t) request); + tmpreg |= (gU32) (((gU32) slaveAddr & I2C_CR2_SADD) | (((gU32) numBytes << 16) & I2C_CR2_NBYTES) | (gU32) mode | (gU32) request); // Update the actual CR2 contents i2c->CR2 = tmpreg; @@ -31,7 +31,7 @@ static void _i2cConfigTransfer(I2C_TypeDef* i2c, uint16_t slaveAddr, uint8_t num */ static void _i2cResetCr2(I2C_TypeDef* i2c) { - i2c->CR2 &= (uint32_t) ~((uint32_t) (I2C_CR2_SADD | I2C_CR2_HEAD10R | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_RD_WRN)); + i2c->CR2 &= (gU32) ~((gU32) (I2C_CR2_SADD | I2C_CR2_HEAD10R | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_RD_WRN)); } gBool i2cInit(I2C_TypeDef* i2c) @@ -79,7 +79,7 @@ gBool i2cInit(I2C_TypeDef* i2c) return gTrue; } -void i2cSend(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length) +void i2cSend(I2C_TypeDef* i2c, gU8 slaveAddr, gU8* data, gU16 length) { // We are currently not able to send more than 255 bytes at once if (length > 255) { @@ -109,21 +109,21 @@ void i2cSend(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length _i2cResetCr2(i2c); } -void i2cSendByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t data) +void i2cSendByte(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 data) { i2cSend(i2c, slaveAddr, &data, 1); } -void i2cWriteReg(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr, uint8_t value) +void i2cWriteReg(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr, gU8 value) { - uint8_t txbuf[2]; + gU8 txbuf[2]; txbuf[0] = regAddr; txbuf[1] = value; i2cSend(i2c, slaveAddr, txbuf, 2); } -void i2cRead(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length) +void i2cRead(I2C_TypeDef* i2c, gU8 slaveAddr, gU8* data, gU16 length) { int i; @@ -151,9 +151,9 @@ void i2cRead(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length _i2cResetCr2(i2c); } -uint8_t i2cReadByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr) +gU8 i2cReadByte(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr) { - uint8_t ret = 0xAA; + gU8 ret = 0xAA; i2cSend(i2c, slaveAddr, ®Addr, 1); i2cRead(i2c, slaveAddr, &ret, 1); @@ -161,12 +161,12 @@ uint8_t i2cReadByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr) return ret; } -uint16_t i2cReadWord(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr) +gU16 i2cReadWord(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr) { - uint8_t ret[2] = { 0xAA, 0xAA }; + gU8 ret[2] = { 0xAA, 0xAA }; i2cSend(i2c, slaveAddr, ®Addr, 1); i2cRead(i2c, slaveAddr, ret, 2); - return (uint16_t)((ret[0] << 8) | (ret[1] & 0x00FF)); + return (gU16)((ret[0] << 8) | (ret[1] & 0x00FF)); } diff --git a/boards/base/STM32F746-Discovery/stm32f7_i2c.h b/boards/base/STM32F746-Discovery/stm32f7_i2c.h index 4d481903..bae4560f 100644 --- a/boards/base/STM32F746-Discovery/stm32f7_i2c.h +++ b/boards/base/STM32F746-Discovery/stm32f7_i2c.h @@ -5,10 +5,10 @@ gBool i2cInit(I2C_TypeDef* i2c); -void i2cSend(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length); -void i2cSendByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t data); -void i2cWriteReg(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr, uint8_t value); +void i2cSend(I2C_TypeDef* i2c, gU8 slaveAddr, gU8* data, gU16 length); +void i2cSendByte(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 data); +void i2cWriteReg(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr, gU8 value); -void i2cRead(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t* data, uint16_t length); -uint8_t i2cReadByte(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr); -uint16_t i2cReadWord(I2C_TypeDef* i2c, uint8_t slaveAddr, uint8_t regAddr); +void i2cRead(I2C_TypeDef* i2c, gU8 slaveAddr, gU8* data, gU16 length); +gU8 i2cReadByte(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr); +gU16 i2cReadWord(I2C_TypeDef* i2c, gU8 slaveAddr, gU8 regAddr); diff --git a/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h b/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h index 9407713e..cc7c070b 100644 --- a/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h +++ b/boards/base/eCos-Synthetic-Framebuffer/board_framebuffer.h @@ -63,7 +63,7 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { (void) g; #if (CYG_FB_FLAGS0(FRAMEBUF) & CYG_FB_FLAGS0_BACKLIGHT) cyg_fb_ioctl_backlight backlight; @@ -74,12 +74,12 @@ if (backlight.fbbl_max == 1) backlight.fbbl_current = percent ? 1 : 0; else - backlight.fbbl_current = (((uint32_t)percent)*backlight.fbbl_max)/100; + backlight.fbbl_current = (((gU32)percent)*backlight.fbbl_max)/100; CYG_FB_IOCTL(FRAMEBUF, CYG_FB_IOCTL_BACKLIGHT_SET, &backlight, &len); #endif } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { (void) g; (void) percent; } diff --git a/changelog.txt b/changelog.txt index 4192d6c1..917f5160 100644 --- a/changelog.txt +++ b/changelog.txt @@ -32,7 +32,9 @@ CHANGE: Added type gJustify to replace V2.x justify_t, and values gJ CHANGE: Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX CHANGE: Added type gOrientation to replace V2.x orientation_t, and values gOrientationX replace GDISP_ROTATE_X CHANGE: Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM -FEATURE: Added types gPtr and gPtrDiff +FEATURE: Added types gPtr, gPtrDiff and gAny +FEATURE: Added type gMemSize and config macro GFX_MEM_LT64K +FEATURE: Added type gFileSize FEATURE: Added gI64 and gU64 when the compiler supports it. GFX_TYPE_64 macro is defined as GFXON if it does. FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not used as it may be 64bit. FIX: Added gfxRealloc() to Qt port diff --git a/demos/3rdparty/bubbles/main.c b/demos/3rdparty/bubbles/main.c index 7ab4da2e..16e4177c 100644 --- a/demos/3rdparty/bubbles/main.c +++ b/demos/3rdparty/bubbles/main.c @@ -25,14 +25,14 @@ #define background RGB2COLOR(0,0,0) -uint16_t width, height; -int16_t sine[SCALE+(SCALE/4)]; -int16_t *cosi = &sine[SCALE/4]; /* cos(x) = sin(x+90d)... */ +gU16 width, height; +gI16 sine[SCALE+(SCALE/4)]; +gI16 *cosi = &sine[SCALE/4]; /* cos(x) = sin(x+90d)... */ void initialize (void) { - uint16_t i; + gU16 i; /* if you change the SCALE*1.25 back to SCALE, the program will * occassionally overrun the cosi array -- however this actually @@ -44,12 +44,12 @@ void initialize (void) } -void matrix (int16_t xyz[3][N], gColor col[N]) +void matrix (gI16 xyz[3][N], gColor col[N]) { - static uint32_t t = 0; - int16_t x = -SCALE, y = -SCALE; - uint16_t i, s, d; - uint8_t red,grn,blu; + static gU32 t = 0; + gI16 x = -SCALE, y = -SCALE; + gU16 i, s, d; + gU8 red,grn,blu; #define RED_COLORS (32) #define GREEN_COLORS (64) @@ -81,13 +81,13 @@ void matrix (int16_t xyz[3][N], gColor col[N]) } -void rotate (int16_t xyz[3][N], uint16_t angleX, uint16_t angleY, uint16_t angleZ) +void rotate (gI16 xyz[3][N], gU16 angleX, gU16 angleY, gU16 angleZ) { - uint16_t i; - int16_t tmpX, tmpY; - int16_t sinx = sine[angleX], cosx = cosi[angleX]; - int16_t siny = sine[angleY], cosy = cosi[angleY]; - int16_t sinz = sine[angleZ], cosz = cosi[angleZ]; + gU16 i; + gI16 tmpX, tmpY; + gI16 sinx = sine[angleX], cosx = cosi[angleX]; + gI16 siny = sine[angleY], cosy = cosi[angleY]; + gI16 sinz = sine[angleZ], cosz = cosi[angleZ]; for (i = 0; i < N; i++) { @@ -106,12 +106,12 @@ void rotate (int16_t xyz[3][N], uint16_t angleX, uint16_t angleY, uint16_t angle } -void draw(int16_t xyz[3][N], gColor col[N]) +void draw(gI16 xyz[3][N], gColor col[N]) { - static uint16_t oldProjX[N] = {0}; - static uint16_t oldProjY[N] = {0}; - static uint8_t oldDotSize[N] = {0}; - uint16_t i, projX, projY, projZ, dotSize; + static gU16 oldProjX[N] = {0}; + static gU16 oldProjY[N] = {0}; + static gU8 oldDotSize[N] = {0}; + gU16 i, projX, projY, projZ, dotSize; for (i = 0; i < N; i++) { @@ -138,10 +138,10 @@ void draw(int16_t xyz[3][N], gColor col[N]) /* ---------------------------------------------------------------------- */ -int16_t angleX = 0, angleY = 0, angleZ = 0; -int16_t speedX = 0, speedY = 0, speedZ = 0; +gI16 angleX = 0, angleY = 0, angleZ = 0; +gI16 speedX = 0, speedY = 0, speedZ = 0; -int16_t xyz[3][N]; +gI16 xyz[3][N]; gColor col[N]; @@ -158,8 +158,8 @@ int main (void) gfxSleepMilliseconds (10); gdispClear (background); /* glitches.. */ - width = (uint16_t)gdispGetWidth(); - height = (uint16_t)gdispGetHeight(); + width = (gU16)gdispGetWidth(); + height = (gU16)gdispGetHeight(); initialize(); diff --git a/demos/3rdparty/notepad-2/main.c b/demos/3rdparty/notepad-2/main.c index c61e7d94..f20d1899 100644 --- a/demos/3rdparty/notepad-2/main.c +++ b/demos/3rdparty/notepad-2/main.c @@ -66,7 +66,7 @@ const NColorScheme schemeDefault2 = { .statusBarText = HTML2COLOR(0x000000) }; -const char *tsCalibRead(uint16_t instance) { +const char *tsCalibRead(gU16 instance) { // This will perform a on-spot calibration // Unless you read and add the co-efficients here (void) instance; diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c index 3b5d2cef..1f94070d 100644 --- a/demos/3rdparty/notepad-2/notepadApp.c +++ b/demos/3rdparty/notepad-2/notepadApp.c @@ -96,7 +96,7 @@ static void nbtnColorBarDraw(GHandle gh, gBool enabled, gBool isdown, const char // Update selection - this is like lazy release. if (k >= 0 && k <= 7) { selPenWidth = k + 1; - ncoreSetPenWidth((uint8_t) selPenWidth); + ncoreSetPenWidth((gU8) selPenWidth); } gdispFillArea(gh->x + NPAD_TOOLBAR_BTN_WIDTH * i, gh->y, diff --git a/demos/3rdparty/notepad-2/notepadCore.c b/demos/3rdparty/notepad-2/notepadCore.c index 73a877a9..4662a9ba 100644 --- a/demos/3rdparty/notepad-2/notepadCore.c +++ b/demos/3rdparty/notepad-2/notepadCore.c @@ -45,8 +45,8 @@ /* This is the drawing core */ static DECLARE_THREAD_STACK(waDrawThread, NCORE_THD_STACK_SIZE); -static uint8_t nPenWidth = 1; -static uint8_t nMode = NCORE_MODE_DRAW; +static gU8 nPenWidth = 1; +static gU8 nMode = NCORE_MODE_DRAW; static gThread nThd; @@ -72,9 +72,9 @@ static void draw_point(gCoord x, gCoord y) { /* Bresenham's Line Drawing Algorithm Modified version to draw line of variable thickness */ static void draw_line(gCoord x0, gCoord y0, gCoord x1, gCoord y1) { - int16_t dy, dx; - int16_t addx, addy; - int16_t P, diff, i; + gI16 dy, dx; + gI16 addx, addy; + gI16 P, diff, i; if (x1 >= x0) { dx = x1 - x0; @@ -223,13 +223,13 @@ void ncoreTerminateDrawThread(void) { /* Get and set the pen width * Brush is cicular, width is pixel radius */ -void ncoreSetPenWidth(uint8_t penWidth) { nPenWidth = penWidth; } -uint8_t ncoreGetPenWidth(void) { return nPenWidth; } +void ncoreSetPenWidth(gU8 penWidth) { nPenWidth = penWidth; } +gU8 ncoreGetPenWidth(void) { return nPenWidth; } /* Get and set the drawing color */ void ncoreSetPenColor(gColor penColor) { gwinSetColor(ncoreDrawingArea, penColor); } gColor ncoreGetPenColor(void) { return ncoreDrawingArea->color; } /* Set mode */ -void ncoreSetMode(uint8_t mode) { nMode = mode; } -uint8_t ncoreGetMode(void) { return nMode; } +void ncoreSetMode(gU8 mode) { nMode = mode; } +gU8 ncoreGetMode(void) { return nMode; } diff --git a/demos/3rdparty/notepad-2/notepadCore.h b/demos/3rdparty/notepad-2/notepadCore.h index e4b78cdc..93fceb7d 100644 --- a/demos/3rdparty/notepad-2/notepadCore.h +++ b/demos/3rdparty/notepad-2/notepadCore.h @@ -54,15 +54,15 @@ void ncoreTerminateDrawThread(void); /* Get and set the pen width * Brush is cicular, width is pixel radius */ -void ncoreSetPenWidth(uint8_t penWidth); -uint8_t ncoreGetPenWidth(void); +void ncoreSetPenWidth(gU8 penWidth); +gU8 ncoreGetPenWidth(void); /* Get and set the drawing color */ void ncoreSetPenColor(gColor penColor); gColor ncoreGetPenColor(void); /* Get and set the pen mode */ -void ncoreSetMode(uint8_t mode); -uint8_t ncoreGetMode(void); +void ncoreSetMode(gU8 mode); +gU8 ncoreGetMode(void); #endif /* NOTEPADCORE_H_ */ diff --git a/demos/applications/combo/mandelbrot.c b/demos/applications/combo/mandelbrot.c index 9299f7d8..f70aa356 100644 --- a/demos/applications/combo/mandelbrot.c +++ b/demos/applications/combo/mandelbrot.c @@ -36,7 +36,7 @@ static gThread thread; static void mandelbrot(float x1, float y1, float x2, float y2) { unsigned int i,j, width, height; - uint16_t iter; + gU16 iter; float fwidth, fheight; float sy = y2 - y1; diff --git a/demos/applications/mandelbrot/main.c b/demos/applications/mandelbrot/main.c index d5af7720..c35ba411 100644 --- a/demos/applications/mandelbrot/main.c +++ b/demos/applications/mandelbrot/main.c @@ -31,7 +31,7 @@ void mandelbrot(float x1, float y1, float x2, float y2) { unsigned int i,j, width, height; - uint16_t iter; + gU16 iter; gColor color; float fwidth, fheight; diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c index 43933355..85d8e0f0 100644 --- a/demos/applications/notepad/main.c +++ b/demos/applications/notepad/main.c @@ -75,7 +75,7 @@ GEventMouse ev; int main(void) { gColor color = GFX_BLACK; - uint16_t pen = 0; + gU16 pen = 0; gfxInit(); ginputGetMouse(0); diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index fa7f0b9a..772885fa 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -86,7 +86,7 @@ static int uitoa(unsigned int value, char * buf, int max) { } void benchmark(void) { - uint32_t i, pixels, ms, pps; + gU32 i, pixels, ms, pps; char pps_str[25]; gCoord height, width, rx, ry, rcx, rcy; gColor random_color; diff --git a/demos/games/justget10/jg10.c b/demos/games/justget10/jg10.c index d6ec0e2e..bcb58508 100644 --- a/demos/games/justget10/jg10.c +++ b/demos/games/justget10/jg10.c @@ -16,7 +16,7 @@ GHandle jg10SelectionWidgetGCreate(GDisplay* g, jg10WidgetObject* wo, GWidgetIni typedef struct { // Node properties - uint8_t num; // Node number + gU8 num; // Node number gBool check; // Node needs to be checked or not gBool sel; // Node selected or not } nodeProps; @@ -29,7 +29,7 @@ gdispImage jg10Image[JG10_MAX_COUNT]; #define JG10_ANIM_DELAY 60 const char *jg10GraphAnim[] = {"a1.bmp","a2.bmp","a3.bmp","a4.bmp","background.bmp"}; // 5 elements (0-4) gdispImage jg10ImageAnim[JG10_ANIM_IMAGES]; -uint8_t jg10MaxVal=4; // Max value in field... +gU8 jg10MaxVal=4; // Max value in field... gFont font; #if JG10_SHOW_SPLASH GTimer jg10SplashBlink; @@ -42,7 +42,7 @@ static void initRng(void) { srand(gfxSystemTicks()); } -static uint32_t randomInt(uint32_t max) { +static gU32 randomInt(gU32 max) { return rand() % max; } @@ -86,12 +86,12 @@ static int uitoa(unsigned int value, char * buf, int max) { return n; } -static gBool inRange(int16_t x, int16_t y) { +static gBool inRange(gI16 x, gI16 y) { if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return gTrue; else return gFalse; } static void clean_SelCheck(void) { - uint16_t i ,j; + gU16 i ,j; for (i = 0; i < JG10_FIELD_WIDTH; i++) { for (j = 0; j < JG10_FIELD_HEIGHT; j++) { jg10Field[i][j].check = gFalse; @@ -101,7 +101,7 @@ static void clean_SelCheck(void) { } static void remove_Selected(void) { - uint16_t i ,j, step; + gU16 i ,j, step; gTicks delay_start = 0; gTicks delay=0; for (step = 0; step < JG10_ANIM_IMAGES; step++) { @@ -129,12 +129,12 @@ static void remove_Selected(void) { // gwinRedraw(mainWin); } -static uint8_t jg10_randomer(uint8_t max, uint8_t th) { - uint32_t r = randomInt((1<= 0; i--) { - if (r >= (uint32_t)(1<= 0; i--) { + if (r >= (gU32)(1<= th) { return randomInt(max-i)+1; } else { @@ -147,20 +147,20 @@ static uint8_t jg10_randomer(uint8_t max, uint8_t th) { } static void movePiecesDown(void) { - uint8_t tmp = 0; + gU8 tmp = 0; gBool needToCheck = gTrue; while (needToCheck) { needToCheck = gFalse; - for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { - for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { + for (gI8 y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { + for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) { if (jg10Field[x][y].num == 0) { // check if there is at least single none empty piece tmp = 0; - for (int8_t tmpy = y; tmpy >= 0; tmpy--) { + for (gI8 tmpy = y; tmpy >= 0; tmpy--) { if (jg10Field[x][tmpy].num != 0) tmp++; } if (tmp != 0) { - for (int8_t tmpy = y; tmpy > 0; tmpy--) { + for (gI8 tmpy = y; tmpy > 0; tmpy--) { jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num; } jg10Field[x][0].num = 0; @@ -175,10 +175,10 @@ static void movePiecesDown(void) { needToCheck = gTrue; while (needToCheck) { needToCheck = gFalse; - for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { - for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { + for (gI8 y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { + for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) { if (jg10Field[x][y].num == 0) { - for (int8_t tmpy = y; tmpy > 0; tmpy--) { + for (gI8 tmpy = y; tmpy > 0; tmpy--) { jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num; } jg10Field[x][0].num = jg10_randomer(jg10MaxVal, 3); @@ -193,7 +193,7 @@ static void movePiecesDown(void) { static gBool checkForPossibleMove(void) { gBool canMove = gFalse; - uint16_t i ,j; + gU16 i ,j; for (i = 0; i < JG10_FIELD_WIDTH; i++) { for (j = 0; j < JG10_FIELD_HEIGHT; j++) { if ((inRange(i,j-1) && jg10Field[i][j-1].num == jg10Field[i][j].num) || @@ -225,7 +225,7 @@ static void printCongrats(void) { static DECLARE_THREAD_FUNCTION(thdJg10, msg) { (void)msg; - uint16_t x,y; + gU16 x,y; while (!jg10GameOver) { srand(gfxSystemTicks()); ginputGetMouseStatus(0, &ev); @@ -278,8 +278,8 @@ static DECLARE_THREAD_FUNCTION(thdJg10, msg) { static void initField(void) { jg10MaxVal = 4; - for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { - for (uint8_t y = 0; y < JG10_FIELD_HEIGHT; y++) { + for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) { + for (gU8 y = 0; y < JG10_FIELD_HEIGHT; y++) { jg10Field[x][y].num = randomInt(jg10MaxVal)+1; //jg10Field[x][y].num = 1; // good for animation testing //jg10Field[x][y].num = x+x+5; // good to get high score fast @@ -295,15 +295,15 @@ static void initField(void) { static void mainWinDraw(GWidgetObject* gw, void* param) { (void)param; - for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { - for (uint8_t y = 0; y < JG10_FIELD_HEIGHT; y++) { + for (gU8 x = 0; x < JG10_FIELD_WIDTH; x++) { + for (gU8 y = 0; y < JG10_FIELD_HEIGHT; y++) { gdispGImageDraw(gw->g.display, &jg10Image[jg10Field[x][y].num], (x*JG10_CELL_HEIGHT)+1, (y*JG10_CELL_WIDTH)+1, JG10_CELL_WIDTH, JG10_CELL_HEIGHT, 0, 0); } } } static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) { - int16_t x, y; + gI16 x, y; gBool needToCheck = gTrue; (void)param; @@ -468,11 +468,11 @@ void jg10Start(void) { void jg10Init(void) { initRng(); - for (uint8_t i = 0; i < JG10_MAX_COUNT; i++) { + for (gU8 i = 0; i < JG10_MAX_COUNT; i++) { gdispImageOpenFile(&jg10Image[i], jg10Graph[i]); gdispImageCache(&jg10Image[i]); } - for (uint8_t i = 0; i < JG10_ANIM_IMAGES; i++) { + for (gU8 i = 0; i < JG10_ANIM_IMAGES; i++) { gdispImageOpenFile(&jg10ImageAnim[i], jg10GraphAnim[i]); gdispImageCache(&jg10ImageAnim[i]); } diff --git a/demos/games/minesweeper/mines.c b/demos/games/minesweeper/mines.c index 5a0b4c41..4ae8f361 100644 --- a/demos/games/minesweeper/mines.c +++ b/demos/games/minesweeper/mines.c @@ -3,25 +3,25 @@ #include "mines.h" typedef struct { // Node properties - uint8_t num; // Node number, how many mines around + gU8 num; // Node number, how many mines around gBool open; // Node shown or hidden gBool check; // Node needs to be checked or not, used for opening up empty nodes gBool flag; // Node is marked with flag by player - uint16_t fieldNum; // Node number, used to randomize gamestart "animation" + gU16 fieldNum; // Node number, used to randomize gamestart "animation" } nodeProps; static GEventMouse ev; static nodeProps minesField[MINES_FIELD_WIDTH][MINES_FIELD_HEIGHT]; // Mines field array static gBool minesGameOver = gFalse; static gBool minesGameWinner = gFalse; -static int16_t minesEmptyNodes; // Empty node counter -static int16_t minesFlags; // Flag counter -static int16_t minesTime; // Time counter +static gI16 minesEmptyNodes; // Empty node counter +static gI16 minesFlags; // Flag counter +static gI16 minesTime; // Time counter static GTimer minesTimeCounterTimer; static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "closed.bmp", "empty.bmp", "explode.bmp", "flag.bmp", "mine.bmp", "wrong.bmp"}; // 14 elements (0-13) static gdispImage minesImage; -static uint8_t minesStatusIconWidth = 0; -static uint8_t minesStatusIconHeight = 0; +static gU8 minesStatusIconWidth = 0; +static gU8 minesStatusIconHeight = 0; static gBool minesFirstGame = gTrue; // Just don't clear field for the first time, as we have black screen already... :/ static gBool minesSplashTxtVisible = gFalse; #if MINES_SHOW_SPLASH @@ -84,7 +84,7 @@ static void initRng(void) srand(gfxSystemTicks()); } -static uint32_t randomInt(uint32_t max) +static gU32 randomInt(gU32 max) { return rand() % max; } @@ -125,7 +125,7 @@ static void minesTimeCounter(void* arg) minesUpdateTime(); } -static gBool inRange(int16_t x, int16_t y) +static gBool inRange(gI16 x, gI16 y) { if ((x >= 0) && (x < MINES_FIELD_WIDTH) && (y >= 0) && (y < MINES_FIELD_HEIGHT)) return gTrue; @@ -133,7 +133,7 @@ static gBool inRange(int16_t x, int16_t y) return gFalse; } -static void showOne(int16_t x, int16_t y) +static void showOne(gI16 x, gI16 y) { minesField[x][y].open = gTrue; if (minesField[x][y].flag) { @@ -167,7 +167,7 @@ static void showOne(int16_t x, int16_t y) static void openEmptyNodes(void) { - int16_t x, y, i, j; + gI16 x, y, i, j; gBool needToCheck = gTrue; while (needToCheck) { @@ -195,7 +195,7 @@ static void openEmptyNodes(void) static DECLARE_THREAD_FUNCTION(thdMines, msg) { (void)msg; - uint16_t x,y, delay; + gU16 x,y, delay; gBool delayed = gFalse; while (!minesGameOver) { if (minesEmptyNodes == 0) { @@ -265,7 +265,7 @@ static void printGameOver(void) static void initField(void) { - int16_t x, y, mines, i, j; + gI16 x, y, mines, i, j; minesFlags = 0; minesGameOver = gFalse; @@ -374,7 +374,7 @@ static void initField(void) void minesStart(void) { - int16_t x, y; + gI16 x, y; #if MINES_SHOW_SPLASH gtimerStop(&minesSplashBlink); diff --git a/demos/games/minesweeper/resources/romfs/userfonts.h b/demos/games/minesweeper/resources/romfs/userfonts.h index e775aec0..232c8452 100644 --- a/demos/games/minesweeper/resources/romfs/userfonts.h +++ b/demos/games/minesweeper/resources/romfs/userfonts.h @@ -11,25 +11,25 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_digital_7__mono_20_dictionary_data[39] = { +static const gU8 mf_rlefont_digital_7__mono_20_dictionary_data[39] = { 0x81, 0x05, 0x81, 0x05, 0x81, 0x05, 0x81, 0x05, 0x81, 0x06, 0x80, 0x01, 0x07, 0x80, 0x05, 0x85, 0x05, 0x80, 0x81, 0x03, 0x03, 0x85, 0x0f, 0x44, 0x84, 0x85, 0x86, 0x88, 0x44, 0x44, 0x44, 0x44, 0x24, 0x84, 0x44, 0x44, 0x18, 0xc4, 0x83, }; -static const uint16_t mf_rlefont_digital_7__mono_20_dictionary_offsets[13] = { +static const gU16 mf_rlefont_digital_7__mono_20_dictionary_offsets[13] = { 0x0000, 0x0009, 0x000c, 0x000f, 0x0010, 0x0012, 0x0013, 0x0014, 0x0016, 0x001c, 0x0020, 0x0024, 0x0027, }; -static const uint8_t mf_rlefont_digital_7__mono_20_glyph_data_0[63] = { +static const gU8 mf_rlefont_digital_7__mono_20_glyph_data_0[63] = { 0x09, 0x1b, 0x18, 0x1c, 0x1a, 0x18, 0x1b, 0x09, 0x21, 0x19, 0x22, 0x21, 0x09, 0x83, 0x44, 0x21, 0x83, 0x20, 0x1f, 0x10, 0x09, 0x83, 0x44, 0x21, 0x82, 0x44, 0x21, 0x83, 0x09, 0x84, 0x23, 0x20, 0xec, 0x44, 0x09, 0x43, 0x20, 0x1f, 0x20, 0xec, 0x83, 0x09, 0x43, 0x20, 0x1f, 0x23, 0x0f, 0x09, 0x1b, 0x18, 0x22, 0x21, 0x09, 0x1b, 0x23, 0x23, 0x0f, 0x09, 0x1b, 0x23, 0x20, 0xec, 0x83, }; -static const uint16_t mf_rlefont_digital_7__mono_20_glyph_offsets_0[10] = { +static const gU16 mf_rlefont_digital_7__mono_20_glyph_offsets_0[10] = { 0x0000, 0x0007, 0x000c, 0x0014, 0x001c, 0x0022, 0x0029, 0x002f, 0x0034, 0x0039, }; diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h index 35ef653d..e14def7d 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h @@ -18,8 +18,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG ((volatile uint16_t *) 0x60000000)[0] /* RS = 0 */ -#define GDISP_RAM ((volatile uint16_t *) 0x60020000)[0] /* RS = 1 */ +#define GDISP_REG ((volatile gU16 *) 0x60000000)[0] /* RS = 0 */ +#define GDISP_RAM ((volatile gU16 *) 0x60020000)[0] /* RS = 1 */ #define GDISP_DMA_STREAM STM32_DMA2_STREAM6 #define FSMC_BANK 0 @@ -116,7 +116,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; pwmEnableChannel(&PWMD3, 2, percent); } @@ -129,12 +129,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -149,7 +149,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */ } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h b/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h index 4ba46339..6b599207 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h @@ -43,11 +43,11 @@ static GFXINLINE void release_bus(void) spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(uint16_t port) +static GFXINLINE gU16 read_value(gU16 port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; txbuf[0] = port; diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h index eef222fa..1114853c 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h @@ -85,15 +85,15 @@ static GFXINLINE void release_bus(GMouse* m) { spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; (void) m; txbuf[0] = port; spiExchange(&SPID1, 3, txbuf, rxbuf); - return ((uint16_t)rxbuf[1] << 5) | (rxbuf[2] >> 3); + return ((gU16)rxbuf[1] << 5) | (rxbuf[2] >> 3); } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old index f5f39c63..5b520a3d 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old +++ b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old @@ -57,10 +57,10 @@ static GFXINLINE void release_bus(void) { spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; +static GFXINLINE gU16 read_value(gU16 port) { + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; txbuf[0] = port; diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h index 9ad3edd5..41d0ea8f 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h @@ -18,8 +18,8 @@ // For a multiple display configuration we would put all this in a structure and then // set g->board to that structure. -#define GDISP_REG ((volatile uint16_t *) 0x60000000)[0] /* RS = 0 */ -#define GDISP_RAM ((volatile uint16_t *) 0x60020000)[0] /* RS = 1 */ +#define GDISP_REG ((volatile gU16 *) 0x60000000)[0] /* RS = 0 */ +#define GDISP_RAM ((volatile gU16 *) 0x60020000)[0] /* RS = 1 */ #define GDISP_DMA_STREAM STM32_DMA2_STREAM6 #define FSMC_BANK 0 @@ -114,7 +114,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; pwmEnableChannel(&PWMD3, 2, percent); } @@ -127,12 +127,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; GDISP_REG = index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; GDISP_RAM = data; } @@ -147,7 +147,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { FSMC_Bank1->BTCR[FSMC_BANK+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0; /* FSMC timing */ } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return GDISP_RAM; } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h index 4ba46339..6b599207 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h @@ -43,11 +43,11 @@ static GFXINLINE void release_bus(void) spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(uint16_t port) +static GFXINLINE gU16 read_value(gU16 port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; txbuf[0] = port; diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h index f5f39c63..5b520a3d 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h @@ -57,10 +57,10 @@ static GFXINLINE void release_bus(void) { spiReleaseBus(&SPID1); } -static GFXINLINE uint16_t read_value(uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - uint16_t ret; +static GFXINLINE gU16 read_value(gU16 port) { + static gU8 txbuf[3] = {0}; + static gU8 rxbuf[3] = {0}; + gU16 ret; txbuf[0] = port; diff --git a/demos/games/tetris/tetris.c b/demos/games/tetris/tetris.c index cd4cc315..c0bbe3b0 100644 --- a/demos/games/tetris/tetris.c +++ b/demos/games/tetris/tetris.c @@ -62,7 +62,7 @@ F B E C D */ -const uint8_t sevenSegNumbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 0,1,2,3,4,5,6,7,8,9 +const gU8 sevenSegNumbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 0,1,2,3,4,5,6,7,8,9 const gColor tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors // default tetris shapes const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = { @@ -143,7 +143,7 @@ static int uitoa(unsigned int value, char * buf, int max) { return n; } -static void sevenSegDraw(int x, int y, uint8_t number, gColor color) { +static void sevenSegDraw(int x, int y, gU8 number, gColor color) { if (number & 0x01) gdispFillArea(x+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, y, SEVEN_SEG_WIDTH, SEVEN_SEG_HEIGHT, color); // A if (number & 0x02) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // B if (number & 0x04) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+(SEVEN_SEG_HEIGHT*2)+SEVEN_SEG_WIDTH+(SEVEN_SEG_SIZE*3), SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // C @@ -153,7 +153,7 @@ static void sevenSegDraw(int x, int y, uint8_t number, gColor color) { if (number & 0x40) gdispFillArea(x+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, y+SEVEN_SEG_HEIGHT+SEVEN_SEG_WIDTH+(SEVEN_SEG_SIZE*2), SEVEN_SEG_WIDTH, SEVEN_SEG_HEIGHT, color); // G } -static void drawShape(uint8_t color) { +static void drawShape(gU8 color) { int i; for (i = 0; i <= 3; i++) { if (tetrisCurrentShape[i][1] <= 16 || tetrisCurrentShape[i][1] >= 19) { @@ -167,14 +167,14 @@ static void drawShape(uint8_t color) { } } -// static uint32_t randomInt(uint32_t max) { //getting random number from STM32 hardware RNG -// static uint32_t new_value=0; +// static gU32 randomInt(gU32 max) { //getting random number from STM32 hardware RNG +// static gU32 new_value=0; // while ((RNG->SR & RNG_SR_DRDY) == 0) { } // new_value=RNG->DR % max; // return new_value; // } -static uint32_t randomInt(uint32_t max) { +static gU32 randomInt(gU32 max) { return rand() % max; } @@ -200,9 +200,9 @@ static void createShape(void) { memcpy(tetrisCurrentShape, tetrisOldShape, sizeof(tetrisCurrentShape)); // tetrisCurrentShape = tetrisOldShape; } -static void tellScore(uint8_t color) { +static void tellScore(gU8 color) { char pps_str[12]; - uint8_t i; + gU8 i; uitoa(tetrisLines, pps_str, sizeof(pps_str)); gdispFillArea((TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+5, gdispGetHeight()-50, gdispGetStringWidth(pps_str, font16)+4, gdispGetCharWidth('A', font16)+2, tetrisShapeColors[0]); gdispDrawString((TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+5, gdispGetHeight()-50, pps_str, font16, tetrisShapeColors[color]); @@ -237,7 +237,7 @@ static void initField(void) { tellScore(8); } -static void drawCell(int x, int y, uint8_t color) { +static void drawCell(int x, int y, gU8 color) { gdispFillArea((x*TETRIS_CELL_WIDTH)+2, gdispGetHeight()-TETRIS_CELL_HEIGHT-(y*TETRIS_CELL_HEIGHT)-3, TETRIS_CELL_WIDTH-2, TETRIS_CELL_HEIGHT-2, tetrisShapeColors[color]); if (color != 0) { gdispDrawBox((x*TETRIS_CELL_WIDTH)+2, gdispGetHeight()-TETRIS_CELL_HEIGHT-(y*TETRIS_CELL_HEIGHT)-3, TETRIS_CELL_WIDTH-1, TETRIS_CELL_HEIGHT-1, tetrisShapeColors[8]); @@ -246,7 +246,7 @@ static void drawCell(int x, int y, uint8_t color) { } } -static void printText(uint8_t color) { +static void printText(gU8 color) { gdispDrawString((TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+TETRIS_CELL_WIDTH, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT), "Next", font16, tetrisShapeColors[color]); gdispDrawString((TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+5, gdispGetHeight()-70, "Lines", font16, tetrisShapeColors[color]); } @@ -294,7 +294,7 @@ static gBool stay(gBool down) { static void clearCompleteLines(void) { gBool t; - uint8_t reiz = 0; + gU8 reiz = 0; int l,k,j; l = 0; while (l <= 16) { @@ -429,7 +429,7 @@ static void goLeft(void) { static DECLARE_THREAD_FUNCTION(thdTetris, arg) { (void)arg; - uint8_t i; + gU8 i; while (!tetrisGameOver) { // key handling if (gfxSystemTicks() - tetrisPreviousKeyTime >= gfxMillisecondsToTicks(tetrisKeySpeed) || gfxSystemTicks() <= gfxMillisecondsToTicks(tetrisKeySpeed)) { diff --git a/demos/modules/gadc/gwinosc.c b/demos/modules/gadc/gwinosc.c index b018fe7e..b9154d11 100644 --- a/demos/modules/gadc/gwinosc.c +++ b/demos/modules/gadc/gwinosc.c @@ -57,7 +57,7 @@ static const gwinVMT scopeVMT = { 0, // The after-clear routine }; -GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint32_t physdev, uint32_t frequency) { +GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, gU32 physdev, gU32 frequency) { /* Initialise the base class GWIN */ if (!(gs = (GScopeObject *)_gwindowCreate(g, &gs->g, pInit, &scopeVMT, 0))) return 0; @@ -87,7 +87,7 @@ void gwinScopeWaitForTrace(GHandle gh) { adcsample_t *pa; gCoord *pc; GDataBuffer *pd; - uint8_t shr; + gU8 shr; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP gBool rdytrigger; int flsamples; diff --git a/demos/modules/gadc/gwinosc.h b/demos/modules/gadc/gwinosc.h index 15ef2f3a..49b6e032 100644 --- a/demos/modules/gadc/gwinosc.h +++ b/demos/modules/gadc/gwinosc.h @@ -80,7 +80,7 @@ extern "C" { /** * Create a scope window. */ - GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint32_t physdev, uint32_t frequency); + GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, gU32 physdev, gU32 frequency); #define gwinScopeCreate(gs,pI,pd,f) gwinGScopeCreate(GDISP,gs,pI,pd,f) /** diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c index e46640e8..001dbc68 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.c +++ b/demos/modules/gaudio/oscilloscope/gwinosc.c @@ -64,7 +64,7 @@ static const gwinVMT scopeVMT = { 0, // The after-clear routine }; -GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, gU16 channel, gU32 frequency, ArrayDataFormat format) { /* Make sure the audio parameters are valid first */ if (!gaudioRecordInit(channel, frequency, format)) return 0; @@ -100,10 +100,10 @@ void gwinScopeWaitForTrace(GHandle gh) { int i; gCoord x, y; gCoord yoffset; - uint8_t *pa8; - uint16_t *pa16; + gU8 *pa8; + gU16 *pa16; gCoord *pc; - uint8_t shr; + gU8 shr; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP gBool rdytrigger; @@ -132,8 +132,8 @@ void gwinScopeWaitForTrace(GHandle gh) { x = gs->nextx; pc = gs->lastscopetrace+x; - pa8 = (uint8_t *)(paud+1); - pa16 = (uint16_t *)(paud+1); + pa8 = (gU8 *)(paud+1); + pa16 = (gU16 *)(paud+1); #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP rdytrigger = gFalse; diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.h b/demos/modules/gaudio/oscilloscope/gwinosc.h index e77a61b2..99e81dad 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.h +++ b/demos/modules/gaudio/oscilloscope/gwinosc.h @@ -81,7 +81,7 @@ extern "C" { /** * Create a scope window. */ - GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint16_t channel, uint32_t frequency, ArrayDataFormat format); + GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, gU16 channel, gU32 frequency, ArrayDataFormat format); #define gwinScopeCreate(gs,pI,ch,f,fmt) gwinGScopeCreate(GDISP,gs,pI,ch,f,fmt) /** diff --git a/demos/modules/gaudio/play-vs1053/main.c b/demos/modules/gaudio/play-vs1053/main.c index 8cfa60f6..663bcd12 100644 --- a/demos/modules/gaudio/play-vs1053/main.c +++ b/demos/modules/gaudio/play-vs1053/main.c @@ -46,8 +46,8 @@ int main(void) { gFont font; GFILE *f; char *errmsg; - uint32_t toplay; - uint32_t len; + gU32 toplay; + gU32 len; GDataBuffer *pd; // Initialise everything diff --git a/demos/modules/gaudio/play-wave/main.c b/demos/modules/gaudio/play-wave/main.c index c6a5ea84..8b54d185 100644 --- a/demos/modules/gaudio/play-wave/main.c +++ b/demos/modules/gaudio/play-wave/main.c @@ -48,10 +48,10 @@ int main(void) { gFont font; GFILE *f; char *errmsg; - uint32_t toplay; - uint32_t frequency; + gU32 toplay; + gU32 frequency; ArrayDataFormat datafmt; - uint32_t len; + gU32 len; GDataBuffer *pd; // Initialise everything @@ -92,8 +92,8 @@ repeatplay: } // Read the fmt block - len = (((uint32_t)(uint8_t)whdr[16])<<0) | (((uint32_t)(uint8_t)whdr[17])<<8) - | (((uint32_t)(uint8_t)whdr[18])<<16) | (((uint32_t)(uint8_t)whdr[19])<<24); + len = (((gU32)(gU8)whdr[16])<<0) | (((gU32)(gU8)whdr[17])<<8) + | (((gU32)(gU8)whdr[18])<<16) | (((gU32)(gU8)whdr[19])<<24); if (len > sizeof(whdr) || len < 16) { errmsg = "Err: Bad fmt len"; goto theend; @@ -123,8 +123,8 @@ repeatplay: #endif // Get the sample frequency (little endian format) and format - frequency = (((uint32_t)(uint8_t)whdr[4])<<0) | (((uint32_t)(uint8_t)whdr[5])<<8) - | (((uint32_t)(uint8_t)whdr[6])<<16) | (((uint32_t)(uint8_t)whdr[7])<<24); + frequency = (((gU32)(gU8)whdr[4])<<0) | (((gU32)(gU8)whdr[5])<<8) + | (((gU32)(gU8)whdr[6])<<16) | (((gU32)(gU8)whdr[7])<<24); datafmt = whdr[14] == 8 ? ARRAY_DATA_8BITUNSIGNED : ARRAY_DATA_16BITSIGNED; // Initialise the audio output device @@ -146,8 +146,8 @@ repeatplay: } // Get the block length (little endian format) - toplay = (((uint32_t)(uint8_t)whdr[4])<<0) | (((uint32_t)(uint8_t)whdr[5])<<8) - | (((uint32_t)(uint8_t)whdr[6])<<16) | (((uint32_t)(uint8_t)whdr[7])<<24); + toplay = (((gU32)(gU8)whdr[4])<<0) | (((gU32)(gU8)whdr[5])<<8) + | (((gU32)(gU8)whdr[6])<<16) | (((gU32)(gU8)whdr[7])<<24); // Stop scanning when this is a data block if (whdr[0] == 'd' && whdr[1] == 'a' && whdr[2] == 't' && whdr[3] == 'a') diff --git a/demos/modules/gdisp/arcsectors/main.c b/demos/modules/gdisp/arcsectors/main.c index 6a9a2737..4943f423 100644 --- a/demos/modules/gdisp/arcsectors/main.c +++ b/demos/modules/gdisp/arcsectors/main.c @@ -31,7 +31,7 @@ int main(void) { gCoord width, height, r1, r2, cx, cy; - uint8_t sectors; + gU8 sectors; // Initialize and clear the display gfxInit(); diff --git a/demos/modules/gdisp/fonts/font_Apple12.h b/demos/modules/gdisp/fonts/font_Apple12.h index 38e124d7..512612a9 100644 --- a/demos/modules/gdisp/fonts/font_Apple12.h +++ b/demos/modules/gdisp/fonts/font_Apple12.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phpoXxi1Y_dictionary_data[193] = { +static const gU8 mf_rlefont_phpoXxi1Y_dictionary_data[193] = { 0x04, 0x81, 0x04, 0x01, 0x81, 0x04, 0x0d, 0x81, 0x05, 0x80, 0x03, 0x80, 0x0b, 0x80, 0x09, 0x81, 0x08, 0x83, 0x06, 0x01, 0x80, 0x08, 0x02, 0x81, 0x02, 0x81, 0x06, 0x84, 0x04, 0x80, 0x0a, 0x81, 0x02, 0x0f, 0x80, 0x85, 0x02, 0x04, 0x81, 0x04, 0x81, 0x81, 0x06, 0x31, 0x81, 0x08, 0x08, 0x82, @@ -27,7 +27,7 @@ static const uint8_t mf_rlefont_phpoXxi1Y_dictionary_data[193] = { 0xc7, }; -static const uint16_t mf_rlefont_phpoXxi1Y_dictionary_offsets[76] = { +static const gU16 mf_rlefont_phpoXxi1Y_dictionary_offsets[76] = { 0x0000, 0x0003, 0x0006, 0x0008, 0x000a, 0x000c, 0x0011, 0x0013, 0x0016, 0x0018, 0x001b, 0x001d, 0x0021, 0x0023, 0x0025, 0x0029, 0x002b, 0x002d, 0x002e, 0x0031, 0x0033, 0x0036, 0x0037, 0x0039, @@ -40,7 +40,7 @@ static const uint16_t mf_rlefont_phpoXxi1Y_dictionary_offsets[76] = { 0x00b5, 0x00b8, 0x00bc, 0x00c1, }; -static const uint8_t mf_rlefont_phpoXxi1Y_glyph_data_0[954] = { +static const gU8 mf_rlefont_phpoXxi1Y_glyph_data_0[954] = { 0x0c, 0x00, 0x10, 0x0c, 0x32, 0x4b, 0x4b, 0x2d, 0x31, 0x10, 0x0d, 0x2f, 0x1a, 0x4d, 0x4d, 0x4d, 0x4d, 0x37, 0x10, 0x0c, 0x00, 0x1a, 0x4d, 0x4d, 0x19, 0x80, 0x8b, 0x70, 0x44, 0xd1, 0x1b, 0x83, 0x64, 0x4d, 0x4d, 0x4d, 0x37, 0x10, 0x0c, 0x5c, 0x22, 0x9f, 0x3c, 0x9e, 0x29, 0x93, 0x4e, 0x4d, @@ -103,7 +103,7 @@ static const uint8_t mf_rlefont_phpoXxi1Y_glyph_data_0[954] = { 0x35, 0x85, 0x80, 0x10, 0x0c, 0x24, 0x3d, 0x8a, 0x7a, 0x10, }; -static const uint16_t mf_rlefont_phpoXxi1Y_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phpoXxi1Y_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000a, 0x0013, 0x0026, 0x0034, 0x0041, 0x0051, 0x0056, 0x0061, 0x006d, 0x007c, 0x0083, 0x008b, 0x0091, 0x0097, 0x009f, 0x00ac, 0x00b3, 0x00bd, 0x00c7, 0x00d0, 0x00db, 0x00e7, diff --git a/demos/modules/gdisp/fonts/font_FreePixel10.h b/demos/modules/gdisp/fonts/font_FreePixel10.h index a9a74018..30e3cddf 100644 --- a/demos/modules/gdisp/fonts/font_FreePixel10.h +++ b/demos/modules/gdisp/fonts/font_FreePixel10.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_phpdxISdS_glyph_data_0[888] = { +static const gU8 mf_bwfont_phpdxISdS_glyph_data_0[888] = { 0x00, 0x00, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x88, 0x00, 0xfc, 0x01, 0x88, 0x00, 0xfc, 0x01, 0x88, 0x00, 0x00, 0x00, 0x98, 0x00, 0x04, 0x01, 0xfe, 0x01, 0x24, 0x01, 0xe8, 0x00, 0x00, 0x00, 0x08, 0x01, 0xd4, 0x00, 0x28, 0x01, 0x90, 0x02, @@ -70,7 +70,7 @@ static const uint8_t mf_bwfont_phpdxISdS_glyph_data_0[888] = { 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, }; -static const uint16_t mf_bwfont_phpdxISdS_glyph_offsets_0[96] = { +static const gU16 mf_bwfont_phpdxISdS_glyph_offsets_0[96] = { 0x0000, 0x0000, 0x0003, 0x0008, 0x000d, 0x0013, 0x0019, 0x001e, 0x0021, 0x0025, 0x0028, 0x002c, 0x0031, 0x0034, 0x0038, 0x003b, 0x0040, 0x0045, 0x0049, 0x004e, 0x0053, 0x0058, 0x005d, 0x0062, @@ -85,7 +85,7 @@ static const uint16_t mf_bwfont_phpdxISdS_glyph_offsets_0[96] = { 0x019f, 0x01a4, 0x01a9, 0x01ad, 0x01b1, 0x01b4, 0x01b8, 0x01bc, }; -static const uint8_t mf_bwfont_phpdxISdS_glyph_widths_0[95] = { +static const gU8 mf_bwfont_phpdxISdS_glyph_widths_0[95] = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, diff --git a/demos/modules/gdisp/fonts/font_GeosansLight11.h b/demos/modules/gdisp/fonts/font_GeosansLight11.h index be6c674f..896b8948 100644 --- a/demos/modules/gdisp/fonts/font_GeosansLight11.h +++ b/demos/modules/gdisp/fonts/font_GeosansLight11.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phppBNCNS_dictionary_data[123] = { +static const gU8 mf_rlefont_phppBNCNS_dictionary_data[123] = { 0x12, 0x80, 0x02, 0x80, 0x02, 0x83, 0x05, 0x01, 0x80, 0x06, 0x01, 0x83, 0x04, 0x04, 0x84, 0x05, 0x80, 0x03, 0x80, 0x05, 0x03, 0x80, 0x09, 0x80, 0x06, 0x81, 0x06, 0x27, 0x02, 0x80, 0x06, 0x02, 0x82, 0x03, 0x04, 0x80, 0x07, 0x01, 0x80, 0x02, 0x80, 0x03, 0x80, 0x81, 0x80, 0x06, 0x0b, 0x06, @@ -22,7 +22,7 @@ static const uint8_t mf_rlefont_phppBNCNS_dictionary_data[123] = { 0x2d, 0x1f, 0x2e, 0x1f, 0x1c, 0x00, 0x21, 0xf5, 0x49, 0xa6, 0xfa, }; -static const uint16_t mf_rlefont_phppBNCNS_dictionary_offsets[50] = { +static const gU16 mf_rlefont_phppBNCNS_dictionary_offsets[50] = { 0x0000, 0x0001, 0x0005, 0x0007, 0x000a, 0x000d, 0x000f, 0x0011, 0x0014, 0x0019, 0x001b, 0x001c, 0x001f, 0x0022, 0x0025, 0x0027, 0x0029, 0x002b, 0x002c, 0x002e, 0x002f, 0x0030, 0x0035, 0x0037, @@ -32,7 +32,7 @@ static const uint16_t mf_rlefont_phppBNCNS_dictionary_offsets[50] = { 0x007a, 0x007b, }; -static const uint8_t mf_rlefont_phppBNCNS_glyph_data_0[731] = { +static const gU8 mf_rlefont_phppBNCNS_glyph_data_0[731] = { 0x03, 0x00, 0x10, 0x03, 0x1b, 0x33, 0x2b, 0x27, 0x10, 0x02, 0xc7, 0x64, 0x10, 0x06, 0x2b, 0xce, 0x64, 0x8b, 0x98, 0x64, 0x8b, 0x1e, 0x10, 0x06, 0xfc, 0x2f, 0x3f, 0x3f, 0x3a, 0x39, 0xe8, 0x85, 0x98, 0x54, 0x86, 0x24, 0x1e, 0x10, 0x05, 0xe6, 0x2c, 0x91, 0x94, 0x87, 0x39, 0x1f, 0x37, 0xe6, @@ -81,7 +81,7 @@ static const uint8_t mf_rlefont_phppBNCNS_glyph_data_0[731] = { 0x10, 0x02, 0x2a, 0x3d, 0x33, 0x27, 0x10, 0x05, 0x22, 0xe2, 0x10, }; -static const uint16_t mf_rlefont_phppBNCNS_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phppBNCNS_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x0009, 0x000d, 0x0017, 0x0026, 0x0034, 0x0040, 0x0044, 0x0049, 0x0050, 0x0055, 0x005c, 0x0061, 0x0066, 0x006a, 0x0071, 0x007c, 0x0080, 0x0089, 0x0094, 0x00a0, 0x00a9, 0x00b2, diff --git a/demos/modules/gdisp/fonts/font_GeosansLight11_aa.h b/demos/modules/gdisp/fonts/font_GeosansLight11_aa.h index 78a90c24..333c8c97 100644 --- a/demos/modules/gdisp/fonts/font_GeosansLight11_aa.h +++ b/demos/modules/gdisp/fonts/font_GeosansLight11_aa.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phpTJ5Kmd_dictionary_data[201] = { +static const gU8 mf_rlefont_phpTJ5Kmd_dictionary_data[201] = { 0x02, 0x06, 0xc7, 0x02, 0x03, 0x0d, 0xc3, 0xc5, 0x01, 0x05, 0x08, 0xc7, 0x08, 0x04, 0x01, 0xc1, 0xc6, 0x06, 0x0c, 0x06, 0x01, 0xc7, 0x06, 0xd8, 0xc6, 0x09, 0x38, 0x09, 0xd7, 0x01, 0xc6, 0xc7, 0x02, 0xc7, 0x07, 0x0a, 0x07, 0xc4, 0x01, 0x39, 0xc8, 0xc2, 0xc7, 0x02, 0xc1, 0x03, 0xc7, 0xc8, @@ -27,7 +27,7 @@ static const uint8_t mf_rlefont_phpTJ5Kmd_dictionary_data[201] = { 0x54, 0x09, 0x29, 0x05, 0x2d, 0x1e, 0x03, 0x1a, 0x37, }; -static const uint16_t mf_rlefont_phpTJ5Kmd_dictionary_offsets[84] = { +static const gU16 mf_rlefont_phpTJ5Kmd_dictionary_offsets[84] = { 0x0000, 0x0001, 0x0004, 0x0005, 0x0006, 0x0009, 0x000a, 0x000b, 0x000d, 0x000e, 0x0012, 0x0013, 0x0014, 0x0017, 0x0018, 0x001a, 0x001b, 0x001c, 0x001d, 0x001f, 0x0023, 0x0024, 0x0025, 0x0027, @@ -41,7 +41,7 @@ static const uint16_t mf_rlefont_phpTJ5Kmd_dictionary_offsets[84] = { 0x00c1, 0x00c5, 0x00c7, 0x00c9, }; -static const uint8_t mf_rlefont_phpTJ5Kmd_glyph_data_0[1615] = { +static const gU8 mf_rlefont_phpTJ5Kmd_glyph_data_0[1615] = { 0x03, 0x00, 0x10, 0x03, 0x1b, 0x5c, 0x5c, 0x05, 0x46, 0x09, 0x10, 0x02, 0x22, 0x05, 0x59, 0x3a, 0x10, 0x06, 0x1a, 0x46, 0x3e, 0x3e, 0x23, 0x02, 0x04, 0x07, 0x05, 0x4e, 0x23, 0x3e, 0x03, 0x01, 0x23, 0x3f, 0x05, 0x07, 0x55, 0x1d, 0x3e, 0x3e, 0x10, 0x06, 0x1b, 0x02, 0x09, 0x0b, 0x09, 0x32, @@ -145,7 +145,7 @@ static const uint8_t mf_rlefont_phpTJ5Kmd_glyph_data_0[1615] = { 0x36, 0x1e, 0x2a, 0x2c, 0x60, 0x26, 0x05, 0x04, 0x10, 0x05, 0x27, 0x04, 0x40, 0x3d, 0x10, }; -static const uint16_t mf_rlefont_phpTJ5Kmd_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phpTJ5Kmd_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000b, 0x0011, 0x0029, 0x004b, 0x006b, 0x008e, 0x0094, 0x00a4, 0x00b7, 0x00c1, 0x00ca, 0x00d3, 0x00da, 0x00de, 0x00ed, 0x010a, 0x0112, 0x0126, 0x0145, 0x015d, 0x0177, 0x0194, diff --git a/demos/modules/gdisp/fonts/font_babyblue11_aa.h b/demos/modules/gdisp/fonts/font_babyblue11_aa.h index 031c7453..343b10e0 100644 --- a/demos/modules/gdisp/fonts/font_babyblue11_aa.h +++ b/demos/modules/gdisp/fonts/font_babyblue11_aa.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phptTISF3_dictionary_data[311] = { +static const gU8 mf_rlefont_phptTISF3_dictionary_data[311] = { 0x1b, 0x01, 0xc5, 0xc6, 0x01, 0x04, 0x03, 0x02, 0x05, 0xca, 0x03, 0xca, 0x03, 0x08, 0x06, 0x0b, 0xc1, 0xc8, 0xca, 0x09, 0xea, 0x03, 0xc5, 0xc6, 0x04, 0xc2, 0x04, 0xc5, 0xc6, 0x01, 0xc3, 0xc4, 0x22, 0x09, 0xc1, 0xe3, 0x05, 0xc5, 0xca, 0xd8, 0xc6, 0x04, 0xe3, 0xc2, 0x04, 0xc5, 0xca, 0xd8, @@ -34,7 +34,7 @@ static const uint8_t mf_rlefont_phptTISF3_dictionary_data[311] = { 0x2b, 0x1b, 0x03, 0x0a, 0x50, 0x1c, 0x48, }; -static const uint16_t mf_rlefont_phptTISF3_dictionary_offsets[100] = { +static const gU16 mf_rlefont_phptTISF3_dictionary_offsets[100] = { 0x0000, 0x0001, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000d, 0x000e, 0x000f, 0x0010, 0x0013, 0x0014, 0x0015, 0x0018, 0x001a, 0x001e, 0x0021, 0x002a, 0x0030, 0x0031, 0x0033, 0x0035, 0x0037, @@ -50,7 +50,7 @@ static const uint16_t mf_rlefont_phptTISF3_dictionary_offsets[100] = { 0x0131, 0x0133, 0x0135, 0x0137, }; -static const uint8_t mf_rlefont_phptTISF3_glyph_data_0[1487] = { +static const gU8 mf_rlefont_phptTISF3_glyph_data_0[1487] = { 0x03, 0x00, 0x10, 0x02, 0x64, 0x66, 0x03, 0x04, 0x47, 0x28, 0x03, 0x23, 0x35, 0x09, 0x1b, 0x25, 0x0a, 0x20, 0x35, 0x09, 0x10, 0x06, 0x00, 0x23, 0x08, 0x3c, 0x02, 0x1d, 0x72, 0x0b, 0x2d, 0x72, 0x0b, 0x2d, 0x09, 0x4a, 0x1d, 0x09, 0x4a, 0x10, 0x06, 0x1c, 0x74, 0x44, 0x03, 0x0b, 0x03, 0x1d, @@ -146,7 +146,7 @@ static const uint8_t mf_rlefont_phptTISF3_glyph_data_0[1487] = { 0x18, 0x01, 0x02, 0x01, 0x44, 0x1b, 0x07, 0x38, 0x07, 0x41, 0x78, 0x4e, 0x04, 0x03, 0x10, }; -static const uint16_t mf_rlefont_phptTISF3_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phptTISF3_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000a, 0x0015, 0x0028, 0x004f, 0x0070, 0x008e, 0x0094, 0x00a2, 0x00b0, 0x00c3, 0x00d7, 0x00df, 0x00e6, 0x00eb, 0x00f9, 0x0103, 0x0111, 0x0123, 0x013a, 0x014f, 0x0166, 0x017a, diff --git a/demos/modules/gdisp/fonts/font_hellovetica11.h b/demos/modules/gdisp/fonts/font_hellovetica11.h index d82e8e71..3b35ef6c 100644 --- a/demos/modules/gdisp/fonts/font_hellovetica11.h +++ b/demos/modules/gdisp/fonts/font_hellovetica11.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phptWBvQt_dictionary_data[244] = { +static const gU8 mf_rlefont_phptWBvQt_dictionary_data[244] = { 0x05, 0x07, 0x0b, 0x80, 0x0c, 0x0a, 0x03, 0x80, 0x80, 0x05, 0x81, 0x05, 0x80, 0x05, 0x81, 0x05, 0x80, 0x05, 0x81, 0x05, 0x80, 0x07, 0x80, 0x01, 0x32, 0x87, 0x04, 0x80, 0x06, 0x81, 0x06, 0x80, 0x04, 0x81, 0x02, 0x84, 0x04, 0x80, 0x0c, 0x80, 0x0c, 0x80, 0x07, 0x80, 0x04, 0x80, 0x01, 0x80, @@ -30,7 +30,7 @@ static const uint8_t mf_rlefont_phptWBvQt_dictionary_data[244] = { 0x8e, 0x0f, 0x3c, 0x8c, }; -static const uint16_t mf_rlefont_phptWBvQt_dictionary_offsets[70] = { +static const gU16 mf_rlefont_phptWBvQt_dictionary_offsets[70] = { 0x0000, 0x0001, 0x0002, 0x0005, 0x0006, 0x0008, 0x0018, 0x0019, 0x001a, 0x001e, 0x0023, 0x0024, 0x0025, 0x002b, 0x002f, 0x0032, 0x0037, 0x0039, 0x003c, 0x003e, 0x0041, 0x0047, 0x0049, 0x004c, @@ -42,7 +42,7 @@ static const uint16_t mf_rlefont_phptWBvQt_dictionary_offsets[70] = { 0x00e6, 0x00ea, 0x00ec, 0x00ef, 0x00f1, 0x00f4, }; -static const uint8_t mf_rlefont_phptWBvQt_glyph_data_0[725] = { +static const gU8 mf_rlefont_phptWBvQt_glyph_data_0[725] = { 0x02, 0x00, 0x10, 0x05, 0x47, 0x4d, 0x24, 0x1b, 0x1b, 0x1a, 0x10, 0x06, 0xe6, 0x5c, 0x5c, 0x5c, 0x0f, 0x10, 0x03, 0x00, 0x10, 0x03, 0x47, 0x0f, 0x10, 0x05, 0x2a, 0x47, 0x4e, 0x06, 0x1e, 0x33, 0xc0, 0x10, 0x05, 0x2a, 0xfe, 0x10, 0x05, 0x33, 0x3a, 0x33, 0x33, 0xa4, 0x10, 0x05, 0x33, 0x3b, @@ -91,7 +91,7 @@ static const uint8_t mf_rlefont_phptWBvQt_glyph_data_0[725] = { 0x1f, 0x10, 0x01, 0x00, 0x10, }; -static const uint16_t mf_rlefont_phptWBvQt_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phptWBvQt_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000b, 0x0012, 0x0012, 0x0012, 0x0012, 0x0015, 0x0000, 0x0000, 0x0012, 0x0012, 0x0019, 0x001d, 0x0022, 0x0000, 0x0012, 0x0012, 0x0012, 0x0012, 0x0012, 0x0012, 0x0012, 0x0012, diff --git a/demos/modules/gdisp/fonts/font_hellovetica11_aa.h b/demos/modules/gdisp/fonts/font_hellovetica11_aa.h index 194c1216..53a625a6 100644 --- a/demos/modules/gdisp/fonts/font_hellovetica11_aa.h +++ b/demos/modules/gdisp/fonts/font_hellovetica11_aa.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phpMM3UuI_dictionary_data[351] = { +static const gU8 mf_rlefont_phpMM3UuI_dictionary_data[351] = { 0x0d, 0xc4, 0xce, 0x07, 0xc5, 0x80, 0xc2, 0x02, 0xc5, 0x80, 0xc2, 0x02, 0xc5, 0x80, 0xc2, 0x05, 0xc5, 0x80, 0xc2, 0x05, 0x03, 0xc5, 0x80, 0xc2, 0x40, 0x32, 0xf2, 0x0c, 0x83, 0x0c, 0xf4, 0x1d, 0x06, 0xc5, 0x2d, 0x40, 0x04, 0x80, 0xc7, 0xf6, 0x06, 0xc7, 0xc6, 0x80, 0xc2, 0x09, 0x80, 0xc2, @@ -36,7 +36,7 @@ static const uint8_t mf_rlefont_phpMM3UuI_dictionary_data[351] = { 0x32, 0x32, 0x30, 0x83, 0x30, 0x06, 0x2e, 0x2e, 0x2e, 0x1a, 0x38, 0x18, 0x05, 0x4d, 0x1b, }; -static const uint16_t mf_rlefont_phpMM3UuI_dictionary_offsets[98] = { +static const gU16 mf_rlefont_phpMM3UuI_dictionary_offsets[98] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000b, 0x0014, 0x0018, 0x0020, 0x0022, 0x0023, 0x0025, 0x0028, 0x0029, 0x002b, 0x002e, 0x0031, 0x0036, 0x0039, 0x003b, 0x003f, 0x0040, 0x0042, 0x0043, 0x0044, @@ -52,7 +52,7 @@ static const uint16_t mf_rlefont_phpMM3UuI_dictionary_offsets[98] = { 0x015c, 0x015f, }; -static const uint8_t mf_rlefont_phpMM3UuI_glyph_data_0[1386] = { +static const gU8 mf_rlefont_phpMM3UuI_glyph_data_0[1386] = { 0x02, 0x00, 0x10, 0x06, 0x6a, 0x64, 0x2b, 0x18, 0x60, 0x10, 0x08, 0x1b, 0x6b, 0x6b, 0x6b, 0x2a, 0x10, 0x03, 0x00, 0x10, 0x05, 0x2d, 0x56, 0x38, 0x10, 0x06, 0x2b, 0x33, 0x38, 0x38, 0x10, 0x06, 0x1e, 0x10, 0x06, 0x33, 0x60, 0x10, 0x06, 0x48, 0x6c, 0x4a, 0x3e, 0x3f, 0x31, 0x60, 0x10, 0x06, @@ -142,7 +142,7 @@ static const uint8_t mf_rlefont_phpMM3UuI_glyph_data_0[1386] = { 0x6c, 0x2b, 0x4e, 0x22, 0x23, 0x29, 0x10, 0x01, 0x00, 0x10, }; -static const uint16_t mf_rlefont_phpMM3UuI_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phpMM3UuI_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000a, 0x0011, 0x0011, 0x0011, 0x0011, 0x0014, 0x0000, 0x0000, 0x0011, 0x0011, 0x0019, 0x001f, 0x0022, 0x0000, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, diff --git a/demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h b/demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h index e20e9815..ba5cd8f3 100644 --- a/demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h +++ b/demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phpMbOYHb_dictionary_data[226] = { +static const gU8 mf_rlefont_phpMbOYHb_dictionary_data[226] = { 0x80, 0x04, 0x02, 0x81, 0x03, 0x80, 0x03, 0x04, 0x07, 0x03, 0x80, 0x0b, 0x18, 0x02, 0x01, 0x83, 0x09, 0x0a, 0x03, 0x32, 0x84, 0x32, 0x81, 0x0b, 0x40, 0x07, 0x84, 0xc6, 0x83, 0x08, 0x80, 0x0b, 0x80, 0x0b, 0x80, 0x08, 0x80, 0x05, 0x40, 0x15, 0x06, 0xcb, 0x04, 0x31, 0xc6, 0x01, 0x80, 0x01, @@ -29,7 +29,7 @@ static const uint8_t mf_rlefont_phpMbOYHb_dictionary_data[226] = { 0x1c, 0x0b, }; -static const uint16_t mf_rlefont_phpMbOYHb_dictionary_offsets[81] = { +static const gU16 mf_rlefont_phpMbOYHb_dictionary_offsets[81] = { 0x0000, 0x0002, 0x0004, 0x0007, 0x0008, 0x0009, 0x000c, 0x000d, 0x000e, 0x0010, 0x0011, 0x0012, 0x0013, 0x0015, 0x0017, 0x0018, 0x001a, 0x001c, 0x001e, 0x0024, 0x0026, 0x0028, 0x002b, 0x002d, @@ -43,7 +43,7 @@ static const uint16_t mf_rlefont_phpMbOYHb_dictionary_offsets[81] = { 0x00e2, }; -static const uint8_t mf_rlefont_phpMbOYHb_glyph_data_0[1283] = { +static const gU8 mf_rlefont_phpMbOYHb_glyph_data_0[1283] = { 0x04, 0x00, 0x10, 0x04, 0x46, 0x48, 0x0d, 0xc4, 0x1e, 0x39, 0x10, 0x06, 0x51, 0x38, 0x57, 0x1b, 0xa8, 0x10, 0x08, 0x46, 0x0f, 0x38, 0x94, 0x42, 0x8e, 0x39, 0x0c, 0x0f, 0x0c, 0x18, 0x94, 0x42, 0x8e, 0x39, 0x0a, 0x0f, 0x0a, 0x2b, 0xac, 0x84, 0xac, 0x84, 0xac, 0x10, 0x08, 0x23, 0x40, 0x1e, @@ -127,7 +127,7 @@ static const uint8_t mf_rlefont_phpMbOYHb_glyph_data_0[1283] = { 0x42, 0x64, 0x10, }; -static const uint16_t mf_rlefont_phpMbOYHb_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phpMbOYHb_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000b, 0x0012, 0x002c, 0x0057, 0x006c, 0x008d, 0x0090, 0x00a5, 0x00b6, 0x00cb, 0x00d4, 0x00db, 0x00e0, 0x00e5, 0x00f9, 0x0103, 0x010a, 0x0124, 0x013a, 0x0152, 0x015e, 0x0170, diff --git a/demos/modules/gdisp/fonts_cyrillic/userfonts.h b/demos/modules/gdisp/fonts_cyrillic/userfonts.h index 4cb6b503..97d4bb7c 100644 --- a/demos/modules/gdisp/fonts_cyrillic/userfonts.h +++ b/demos/modules/gdisp/fonts_cyrillic/userfonts.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_php6ySCWY_dictionary_data[352] = { +static const gU8 mf_rlefont_php6ySCWY_dictionary_data[352] = { 0x11, 0x09, 0x80, 0x03, 0x0f, 0x80, 0x0f, 0x80, 0x41, 0x01, 0x80, 0xc5, 0x80, 0xce, 0xc6, 0x0f, 0x80, 0x0e, 0x02, 0x09, 0x80, 0x09, 0x0b, 0xc2, 0xce, 0x04, 0x0f, 0x0d, 0xc1, 0xcc, 0x05, 0x80, 0x09, 0x80, 0x05, 0x80, 0xce, 0xc2, 0x01, 0x80, 0xc3, 0x40, 0x01, 0xce, 0xc7, 0x06, 0x80, 0x03, @@ -36,7 +36,7 @@ static const uint8_t mf_rlefont_php6ySCWY_dictionary_data[352] = { 0x29, 0x22, 0x4e, 0x1a, 0x45, 0x3e, 0x31, 0x1f, 0x1b, 0x1b, 0x4c, 0x56, 0x01, 0x28, 0x1a, 0x23, }; -static const uint16_t mf_rlefont_php6ySCWY_dictionary_offsets[138] = { +static const gU16 mf_rlefont_php6ySCWY_dictionary_offsets[138] = { 0x0000, 0x0001, 0x0003, 0x0004, 0x0008, 0x000b, 0x000d, 0x000f, 0x0011, 0x0012, 0x0013, 0x0014, 0x0016, 0x0017, 0x0019, 0x001a, 0x001b, 0x001c, 0x001e, 0x0022, 0x0024, 0x0027, 0x0029, 0x002b, @@ -57,7 +57,7 @@ static const uint16_t mf_rlefont_php6ySCWY_dictionary_offsets[138] = { 0x015e, 0x0160, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_0[1460] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_0[1460] = { 0x06, 0x00, 0x10, 0x02, 0x3c, 0x1b, 0x1b, 0x27, 0x01, 0x1f, 0x07, 0x10, 0x04, 0x38, 0x3f, 0x67, 0x70, 0x06, 0x0c, 0x28, 0x43, 0x08, 0x10, 0x08, 0x00, 0x3c, 0xa0, 0x5a, 0x37, 0x07, 0x19, 0xcc, 0x32, 0xa0, 0x5a, 0x37, 0x07, 0x60, 0xa6, 0x4c, 0xa6, 0x10, 0x08, 0x46, 0x1f, 0x5f, 0x56, 0x33, @@ -152,7 +152,7 @@ static const uint8_t mf_rlefont_php6ySCWY_glyph_data_0[1460] = { 0x05, 0x0c, 0x36, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000c, 0x0017, 0x002a, 0x0043, 0x0071, 0x0093, 0x0098, 0x00a3, 0x00af, 0x00bb, 0x00c2, 0x00c8, 0x00ce, 0x00d1, 0x00e8, 0x0100, 0x0106, 0x011c, 0x012e, 0x0147, 0x0156, 0x016b, @@ -167,7 +167,7 @@ static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_0[95] = { 0x053c, 0x0554, 0x056e, 0x0580, 0x058d, 0x0594, 0x05a4, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_1[1341] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_1[1341] = { 0x06, 0x00, 0x10, 0x02, 0x3c, 0x7e, 0x01, 0x9e, 0x10, 0x00, 0x02, 0x3c, 0x7e, 0x0f, 0x7e, 0x0d, 0x06, 0x28, 0x18, 0x0d, 0x1b, 0x10, 0x05, 0x18, 0x61, 0x5c, 0x5f, 0x84, 0x24, 0x0d, 0x0f, 0x43, 0x5f, 0x0b, 0x01, 0x29, 0x5f, 0x52, 0x35, 0x5f, 0x06, 0x0d, 0x8a, 0x97, 0x27, 0x0c, 0x5f, 0x4a, @@ -254,7 +254,7 @@ static const uint8_t mf_rlefont_php6ySCWY_glyph_data_1[1341] = { 0x06, 0x2e, 0x34, 0x7f, 0x5f, 0x0b, 0x0e, 0x02, 0x3e, 0x08, 0x2d, 0x39, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_1[96] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_1[96] = { 0x0000, 0x0003, 0x0009, 0x0009, 0x0009, 0x0009, 0x000a, 0x0016, 0x0009, 0x0032, 0x0009, 0x0042, 0x0009, 0x0009, 0x004f, 0x0009, 0x005f, 0x006a, 0x0075, 0x007c, 0x0084, 0x0009, 0x0009, 0x0089, @@ -269,24 +269,24 @@ static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_1[96] = { 0x04ce, 0x04df, 0x04f1, 0x04fa, 0x050c, 0x0513, 0x0522, 0x0530, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_2[17] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_2[17] = { 0x05, 0x21, 0x07, 0x08, 0x28, 0x5a, 0x42, 0x70, 0x08, 0x57, 0x01, 0x24, 0x08, 0x21, 0x06, 0x01, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_2[1] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_2[1] = { 0x0000, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_3[16] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_3[16] = { 0x06, 0x38, 0x05, 0x0e, 0x58, 0x02, 0x08, 0x32, 0x8f, 0x4c, 0x08, 0x01, 0x05, 0x0c, 0x36, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_3[1] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_3[1] = { 0x0000, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_4[1096] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_4[1096] = { 0x08, 0xac, 0x4c, 0x18, 0x37, 0x6e, 0x0f, 0x8f, 0x10, 0x00, 0x08, 0x38, 0x93, 0x1e, 0x6a, 0x2a, 0x37, 0x75, 0x2b, 0x10, 0x08, 0x38, 0x37, 0x01, 0x19, 0x1b, 0x33, 0x43, 0x19, 0x81, 0x81, 0x33, 0x1e, 0x10, 0x08, 0x8d, 0x9a, 0x29, 0x22, 0xc5, 0x35, 0x60, 0xc2, 0x8a, 0x22, 0xc5, 0x35, 0x19, @@ -358,7 +358,7 @@ static const uint8_t mf_rlefont_php6ySCWY_glyph_data_4[1096] = { 0x0f, 0x2f, 0x76, 0x6c, 0x08, 0x49, 0x0d, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_4[81] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_4[81] = { 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x000a, 0x0014, 0x0022, 0x0034, 0x003a, 0x0052, 0x0059, 0x0081, 0x0093, @@ -372,7 +372,7 @@ static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_4[81] = { 0x0438, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_5[159] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_5[159] = { 0x06, 0x27, 0x62, 0x3c, 0x8f, 0x10, 0x08, 0x5e, 0x2e, 0x37, 0x2d, 0x10, 0x00, 0x02, 0x38, 0x06, 0x7e, 0x0a, 0x7e, 0x0d, 0x07, 0x10, 0x02, 0x3c, 0x05, 0x87, 0x10, 0x02, 0x1c, 0x04, 0x20, 0x0e, 0x10, 0x04, 0x38, 0x06, 0x07, 0x09, 0x04, 0x24, 0x4f, 0x07, 0x40, 0x5f, 0x0d, 0x08, 0x5c, 0x10, @@ -385,7 +385,7 @@ static const uint8_t mf_rlefont_php6ySCWY_glyph_data_5[159] = { 0x5a, 0x08, 0x10, 0x05, 0x62, 0x5a, 0x08, 0x20, 0x78, 0x28, 0x78, 0x5f, 0x5a, 0x08, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_5[40] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_5[40] = { 0x0000, 0x0006, 0x000c, 0x000c, 0x000c, 0x000d, 0x0016, 0x001b, 0x000c, 0x0021, 0x0030, 0x003b, 0x000c, 0x000c, 0x000c, 0x0044, 0x000c, 0x000c, 0x000c, 0x004a, 0x000c, 0x000c, 0x000c, 0x000c, @@ -393,14 +393,14 @@ static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_5[40] = { 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x0085, 0x0093, }; -static const uint8_t mf_rlefont_php6ySCWY_glyph_data_6[50] = { +static const gU8 mf_rlefont_php6ySCWY_glyph_data_6[50] = { 0x0d, 0x38, 0x0b, 0x08, 0x26, 0x0b, 0x00, 0x64, 0x1e, 0xd4, 0x42, 0xcc, 0x58, 0x29, 0xd4, 0x34, 0x07, 0xe8, 0x58, 0x29, 0x00, 0xcc, 0x34, 0x06, 0xf6, 0x64, 0x1e, 0x21, 0xc8, 0x34, 0x4a, 0x60, 0xc6, 0x5d, 0x67, 0x91, 0xc5, 0xc5, 0x34, 0x10, 0x00, 0x06, 0x62, 0x51, 0x03, 0x0b, 0x60, 0xb4, 0x1d, 0x10, }; -static const uint16_t mf_rlefont_php6ySCWY_glyph_offsets_6[13] = { +static const gU16 mf_rlefont_php6ySCWY_glyph_offsets_6[13] = { 0x0000, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0029, }; diff --git a/demos/modules/ginput/keyboard/main.c b/demos/modules/ginput/keyboard/main.c index d6a987b0..0e10de8b 100644 --- a/demos/modules/ginput/keyboard/main.c +++ b/demos/modules/ginput/keyboard/main.c @@ -98,7 +98,7 @@ int main(void) { if (pk->bytecount) { gwinPrintf(GW, " Keys:"); for (i = 0; i < pk->bytecount; i++) - gwinPrintf(GW, " 0x%02X", (int)(uint8_t)pk->c[i]); + gwinPrintf(GW, " 0x%02X", (int)(gU8)pk->c[i]); gwinPrintf(GW, " ["); for (i = 0; i < pk->bytecount; i++) gwinPrintf(GW, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' '); diff --git a/demos/modules/gtrans/basic/userfonts.h b/demos/modules/gtrans/basic/userfonts.h index b00d1889..2ae28ed5 100644 --- a/demos/modules/gtrans/basic/userfonts.h +++ b/demos/modules/gtrans/basic/userfonts.h @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_phpRVS9jE_dictionary_data[1423] = { +static const gU8 mf_rlefont_phpRVS9jE_dictionary_data[1423] = { 0x05, 0xc2, 0xce, 0x29, 0x0a, 0x15, 0x0d, 0x07, 0x86, 0x13, 0x85, 0x80, 0x16, 0x80, 0x16, 0x80, 0x08, 0x33, 0xcd, 0xde, 0x80, 0x06, 0x80, 0x0f, 0x80, 0x06, 0x80, 0x01, 0x0f, 0xc3, 0xcb, 0x0e, 0x01, 0x80, 0x01, 0x80, 0x13, 0x82, 0x0c, 0x03, 0xc1, 0x40, 0x0b, 0xcd, 0xc2, 0x04, 0x89, 0x16, @@ -103,7 +103,7 @@ static const uint8_t mf_rlefont_phpRVS9jE_dictionary_data[1423] = { 0x3e, 0x00, 0x5a, 0x1d, 0x0b, 0x04, 0x1b, 0x2c, 0x96, 0x28, 0x29, 0x21, 0x27, 0x5d, 0x89, }; -static const uint16_t mf_rlefont_phpRVS9jE_dictionary_offsets[233] = { +static const gU16 mf_rlefont_phpRVS9jE_dictionary_offsets[233] = { 0x0000, 0x0001, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x000a, 0x000b, 0x0011, 0x0012, 0x0014, 0x001c, 0x001d, 0x001f, 0x0020, 0x0023, 0x0025, 0x0026, 0x0027, 0x0029, 0x002b, 0x002e, @@ -136,7 +136,7 @@ static const uint16_t mf_rlefont_phpRVS9jE_dictionary_offsets[233] = { 0x058f, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_0[2382] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_0[2382] = { 0x05, 0x00, 0x10, 0x06, 0x52, 0xfe, 0xfe, 0x0e, 0x56, 0x0d, 0x25, 0x34, 0x4e, 0x10, 0x06, 0x4c, 0x73, 0x94, 0x9d, 0x29, 0xcd, 0x10, 0x0d, 0x56, 0xf9, 0x09, 0x0a, 0x00, 0x67, 0x03, 0x3e, 0x0d, 0x53, 0xa8, 0x3e, 0x8e, 0x02, 0x00, 0x09, 0x0a, 0x27, 0x8e, 0x2a, 0x20, 0x25, 0x0a, 0x09, 0x00, @@ -288,7 +288,7 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_0[2382] = { 0x1c, 0x21, 0x1d, 0x58, 0x30, 0x0f, 0x64, 0x10, 0x0d, 0x22, 0x75, 0xdf, 0xfc, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000e, 0x0016, 0x0053, 0x0086, 0x00af, 0x00f4, 0x00f8, 0x011c, 0x0145, 0x015f, 0x0169, 0x0173, 0x0178, 0x017d, 0x019c, 0x01d5, 0x01e1, 0x020d, 0x023a, 0x025c, 0x027f, 0x02bb, @@ -303,7 +303,7 @@ static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_0[95] = { 0x08d4, 0x0900, 0x090a, 0x090f, 0x0928, 0x092e, 0x0948, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_1[1970] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_1[1970] = { 0x0a, 0x00, 0x10, 0x06, 0x2d, 0x4e, 0x00, 0x34, 0x0d, 0x56, 0x0e, 0x56, 0x3f, 0x10, 0x0a, 0x56, 0xf9, 0x4e, 0x35, 0x2c, 0x7a, 0x0f, 0x64, 0x25, 0x9b, 0x3c, 0x74, 0x02, 0x09, 0x45, 0xa9, 0x4b, 0x45, 0x60, 0x4b, 0x45, 0x43, 0x4b, 0x45, 0x60, 0x4b, 0x45, 0xa9, 0x4b, 0x25, 0x9b, 0x3c, 0x74, @@ -430,7 +430,7 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_1[1970] = { 0x05, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_1[128] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_1[128] = { 0x0000, 0x0003, 0x000e, 0x003a, 0x0050, 0x0083, 0x00ad, 0x00b5, 0x00ed, 0x00f1, 0x013d, 0x015b, 0x0180, 0x0186, 0x018b, 0x01d8, 0x01dc, 0x01f0, 0x01fe, 0x0212, 0x022a, 0x0231, 0x024d, 0x0272, @@ -449,25 +449,25 @@ static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_1[128] = { 0x075b, 0x075b, 0x075b, 0x075b, 0x075b, 0x075b, 0x0787, 0x079b, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_2[11] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_2[11] = { 0x05, 0x33, 0xe6, 0x33, 0x1a, 0xe5, 0x10, 0x03, 0x59, 0xb5, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_2[2] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_2[2] = { 0x0000, 0x0007, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_3[43] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_3[43] = { 0x09, 0x52, 0xfe, 0x0f, 0x9b, 0x06, 0x31, 0x0f, 0x04, 0x3c, 0x31, 0x48, 0x05, 0x31, 0x05, 0x0f, 0x02, 0x31, 0x0a, 0xa2, 0x30, 0x55, 0xfe, 0x1f, 0x10, 0x04, 0x4c, 0xf7, 0x3b, 0x0f, 0x6e, 0x31, 0x8e, 0x07, 0x3b, 0x63, 0xa2, 0x30, 0x03, 0x8e, 0x56, 0xf7, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_3[2] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_3[2] = { 0x0000, 0x0019, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_4[183] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_4[183] = { 0x11, 0x52, 0x9b, 0x7a, 0x0e, 0x2a, 0x20, 0x37, 0x05, 0x86, 0x02, 0x4b, 0x1d, 0x03, 0x60, 0x33, 0x0f, 0x25, 0x09, 0x07, 0x18, 0x0f, 0x25, 0x2e, 0x28, 0x27, 0x3a, 0x0f, 0x20, 0x92, 0x3a, 0x0f, 0x25, 0x2e, 0x28, 0x27, 0x09, 0x07, 0x18, 0x0f, 0x25, 0x03, 0x60, 0x33, 0x0f, 0x45, 0x06, 0x86, @@ -482,72 +482,72 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_4[183] = { 0xdc, 0x01, 0x08, 0x23, 0xb1, 0xc9, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_4[16] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_4[16] = { 0x0000, 0x0039, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007d, 0x0090, 0x009b, 0x00ad, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_5[24] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_5[24] = { 0x09, 0x32, 0xcd, 0xd7, 0x1d, 0x9b, 0x60, 0xdd, 0x10, 0x00, 0x0c, 0x32, 0xe3, 0x40, 0x20, 0xbc, 0x10, 0x09, 0x22, 0xeb, 0xdc, 0xd1, 0xf6, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_5[7] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_5[7] = { 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x000a, 0x0011, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_6[40] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_6[40] = { 0x0a, 0xf9, 0xa1, 0x97, 0x3e, 0x63, 0x0f, 0x06, 0x30, 0x0a, 0x83, 0x76, 0x3e, 0x2c, 0x0c, 0x31, 0x06, 0x2a, 0x48, 0x31, 0x8a, 0x1c, 0x4f, 0x1c, 0x76, 0x30, 0x6b, 0x1c, 0xa6, 0x1c, 0x5a, 0x1c, 0x46, 0x30, 0xa8, 0x01, 0x3b, 0x97, 0x50, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_6[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_6[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_7[12] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_7[12] = { 0x08, 0x00, 0x22, 0x57, 0xcb, 0x5d, 0x10, 0x08, 0x22, 0xeb, 0xdc, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_7[2] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_7[2] = { 0x0000, 0x0007, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_8[51] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_8[51] = { 0x08, 0x52, 0xcc, 0x04, 0x10, 0x08, 0x2d, 0xe6, 0x10, 0x08, 0x79, 0x9e, 0x50, 0x31, 0x6a, 0xe7, 0x6a, 0xe7, 0x9e, 0x50, 0x10, 0x08, 0x1e, 0x78, 0x4a, 0x1c, 0x65, 0x1c, 0x7c, 0x0e, 0x10, 0x08, 0x4c, 0xf0, 0x10, 0x08, 0x00, 0x22, 0x84, 0x0c, 0x0a, 0x45, 0x9b, 0x60, 0x04, 0x3d, 0x45, 0x6d, 0x00, 0xa0, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_8[6] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_8[6] = { 0x0000, 0x0005, 0x0009, 0x0015, 0x001f, 0x0023, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_9[63] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_9[63] = { 0x0c, 0x2d, 0x71, 0xaa, 0x25, 0x58, 0x99, 0x9b, 0x06, 0x64, 0x2b, 0x9b, 0x2e, 0x9b, 0x68, 0x2b, 0x09, 0x06, 0x1e, 0x5e, 0x2b, 0x68, 0x32, 0x9b, 0x0d, 0x37, 0x72, 0x28, 0x89, 0xd5, 0x19, 0x2b, 0x0c, 0x06, 0x1e, 0x51, 0x2b, 0x08, 0x76, 0x35, 0x2c, 0x62, 0x37, 0x2c, 0x0e, 0x0b, 0x01, 0x2c, 0x4d, 0x02, 0x1d, 0x57, 0x50, 0x00, 0x9e, 0x0f, 0x06, 0x2b, 0x74, 0x70, 0x77, 0x02, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_9[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_9[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_10[49] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_10[49] = { 0x09, 0x38, 0x75, 0x44, 0x0e, 0x20, 0x0d, 0x1d, 0x0c, 0x06, 0x98, 0x02, 0x00, 0x05, 0x43, 0x45, 0xac, 0x35, 0x9a, 0x3e, 0x0e, 0x0a, 0x35, 0xa4, 0x25, 0x63, 0x0f, 0x06, 0x35, 0x0c, 0x05, 0x45, 0x98, 0x02, 0x35, 0x3d, 0x25, 0x0b, 0x0d, 0x38, 0x0f, 0x02, 0x45, 0x0e, 0x0a, 0x38, 0x8d, 0x09, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_10[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_10[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_11[235] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_11[235] = { 0x08, 0xd0, 0x75, 0x97, 0x20, 0x10, 0x10, 0xd0, 0x75, 0x20, 0x2f, 0x10, 0x00, 0x05, 0x4c, 0x44, 0x1c, 0x09, 0x83, 0x7d, 0x0f, 0x10, 0x05, 0x52, 0x97, 0x30, 0x67, 0x0c, 0x30, 0x07, 0x60, 0x30, 0x0c, 0x06, 0x10, 0x05, 0x5c, 0x75, 0x0f, 0xfa, 0x33, 0x5e, 0x1c, 0x6f, 0x10, 0x08, 0x4c, 0x44, @@ -565,7 +565,7 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_11[235] = { 0x08, 0x0e, 0x30, 0x07, 0x6a, 0x31, 0xab, 0x02, 0x30, 0x09, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_11[40] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_11[40] = { 0x0000, 0x0006, 0x000c, 0x000c, 0x000c, 0x000d, 0x0016, 0x0023, 0x000c, 0x002d, 0x003c, 0x0047, 0x000c, 0x0053, 0x005b, 0x0065, 0x000c, 0x000c, 0x000c, 0x007a, 0x000c, 0x000c, 0x000c, 0x000c, @@ -573,26 +573,26 @@ static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_11[40] = { 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x00c0, 0x00d5, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_12[46] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_12[46] = { 0x0a, 0x69, 0x51, 0x48, 0x0b, 0x04, 0x45, 0x0a, 0x4f, 0x01, 0x02, 0x8d, 0x25, 0x51, 0x18, 0x07, 0x25, 0x46, 0x31, 0x0b, 0x20, 0x0c, 0x3e, 0x4e, 0x32, 0x0b, 0x77, 0x0b, 0x3b, 0x46, 0x1c, 0x51, 0x18, 0x07, 0x45, 0x0a, 0x4f, 0x01, 0x91, 0x0f, 0x3e, 0x9a, 0x48, 0x0b, 0x04, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_12[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_12[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_13[26] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_13[26] = { 0x10, 0x52, 0x20, 0x08, 0x00, 0x07, 0x85, 0x9d, 0x0f, 0x0b, 0x01, 0x0a, 0x85, 0x9d, 0x0f, 0x49, 0x05, 0x85, 0x9d, 0x85, 0x0c, 0x28, 0x9d, 0x73, 0x28, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_13[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_13[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_14[360] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_14[360] = { 0x08, 0x40, 0xf9, 0xee, 0x0f, 0x64, 0x3b, 0x61, 0x55, 0x6f, 0x30, 0x61, 0x1c, 0xa1, 0x3e, 0x07, 0x0d, 0x0e, 0x08, 0x98, 0x45, 0x07, 0x6a, 0x01, 0xa1, 0x0d, 0x45, 0x50, 0x35, 0x67, 0x0a, 0x45, 0x3d, 0x63, 0x0f, 0x04, 0x45, 0x0a, 0x06, 0x8f, 0x0d, 0x0a, 0x27, 0x2c, 0x0a, 0x0e, 0x8c, 0x10, @@ -618,7 +618,7 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_14[360] = { 0x08, 0x1c, 0x08, 0x03, 0x31, 0x0b, 0x86, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_14[42] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_14[42] = { 0x0000, 0x0030, 0x0030, 0x0030, 0x0031, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x006c, 0x0030, 0x007c, 0x00af, 0x0030, 0x0030, 0x00b4, 0x0030, 0x0030, 0x0030, 0x00d5, @@ -627,16 +627,16 @@ static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_14[42] = { 0x0030, 0x0141, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_15[23] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_15[23] = { 0x0d, 0x18, 0x75, 0xdf, 0xfc, 0x01, 0x2b, 0x63, 0xac, 0x0e, 0x0b, 0x99, 0x01, 0x58, 0x1d, 0x0d, 0x55, 0x02, 0x06, 0xac, 0x0e, 0xfc, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_15[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_15[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_16[106] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_16[106] = { 0x0d, 0x1e, 0x5c, 0x5a, 0x30, 0x07, 0x65, 0x27, 0x77, 0x77, 0x3e, 0x98, 0x03, 0x31, 0x74, 0x06, 0x3e, 0x77, 0x77, 0x27, 0x03, 0x86, 0x30, 0x0a, 0x07, 0x10, 0x00, 0x0d, 0x32, 0x5c, 0x7e, 0x7a, 0x25, 0x9b, 0x07, 0xac, 0x6d, 0x03, 0x2b, 0x63, 0x7a, 0x0d, 0x09, 0x87, 0x45, 0x0f, 0x64, 0x31, @@ -646,11 +646,11 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_16[106] = { 0x6d, 0x02, 0x45, 0x0d, 0x09, 0x55, 0x00, 0x1a, 0x2f, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_16[6] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_16[6] = { 0x0000, 0x001a, 0x001a, 0x001a, 0x001b, 0x0042, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_17[72] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_17[72] = { 0x08, 0x22, 0x63, 0x04, 0x1c, 0x0b, 0x0b, 0x30, 0x26, 0x4f, 0x31, 0x6e, 0x90, 0x3e, 0x9b, 0x0b, 0x35, 0x5b, 0x45, 0x09, 0x04, 0x35, 0x05, 0x09, 0x1d, 0x2c, 0x0c, 0x33, 0x0c, 0x01, 0x25, 0x8a, 0x33, 0x05, 0x08, 0x25, 0x76, 0x33, 0x6b, 0x25, 0x5f, 0x33, 0x4a, 0x25, 0x6b, 0x33, 0x76, 0x45, @@ -658,17 +658,17 @@ static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_17[72] = { 0x6f, 0x31, 0x0b, 0x0b, 0x30, 0x63, 0x04, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_17[1] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_17[1] = { 0x0000, }; -static const uint8_t mf_rlefont_phpRVS9jE_glyph_data_18[47] = { +static const gU8 mf_rlefont_phpRVS9jE_glyph_data_18[47] = { 0x0a, 0x52, 0x44, 0x97, 0x4b, 0x27, 0x0c, 0x05, 0x35, 0x4b, 0x9d, 0x31, 0x0f, 0x20, 0x92, 0xc6, 0x72, 0xc6, 0x72, 0xc6, 0x72, 0xc6, 0x72, 0x10, 0x0a, 0x52, 0x58, 0x77, 0x45, 0x6a, 0x35, 0x4b, 0x9d, 0x72, 0x1e, 0x0f, 0x2a, 0x72, 0xc6, 0x72, 0xc6, 0x72, 0xc6, 0x72, 0xc6, 0x72, 0x10, }; -static const uint16_t mf_rlefont_phpRVS9jE_glyph_offsets_18[2] = { +static const gU16 mf_rlefont_phpRVS9jE_glyph_offsets_18[2] = { 0x0000, 0x0018, }; diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 9cd4af76..057fa61d 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -33,7 +33,7 @@ GHandle GW1, GW2, GW3; int main(void) { - uint8_t i; + gU8 i; gFont font1, font2; /* initialize and clear the display */ diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c index 18e15046..d3ea97f8 100644 --- a/demos/modules/gwin/frame/main.c +++ b/demos/modules/gwin/frame/main.c @@ -8,7 +8,7 @@ static GHandle ghButton1, ghButton2, ghButton3; static GHandle ghWindow1; static void _updateColor(void) { - uint32_t color; + gU32 color; color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16; color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8; diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index 19c6c76c..4a89dd04 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -63,7 +63,7 @@ static const GGraphStyle GraphStyle2 = { int main(void) { GHandle gh; - uint16_t i; + gU16 i; gfxInit(); diff --git a/demos/modules/gwin/keyboard/main.c b/demos/modules/gwin/keyboard/main.c index 29f5f519..f1f47032 100644 --- a/demos/modules/gwin/keyboard/main.c +++ b/demos/modules/gwin/keyboard/main.c @@ -121,7 +121,7 @@ int main(void) { if (pk->bytecount) { gwinPrintf(ghConsole, " Keys:"); for (i = 0; i < pk->bytecount; i++) - gwinPrintf(ghConsole, " 0x%02X", (int)(uint8_t)pk->c[i]); + gwinPrintf(ghConsole, " 0x%02X", (int)(gU8)pk->c[i]); gwinPrintf(ghConsole, " ["); for (i = 0; i < pk->bytecount; i++) gwinPrintf(ghConsole, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' '); diff --git a/demos/modules/gwin/textedit/main.c b/demos/modules/gwin/textedit/main.c index 034d01aa..42dad5f4 100644 --- a/demos/modules/gwin/textedit/main.c +++ b/demos/modules/gwin/textedit/main.c @@ -145,7 +145,7 @@ int main(void) { if (pk->bytecount) { gwinPrintf(ghConsole, " Keys:"); for (i = 0; i < pk->bytecount; i++) - gwinPrintf(ghConsole, " 0x%02X", (int)(uint8_t)pk->c[i]); + gwinPrintf(ghConsole, " 0x%02X", (int)(gU8)pk->c[i]); gwinPrintf(ghConsole, " ["); for (i = 0; i < pk->bytecount; i++) gwinPrintf(ghConsole, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' '); diff --git a/demos/tools/touch_driver_test/main.c b/demos/tools/touch_driver_test/main.c index 2a1e6486..ec570b1d 100644 --- a/demos/tools/touch_driver_test/main.c +++ b/demos/tools/touch_driver_test/main.c @@ -96,7 +96,7 @@ int main(void) { GMouse * m; GMouseVMT * vmt; GMouseJitter * pjit; - uint32_t calerr; + gU32 calerr; gfxInit(); // Initialize the display diff --git a/demos/tools/uGFXnetDisplay/main.c b/demos/tools/uGFXnetDisplay/main.c index a4ba943f..4eba5f78 100644 --- a/demos/tools/uGFXnetDisplay/main.c +++ b/demos/tools/uGFXnetDisplay/main.c @@ -134,15 +134,15 @@ static gFont font; /** * Get a whole packet of data. - * Len is specified in the number of uint16_t's we want as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want as our protocol only talks gU16's. * If the connection closes before we get all the data - the call returns gFalse. */ -static gBool getpkt(uint16_t *pkt, int len) { +static gBool getpkt(gU16 *pkt, int len) { int got; int have; // Get the packet of data - len *= sizeof(uint16_t); + len *= sizeof(gU16); have = 0; while(len && (got = recv(netfd, ((char *)pkt)+have, len, 0)) > 0) { have += got; @@ -151,7 +151,7 @@ static gBool getpkt(uint16_t *pkt, int len) { if (len) return gFalse; - // Convert each uint16_t to host order + // Convert each gU16 to host order for(got = 0, have /= 2; got < have; got++) pkt[got] = ntohs(pkt[got]); @@ -160,19 +160,19 @@ static gBool getpkt(uint16_t *pkt, int len) { /** * Send a whole packet of data. - * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want to send as our protocol only talks gU16's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. * If the connection closes before we send all the data - the call returns gFalse. */ -static gBool sendpkt(uint16_t *pkt, int len) { +static gBool sendpkt(gU16 *pkt, int len) { int i; - // Convert each uint16_t to network order + // Convert each gU16 to network order for(i = 0; i < len; i++) pkt[i] = htons(pkt[i]); // Send it - len *= sizeof(uint16_t); + len *= sizeof(gU16); return send(netfd, (const char *)pkt, len, 0) == len; } @@ -185,8 +185,8 @@ static gBool sendpkt(uint16_t *pkt, int len) { static DECLARE_THREAD_STACK(waNetThread, 512); static DECLARE_THREAD_FUNCTION(NetThread, param) { GEventMouse *pem; - uint16_t cmd[2]; - uint16_t lbuttons; + gU16 cmd[2]; + gU16 lbuttons; gCoord lx, ly; (void) param; @@ -327,7 +327,7 @@ static SOCKET_TYPE doConnect(proto_args) { * There are two prototypes - one for systems with a command line and one for embedded systems without one. */ int main(proto_args) { - uint16_t cmd[5]; + gU16 cmd[5]; unsigned cnt; @@ -403,13 +403,13 @@ int main(proto_args) { gdispControl(cmd[0], (void *)(unsigned)cmd[1]); switch(cmd[0]) { case GDISP_CONTROL_ORIENTATION: - cmd[1] = (uint16_t)gdispGetOrientation() == cmd[1] ? 1 : 0; + cmd[1] = (gU16)gdispGetOrientation() == cmd[1] ? 1 : 0; break; case GDISP_CONTROL_POWER: - cmd[1] = (uint16_t)gdispGetPowerMode() == cmd[1] ? 1 : 0; + cmd[1] = (gU16)gdispGetPowerMode() == cmd[1] ? 1 : 0; break; case GDISP_CONTROL_BACKLIGHT: - cmd[1] = (uint16_t)gdispGetBacklight() == cmd[1] ? 1 : 0; + cmd[1] = (gU16)gdispGetBacklight() == cmd[1] ? 1 : 0; break; default: cmd[1] = 0; diff --git a/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c index 94f48326..630ef5c7 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c +++ b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c @@ -16,7 +16,7 @@ #include "../../../src/gadc/gadc_driver.h" -static uint32_t nextfreq; +static gU32 nextfreq; // Forward references to ISR routines static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); @@ -50,8 +50,8 @@ void gadc_lld_init(void) { adcStart(&ADCD1, 0); } -size_t gadc_lld_samplesperconversion(uint32_t physdev) { - size_t samples; +gMemSize gadc_lld_samplesperconversion(gU32 physdev) { + gMemSize samples; for(samples = 0; physdev; physdev >>= 1) if (physdev & 0x01) @@ -59,7 +59,7 @@ size_t gadc_lld_samplesperconversion(uint32_t physdev) { return samples; } -void gadc_lld_start_timerI(uint32_t frequency) { +void gadc_lld_start_timerI(gU32 frequency) { // Nothing to do here - the AT91SAM7 adc driver uses an internal timer // which is set up when the job is started. We save this here just to // indicate the timer should be re-initialised on the next timer job diff --git a/drivers/gaudio/Win32/gaudio_play_Win32.c b/drivers/gaudio/Win32/gaudio_play_Win32.c index a59544fa..8cf024c6 100644 --- a/drivers/gaudio/Win32/gaudio_play_Win32.c +++ b/drivers/gaudio/Win32/gaudio_play_Win32.c @@ -122,7 +122,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { WAVEFORMATEX wfx; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) @@ -156,10 +156,10 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gTrue; } -gBool gaudio_play_lld_set_volume(uint8_t vol) { +gBool gaudio_play_lld_set_volume(gU8 vol) { if (!ah) return gFalse; - return waveOutSetVolume(ah, (((uint16_t)vol)<<8)|vol) != 0; + return waveOutSetVolume(ah, (((gU16)vol)<<8)|vol) != 0; } void gaudio_play_lld_start(void) { diff --git a/drivers/gaudio/Win32/gaudio_record_Win32.c b/drivers/gaudio/Win32/gaudio_record_Win32.c index 13c9495e..e30fde1b 100644 --- a/drivers/gaudio/Win32/gaudio_record_Win32.c +++ b/drivers/gaudio/Win32/gaudio_record_Win32.c @@ -124,7 +124,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_record_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { WAVEFORMATEX wfx; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) diff --git a/drivers/gaudio/gadc/gaudio_record_board_template.h b/drivers/gaudio/gadc/gaudio_record_board_template.h index d42988ba..d8b8e6b3 100644 --- a/drivers/gaudio/gadc/gaudio_record_board_template.h +++ b/drivers/gaudio/gadc/gaudio_record_board_template.h @@ -19,7 +19,7 @@ #define GAUDIO_RECORD_MICROPHONE 0 #ifdef GAUDIO_RECORD_LLD_IMPLEMENTATION - static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { + static gU32 gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { GADC_PHYSDEV_MICROPHONE, }; #endif diff --git a/drivers/gaudio/gadc/gaudio_record_gadc.c b/drivers/gaudio/gadc/gaudio_record_gadc.c index 31b51ebe..b00da3cf 100644 --- a/drivers/gaudio/gadc/gaudio_record_gadc.c +++ b/drivers/gaudio/gadc/gaudio_record_gadc.c @@ -30,7 +30,7 @@ static void gadcCallbackI(void) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_record_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { /* Check the parameters */ if (channel >= GAUDIO_RECORD_NUM_CHANNELS || frequency > GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY || format != GAUDIO_RECORD_FORMAT1) return gFalse; diff --git a/drivers/gaudio/pwm/gaudio_play_board_template.h b/drivers/gaudio/pwm/gaudio_play_board_template.h index 4e3e3bb1..86c4ea8a 100644 --- a/drivers/gaudio/pwm/gaudio_play_board_template.h +++ b/drivers/gaudio/pwm/gaudio_play_board_template.h @@ -15,7 +15,7 @@ * */ -static gBool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) { +static gBool gaudio_play_pwm_setup(gU32 frequency, ArrayDataFormat format) { /* Initialise the PWM - use a midpoint value for the initial PWM value */ /* Initialise the timer interrupt @ frequency */ /* Return gFalse if any parameter invalid */ @@ -31,7 +31,7 @@ static void gaudio_play_pwm_stop(void) { /* Stop the PWM */ } -static void gaudio_play_pwm_setI(uint16_t value) { +static void gaudio_play_pwm_setI(gU16 value) { /* Set the PWM value */ } diff --git a/drivers/gaudio/pwm/gaudio_play_pwm.c b/drivers/gaudio/pwm/gaudio_play_pwm.c index 57541470..899ea793 100644 --- a/drivers/gaudio/pwm/gaudio_play_pwm.c +++ b/drivers/gaudio/pwm/gaudio_play_pwm.c @@ -20,15 +20,15 @@ static void gaudio_play_pwm_timer_callbackI(void); static GDataBuffer *pplay; static ArrayDataFormat playfmt; -static size_t playlen; -static uint8_t *pdata; +static gMemSize playlen; +static gU8 *pdata; static void gaudio_play_pwm_timer_callbackI(void) { if (pplay) { // Get the next value from the current data buffer if (gfxSampleFormatBits(playfmt) > 8) { - gaudio_play_pwm_setI(*(uint16_t *)pdata); + gaudio_play_pwm_setI(*(gU16 *)pdata); pdata += 2; } else { gaudio_play_pwm_setI(*pdata); @@ -57,7 +57,7 @@ static void gaudio_play_pwm_timer_callbackI(void) { playlen = pplay->len; if (gfxSampleFormatBits(playfmt) > 8) playlen >>= 1; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); } @@ -65,7 +65,7 @@ static void gaudio_play_pwm_timer_callbackI(void) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { (void) channel; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_10BITUNSIGNED) @@ -75,7 +75,7 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gaudio_play_pwm_setup(frequency, format); } -gBool gaudio_play_lld_set_volume(uint8_t vol) { +gBool gaudio_play_lld_set_volume(gU8 vol) { (void) vol; return gFalse; } @@ -93,7 +93,7 @@ void gaudio_play_lld_start(void) { playlen = pplay->len; if (gfxSampleFormatBits(playfmt) > 8) playlen >>= 1; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); // Start the playing diff --git a/drivers/gaudio/vs1053/gaudio_play_board_template.h b/drivers/gaudio/vs1053/gaudio_play_board_template.h index 3c011254..0c06c4c9 100644 --- a/drivers/gaudio/vs1053/gaudio_play_board_template.h +++ b/drivers/gaudio/vs1053/gaudio_play_board_template.h @@ -59,12 +59,12 @@ static void board_enddatawrite(void) { } // Write data to the SPI port -static void board_spiwrite(const uint8_t *buf, unsigned len) { +static void board_spiwrite(const gU8 *buf, unsigned len) { } // Read data from the SPI port -static void board_spiread(uint8_t *buf, unsigned len) { +static void board_spiread(gU8 *buf, unsigned len) { } diff --git a/drivers/gaudio/vs1053/gaudio_play_vs1053.c b/drivers/gaudio/vs1053/gaudio_play_vs1053.c index 8cf0dcd7..1e88be4c 100644 --- a/drivers/gaudio/vs1053/gaudio_play_vs1053.c +++ b/drivers/gaudio/vs1053/gaudio_play_vs1053.c @@ -32,7 +32,7 @@ // Load the patch file if desired. New format patches only. #if VS1053_FIRMWARE_PATCH #define SKIP_PLUGIN_VARNAME - static const uint16_t plugin[] = { /* Compressed plugin */ + static const gU16 plugin[] = { /* Compressed plugin */ #include "vs1053_patch.plg" }; #endif @@ -67,7 +67,7 @@ static GTimer playTimer; // Some common macro's #define waitforready() while(!board_dreq()) gfxSleepMilliseconds(5) -static void cmd_write(uint16_t addr, uint16_t data) { +static void cmd_write(gU16 addr, gU16 data) { char buf[4]; buf[0] = 2; buf[1] = (char)addr; @@ -81,14 +81,14 @@ static void cmd_write(uint16_t addr, uint16_t data) { } #if VS1053_CLK > 12288000 - static GFXINLINE void cmd_writenodreq(uint16_t addr, uint16_t data) { - uint8_t buf[4]; + static GFXINLINE void cmd_writenodreq(gU16 addr, gU16 data) { + gU8 buf[4]; // This is the same as cmd_write() except for it doesn't wait for dreq first buf[0] = 2; - buf[1] = (uint8_t)addr; - buf[2] = (uint8_t)(data >> 8); - buf[3] = (uint8_t)data; + buf[1] = (gU8)addr; + buf[2] = (gU8)(data >> 8); + buf[3] = (gU8)data; board_startcmdwrite(); board_spiwrite(buf, 4); @@ -96,8 +96,8 @@ static void cmd_write(uint16_t addr, uint16_t data) { } #endif -static uint16_t cmd_read(uint16_t addr) { - uint8_t buf[2]; +static gU16 cmd_read(gU16 addr) { + gU8 buf[2]; buf[0] = 3; buf[1] = (char)addr; @@ -106,10 +106,10 @@ static uint16_t cmd_read(uint16_t addr) { board_spiwrite(buf, 2); board_spiread(buf, 2); board_endcmdread(); - return (((uint16_t)buf[0])<<8)|buf[1]; + return (((gU16)buf[0])<<8)|buf[1]; } -static void data_write(const uint8_t *data, unsigned len) { +static void data_write(const gU8 *data, unsigned len) { board_startdatawrite(); board_spiwrite(data, len); board_enddatawrite(); @@ -118,7 +118,7 @@ static void data_write(const uint8_t *data, unsigned len) { #if VS1053_FIRMWARE_PATCH static void LoadUserCode(void) { int i; - uint16_t addr, n, val; + gU16 addr, n, val; for(i=0; ilen; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); } } @@ -228,11 +228,11 @@ static void FeedData(void *param) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - uint32_t brate; - uint32_t bps; - uint8_t buf[4]; - static const uint8_t hdr1[] = { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { + gU32 brate; + gU32 bps; + gU8 buf[4]; + static const gU8 hdr1[] = { 'R', 'I', 'F', 'F', 0xFF, 0xFF, 0xFF, 0xFF, 'W', 'A', 'V', 'E', @@ -240,7 +240,7 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat 16, 0, 0, 0, 0x01, 0x00, }; - static const uint8_t hdr2[] = { + static const gU8 hdr2[] = { 'd', 'a', 't', 'a', 0xFF, 0xFF, 0xFF, 0xFF, }; @@ -277,8 +277,8 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gTrue; } -gBool gaudio_play_lld_set_volume(uint8_t vol) { - uint16_t tmp; +gBool gaudio_play_lld_set_volume(gU8 vol) { + gU16 tmp; // Volume is 0xFE -> 0x00. Adjust vol to match vol = ~vol; @@ -305,7 +305,7 @@ void gaudio_play_lld_start(void) { // Set up ready for the new buffer playlen = pplay->len; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); // Start the playing by starting the timer and executing FeedData immediately just to get things started @@ -315,7 +315,7 @@ void gaudio_play_lld_start(void) { } void gaudio_play_lld_stop(void) { - uint8_t ch; + gU8 ch; unsigned i; // Stop the timer interrupt diff --git a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h index c63e9083..e319ad85 100644 --- a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h +++ b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h @@ -10,13 +10,13 @@ #define FRAMEREADER_BASE ALT_VIP_VFR_0_BASE #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay* g, uint8_t percent) + static void board_backlight(GDisplay* g, gU8 percent) { (void)g; (void)percent; } - static void board_contrast(GDisplay* g, uint8_t percent) + static void board_contrast(GDisplay* g, gU8 percent) { (void)g; (void)percent; diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c index 848948c6..c510b1a9 100644 --- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c +++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c @@ -73,7 +73,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) IOWR(ALT_VIP_VFR_0_BASE, 0x00, 0x00); // stop for config // Frame 0 - IOWR(ALT_VIP_VFR_0_BASE, 0x04, (uint32_t)PRIV(g)->frame0); + IOWR(ALT_VIP_VFR_0_BASE, 0x04, (gU32)PRIV(g)->frame0); IOWR(ALT_VIP_VFR_0_BASE, 0x05, SCREEN_WIDTH*SCREEN_HEIGHT/2); IOWR(ALT_VIP_VFR_0_BASE, 0x06, SCREEN_WIDTH*SCREEN_HEIGHT); IOWR(ALT_VIP_VFR_0_BASE, 0x08, SCREEN_WIDTH); @@ -81,7 +81,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) IOWR(ALT_VIP_VFR_0_BASE, 0x0a, 0x00); // Frame 1 - IOWR(ALT_VIP_VFR_0_BASE, 0x0b, (uint32_t)PRIV(g)->frame1); + IOWR(ALT_VIP_VFR_0_BASE, 0x0b, (gU32)PRIV(g)->frame1); IOWR(ALT_VIP_VFR_0_BASE, 0x0c, SCREEN_WIDTH*SCREEN_HEIGHT/2); IOWR(ALT_VIP_VFR_0_BASE, 0x0d, SCREEN_WIDTH*SCREEN_HEIGHT); IOWR(ALT_VIP_VFR_0_BASE, 0x0f, SCREEN_WIDTH); @@ -244,7 +244,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) unsigned int addr; int bytes_per_line; int bytes_per_pixel; - uint8_t* line; + gU8* line; // Calculate some values required for further calculations bytes_per_pixel = ((fbPriv*)g->priv)->linelen/g->g.Width; // must be 4 diff --git a/drivers/gdisp/ED060SC4/board_ED060SC4_example.h b/drivers/gdisp/ED060SC4/board_ED060SC4_example.h index 96dd8be2..13311089 100644 --- a/drivers/gdisp/ED060SC4/board_ED060SC4_example.h +++ b/drivers/gdisp/ED060SC4/board_ED060SC4_example.h @@ -105,7 +105,7 @@ static GFXINLINE void setpin_sph(gBool on) { } /* Set the state of the D0-D7 (source driver Data) pins. */ -static GFXINLINE void setpins_data(uint8_t value) { +static GFXINLINE void setpins_data(gU8 value) { palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value); } diff --git a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h index 93e6d23b..65f77095 100644 --- a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h +++ b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h @@ -89,7 +89,7 @@ static GFXINLINE void setpin_sph(GDisplay *g, gBool on) { (void) on; } -static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) { +static GFXINLINE void setpins_data(GDisplay *g, gU8 value) { (void) g; (void) value; } diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index ba1baee8..b5d1e08b 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -200,7 +200,7 @@ static void hscan_start(GDisplay *g) } /* Write data to the horizontal row. */ -static void hscan_write(GDisplay *g, const uint8_t *data, int count) +static void hscan_write(GDisplay *g, const gU8 *data, int count) { while (count--) { @@ -317,18 +317,18 @@ static void power_off(GDisplay *g) /* Buffers that store the data for a small area of the display. */ typedef struct { - uint8_t data[EINK_BLOCKHEIGHT][WIDTH_BYTES]; + gU8 data[EINK_BLOCKHEIGHT][WIDTH_BYTES]; } block_t; typedef struct drvPriv { - uint8_t g_next_block; /* Index of the next free block buffer. */ + gU8 g_next_block; /* Index of the next free block buffer. */ block_t g_blocks[EINK_NUMBUFFERS]; /* Map that stores the buffers associated to each area of the display. * Value of 0 means that the block is not allocated. * Other values are the index in g_blocks + 1. */ - uint8_t g_blockmap[BLOCKS_Y][BLOCKS_X]; + gU8 g_blockmap[BLOCKS_Y][BLOCKS_X]; } drvPriv; /* Check if the row contains any allocated blocks. */ @@ -358,7 +358,7 @@ static void write_block_row(GDisplay *g, unsigned by) { for (dx = 0; dx < WIDTH_BYTES; dx++) { - const uint8_t dummy = 0; + const gU8 dummy = 0; hscan_write(g, &dummy, 1); } } @@ -483,9 +483,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL void gdisp_lld_draw_pixel(GDisplay *g) { block_t *block; - uint8_t byte; + gU8 byte; unsigned bx, by, dx, dy; - uint8_t bitpos; + gU8 bitpos; switch(g->g.Orientation) { default: @@ -583,7 +583,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_CLEARS static void subclear(GDisplay *g, gColor color) { unsigned x, y; - uint8_t byte; + gU8 byte; hscan_start(g); byte = color ? BYTE_WHITE : BYTE_BLACK; diff --git a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h index 45029f5b..0d1d10dd 100644 --- a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h +++ b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h @@ -35,13 +35,13 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c index 28ef8336..f16c2294 100644 --- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c +++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c @@ -33,7 +33,7 @@ typedef struct fbPriv { /*===========================================================================*/ #define PIXIL_POS(g, x, y) ((y) * ((fbPriv *)(g)->priv)->fbi.linelen + (x) * 3) -#define PIXEL_ADDR(g, pos) (((uint8_t *)((fbPriv *)(g)->priv)->fbi.pixels)+pos) +#define PIXEL_ADDR(g, pos) (((gU8 *)((fbPriv *)(g)->priv)->fbi.pixels)+pos) /*===========================================================================*/ /* Driver exported functions. */ @@ -64,7 +64,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { unsigned pos; - uint8_t *p; + gU8 *p; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { @@ -101,7 +101,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { unsigned pos; - uint8_t *p; + gU8 *p; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { diff --git a/drivers/gdisp/HX8347D/board_HX8347D_template.h b/drivers/gdisp/HX8347D/board_HX8347D_template.h index 9d21f8ba..23e1b23c 100644 --- a/drivers/gdisp/HX8347D/board_HX8347D_template.h +++ b/drivers/gdisp/HX8347D/board_HX8347D_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -42,17 +42,17 @@ static GFXINLINE void busmode8(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint8_t index) { +static GFXINLINE void write_index(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) { +static GFXINLINE void write_ram16(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c index d1e71689..bf32280f 100644 --- a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c +++ b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c @@ -43,7 +43,7 @@ #include "drivers/gdisp/ILI9225/ili9225.h" // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } // Serial write data for fast fill. diff --git a/drivers/gdisp/ILI9320/board_ILI9320_template.h b/drivers/gdisp/ILI9320/board_ILI9320_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/ILI9320/board_ILI9320_template.h +++ b/drivers/gdisp/ILI9320/board_ILI9320_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index b3a42c1a..1dc5ba17 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -51,7 +51,7 @@ /* Driver local functions. */ /*===========================================================================*/ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -94,7 +94,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -223,7 +223,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9325/board_ILI9325_template.h b/drivers/gdisp/ILI9325/board_ILI9325_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/ILI9325/board_ILI9325_template.h +++ b/drivers/gdisp/ILI9325/board_ILI9325_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index 0bd3ec9f..73d79b47 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -52,7 +52,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -95,7 +95,7 @@ static void set_viewport(GDisplay* g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -217,7 +217,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9341/board_ILI9341_template.h b/drivers/gdisp/ILI9341/board_ILI9341_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9341/board_ILI9341_template.h +++ b/drivers/gdisp/ILI9341/board_ILI9341_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 464d663d..1c8e0956 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -49,24 +49,24 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -#define write_data16(g, data) { write_data(g, data >> 8); write_data(g, (uint8_t)data); } +#define write_data16(g, data) { write_data(g, data >> 8); write_data(g, (gU8)data); } #define delay(us) gfxSleepMicroseconds(us) #define delayms(ms) gfxSleepMilliseconds(ms) static void set_viewport(GDisplay *g) { write_index(g, 0x2A); write_data(g, (g->p.x >> 8)); - write_data(g, (uint8_t) g->p.x); + write_data(g, (gU8) g->p.x); write_data(g, (g->p.x + g->p.cx - 1) >> 8); - write_data(g, (uint8_t) (g->p.x + g->p.cx - 1)); + write_data(g, (gU8) (g->p.x + g->p.cx - 1)); write_index(g, 0x2B); write_data(g, (g->p.y >> 8)); - write_data(g, (uint8_t) g->p.y); + write_data(g, (gU8) g->p.y); write_data(g, (g->p.y + g->p.cy - 1) >> 8); - write_data(g, (uint8_t) (g->p.y + g->p.cy - 1)); + write_data(g, (gU8) (g->p.y + g->p.cy - 1)); } /*===========================================================================*/ @@ -257,7 +257,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c index 8c98da1f..394a4b47 100644 --- a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c +++ b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c @@ -49,21 +49,21 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_viewport(GDisplay *g) { write_index(g, 0x2A); write_data(g, (g->p.x >> 8)); - write_data(g, (uint8_t) g->p.x); + write_data(g, (gU8) g->p.x); write_data(g, (g->p.x + g->p.cx - 1) >> 8); - write_data(g, (uint8_t) (g->p.x + g->p.cx - 1)); + write_data(g, (gU8) (g->p.x + g->p.cx - 1)); write_index(g, 0x2B); write_data(g, (g->p.y >> 8)); - write_data(g, (uint8_t) g->p.y); + write_data(g, (gU8) g->p.y); write_data(g, (g->p.y + g->p.cy - 1) >> 8); - write_data(g, (uint8_t) (g->p.y + g->p.cy - 1)); + write_data(g, (gU8) (g->p.y + g->p.cy - 1)); } /*===========================================================================*/ @@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI93xx/board_ILI93xx_template.h b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h index df2131bc..ab47b968 100644 --- a/drivers/gdisp/ILI93xx/board_ILI93xx_template.h +++ b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; @@ -62,7 +62,7 @@ static GFXINLINE void setwritemode(GDisplay *g) (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c index 8ea9b5b8..e35bf47a 100644 --- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -52,10 +52,10 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -static GFXINLINE uint16_t read_reg(GDisplay *g, uint32_t reg) { +static GFXINLINE gU16 read_reg(GDisplay *g, gU32 reg) { write_index(g, reg); return read_data(g); } @@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9481/board_ILI9481_template.h b/drivers/gdisp/ILI9481/board_ILI9481_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9481/board_ILI9481_template.h +++ b/drivers/gdisp/ILI9481/board_ILI9481_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 357798b3..75c29ae7 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -47,9 +47,9 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -#define write_reg2x16(g, reg, data1, data2) { write_index(g, reg); write_data(g, (data1)>>8); write_data(g, (uint8_t)(data1)); write_data(g, (data2)>>8); write_data(g, (uint8_t)(data2));} +#define write_reg2x16(g, reg, data1, data2) { write_index(g, reg); write_data(g, (data1)>>8); write_data(g, (gU8)(data1)); write_data(g, (data2)>>8); write_data(g, (gU8)(data2));} static void set_viewport(GDisplay* g) { write_reg2x16(g, 0x2A, g->p.x, g->p.x + g->p.cx - 1); @@ -221,7 +221,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9488/board_ILI9488_template.h b/drivers/gdisp/ILI9488/board_ILI9488_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9488/board_ILI9488_template.h +++ b/drivers/gdisp/ILI9488/board_ILI9488_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c index 61ff51ab..f0c2688d 100644 --- a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c +++ b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c @@ -46,7 +46,7 @@ /* Driver local functions. */ /*===========================================================================*/ static void dummy_read(GDisplay* g) { - volatile uint16_t dummy; + volatile gU16 dummy; dummy = read_data(g); (void)dummy; } @@ -221,7 +221,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/KS0108/board_KS0108_example.h b/drivers/gdisp/KS0108/board_KS0108_example.h index 23df5183..133955cd 100644 --- a/drivers/gdisp/KS0108/board_KS0108_example.h +++ b/drivers/gdisp/KS0108/board_KS0108_example.h @@ -170,7 +170,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { #endif } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -183,9 +183,9 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -void KS0108_delay(uint16_t microsec){ +void KS0108_delay(gU16 microsec){ #if KS0108_NOP_DLY - uint16_t cn; + gU16 cn; for (cn=0;cn< microsec;cn++){ asm("nop");asm("nop");asm("nop");asm("nop"); @@ -223,7 +223,7 @@ static GFXINLINE void KS0108_latch(void){ palSetLine(lcdpins.E); } -static GFXINLINE void KS0108_write(uint8_t value){ +static GFXINLINE void KS0108_write(gU8 value){ int ii; for(ii = 0; ii < 8; ii++){ @@ -235,8 +235,8 @@ static GFXINLINE void KS0108_write(uint8_t value){ KS0108_delay(1); } -static GFXINLINE void KS0108_select(uint8_t chip){ - uint8_t ii; +static GFXINLINE void KS0108_select(gU8 chip){ + gU8 ii; KS0108_delay(1); for (ii = 0; ii < CHIPS; ii++){ if (ii == chip) @@ -246,7 +246,7 @@ static GFXINLINE void KS0108_select(uint8_t chip){ } static GFXINLINE void KS0108_unselect(void){ - uint8_t ii; + gU8 ii; KS0108_delay(1); for (ii = 0; ii < CHIPS; ii++){ @@ -256,8 +256,8 @@ static GFXINLINE void KS0108_unselect(void){ /* #if KS0108_NEED_READ //Hardware Read ############## WORKS more or less -static GFXINLINE uint8_t read_KS0108(void) { - uint8_t ii, data=0; +static GFXINLINE gU8 read_KS0108(void) { + gU8 ii, data=0; for(ii = 0; ii < 8; ii++) palSetLineMode(lcdpins.D[ii], PAL_MODE_INPUT); //Set pads to input @@ -286,8 +286,8 @@ static GFXINLINE uint8_t read_KS0108(void) { #endif */ #if KS0108_NEED_READ //Hardware Read ########### needs more testing but my display is broken -static GFXINLINE uint8_t read_KS0108(void) { - uint8_t ii, data=0; +static GFXINLINE gU8 read_KS0108(void) { + gU8 ii, data=0; for(ii = 0; ii < 8; ii++) palSetLineMode(lcdpins.D[ii], PAL_MODE_INPUT); //Set pads to input @@ -336,15 +336,15 @@ static GFXINLINE uint8_t read_KS0108(void) { } #endif -static GFXINLINE void write_data(GDisplay* g, uint16_t data){ +static GFXINLINE void write_data(GDisplay* g, gU16 data){ (void)g; - uint8_t bit, displayData; + gU8 bit, displayData; #if !KS0108_NEED_READ - uint8_t *p; + gU8 *p; #endif palSetLine(lcdpins.DC); - KS0108_select((uint8_t)(data>>8)); + KS0108_select((gU8)(data>>8)); #if KS0108_NEED_READ displayData=read_KS0108(); #else @@ -353,7 +353,7 @@ static GFXINLINE void write_data(GDisplay* g, uint16_t data){ #endif bit = 1 << (g->p.y & 7); //Get Page bit - if ((uint8_t)data){ //set bit + if ((gU8)data){ //set bit KS0108_write(displayData | bit); #if !KS0108_NEED_READ *p = (displayData | bit); @@ -370,11 +370,11 @@ static GFXINLINE void write_data(GDisplay* g, uint16_t data){ KS0108_unselect(); //Important } -static GFXINLINE void write_cmd(GDisplay* g, uint16_t cmd){ +static GFXINLINE void write_cmd(GDisplay* g, gU16 cmd){ (void)g; palClearLine(lcdpins.DC); - KS0108_select((uint8_t)(cmd>>8)); - KS0108_write((uint8_t)cmd); + KS0108_select((gU8)(cmd>>8)); + KS0108_write((gU8)cmd); KS0108_latch(); KS0108_unselect(); //Important } @@ -387,7 +387,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c index 94e81303..320896f5 100644 --- a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c +++ b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c @@ -64,7 +64,7 @@ #if !KS0108_NEED_READ #define BUFFSZ (GDISP_SCREEN_HEIGHT/8 * GDISP_SCREEN_WIDTH) - #define RAM(g) ((uint8_t *)g->priv) + #define RAM(g) ((gU8 *)g->priv) #endif #ifndef GDISP_INITIAL_CONTRAST #define GDISP_INITIAL_CONTRAST 50 @@ -146,8 +146,8 @@ GFXINLINE void KS0108_goto(GDisplay* g, ) { } static void set_viewport(GDisplay *g) { - uint16_t pg; - uint16_t chip; + gU16 pg; + gU16 chip; pg = g->p.y >> 3; chip = (g->p.x >> 6) << 8; @@ -156,7 +156,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t data; + gU16 data; data = (g->p.x >> 6) << 8; // Set the chip if (g->p.color != GFX_WHITE) @@ -189,7 +189,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); @@ -203,7 +203,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t data, j; + gU8 data, j; set_viewport(g); if (g->p.color != GFX_WHITE) { diff --git a/drivers/gdisp/LGDP4532/board_LGDP4532_template.h b/drivers/gdisp/LGDP4532/board_LGDP4532_template.h index 600cf1fb..261d7758 100644 --- a/drivers/gdisp/LGDP4532/board_LGDP4532_template.h +++ b/drivers/gdisp/LGDP4532/board_LGDP4532_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; @@ -62,7 +62,7 @@ static GFXINLINE void setwritemode(GDisplay *g) (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c index 87cc98a9..522e7821 100644 --- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c +++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c @@ -52,7 +52,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -211,7 +211,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h index de84b8aa..37fd6611 100644 --- a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h +++ b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h @@ -33,7 +33,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -46,12 +46,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index aadfacff..53249f01 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -66,8 +66,8 @@ /*===========================================================================*/ // Use the priv pointer itself to save our color. This save allocating ram for it -// and works provided sizeof(uint16_t) <= sizeof(void *) -#define savecolor(g) (*(uint16_t *)&g->priv) +// and works provided sizeof(gU16) <= sizeof(void *) +#define savecolor(g) (*(gU16 *)&g->priv) #define GDISP_FLG_ODDBYTE (GDISP_FLG_DRIVER<<0) @@ -139,7 +139,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->flags &= ~GDISP_FLG_ODDBYTE; } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); if ((g->flags & GDISP_FLG_ODDBYTE)) { diff --git a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h index de84b8aa..37fd6611 100644 --- a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h +++ b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h @@ -33,7 +33,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -46,12 +46,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 7bc55aa1..cb3f4d17 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -104,9 +104,9 @@ #if GDISP_HARDWARE_STREAM_WRITE typedef struct dvrPriv { - uint16_t savecolor; + gU16 savecolor; #if GDISP_GE8_BROKEN_CONTROLLER - uint16_t firstcolor; + gU16 firstcolor; #endif } dvrPriv; #define PRIV ((dvrPriv *)g->priv) @@ -255,7 +255,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->flags &= ~(GDISP_FLG_ODDBYTE|GDISP_FLG_RUNBYTE); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); #if GDISP_GE8_BROKEN_CONTROLLER @@ -311,7 +311,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); acquire_bus(g); @@ -326,7 +326,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { unsigned tuples; - uint16_t c; + gU16 c; tuples = (g->p.cx*g->p.cy+1)>>1; // With an odd sized area we over-print by one pixel. // This extra pixel overwrites the first pixel (harmless as it is the same colour) @@ -343,12 +343,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_BITFILLS LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { gCoord lg, x, y; - uint16_t c1, c2; + gU16 c1, c2; unsigned tuples; const gPixel *buffer; #if GDISP_PACKED_PIXELS unsigned pnum, pstart; - const uint8_t *p; + const gU8 *p; #else const gPixel *p; #endif @@ -428,10 +428,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { srccx = (g->p.x2 + 1) & ~1; #endif pstart = g->p.y1 * g->p.x2 + g->p.x1; // The starting pixel number - buffer = (const gPixel)(((const uint8_t *)buffer) + ((pstart>>1) * 3)); // The buffer start position + buffer = (const gPixel)(((const gU8 *)buffer) + ((pstart>>1) * 3)); // The buffer start position lg = ((g->p.x2-g->p.cx)>>1)*3; // The buffer gap between lines pnum = pstart + g->p.x2*y + x; // Adjustment for controller craziness - p = ((const uint8_t *)buffer) + (((g->p.x2*y + x)>>1)*3); // Adjustment for controller craziness + p = ((const gU8 *)buffer) + (((g->p.x2*y + x)>>1)*3); // Adjustment for controller craziness while (tuples--) { /* Get a pixel */ @@ -447,7 +447,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { pnum += g->p.x2 - g->p.cx; if (++y >= g->p.cy) { y = 0; - p = (const uint8_t *)buffer; + p = (const gU8 *)buffer; pnum = pstart; } } @@ -465,7 +465,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { pnum += g->p.x2 - g->p.cx; if (++y >= g->p.cy) { y = 0; - p = (const uint8_t *)buffer; + p = (const gU8 *)buffer; pnum = pstart; } } diff --git a/drivers/gdisp/PCD8544/board_PCD8544_template.h b/drivers/gdisp/PCD8544/board_PCD8544_template.h index 6b48d83b..0749f5a8 100644 --- a/drivers/gdisp/PCD8544/board_PCD8544_template.h +++ b/drivers/gdisp/PCD8544/board_PCD8544_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c index 0daf34b4..7e46e3ce 100644 --- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c +++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c @@ -33,7 +33,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_SCREEN_WIDTH) #define xybit(y) (1 << ((y) & 7)) diff --git a/drivers/gdisp/PCF8812/board_PCF8812_template.h b/drivers/gdisp/PCF8812/board_PCF8812_template.h index 88a7dfcf..36adc584 100644 --- a/drivers/gdisp/PCF8812/board_PCF8812_template.h +++ b/drivers/gdisp/PCF8812/board_PCF8812_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index 20486124..415f75e3 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -36,7 +36,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_MATRIX_WIDTH) #define xybit(y) (1 << ((y) & 7)) diff --git a/drivers/gdisp/R61505U/board_R61505U_template.h b/drivers/gdisp/R61505U/board_R61505U_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/R61505U/board_R61505U_template.h +++ b/drivers/gdisp/R61505U/board_R61505U_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c index aa6c5b9e..f2edd3ca 100644 --- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c +++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c @@ -51,7 +51,7 @@ /* Driver local functions. */ /*===========================================================================*/ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -94,7 +94,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -231,7 +231,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/RA6963/board_RA6963.h b/drivers/gdisp/RA6963/board_RA6963.h index ce2af186..bee22c30 100755 --- a/drivers/gdisp/RA6963/board_RA6963.h +++ b/drivers/gdisp/RA6963/board_RA6963.h @@ -177,7 +177,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { #endif } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; #if RA6963_NEED_BACKLIGHT @@ -199,9 +199,9 @@ static GFXINLINE void release_bus(GDisplay *g) { #if RA6963_NEED_READ -static GFXINLINE uint8_t RA6963_busy_wait(uint8_t pattern, gBool lh){ +static GFXINLINE gU8 RA6963_busy_wait(gU8 pattern, gBool lh){ - uint8_t data; + gU8 data; int ii; for(ii = 0; ii < 2; ii++) //Only interested in Bit 0 and 1 @@ -229,7 +229,7 @@ static GFXINLINE uint8_t RA6963_busy_wait(uint8_t pattern, gBool lh){ } #endif -static GFXINLINE void RA6963_write(uint8_t value){ +static GFXINLINE void RA6963_write(gU8 value){ int ii; for(ii = 0; ii < 8; ii++){ if(value & (1 << ii)) @@ -239,7 +239,7 @@ static GFXINLINE void RA6963_write(uint8_t value){ } } -static GFXINLINE void write_data(GDisplay* g, uint8_t data){ +static GFXINLINE void write_data(GDisplay* g, gU8 data){ (void)g; #if RA6963_NEED_READ RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); @@ -254,7 +254,7 @@ static GFXINLINE void write_data(GDisplay* g, uint8_t data){ palSetLine(lcdpins.CD); } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t data){ +static GFXINLINE void write_cmd(GDisplay* g, gU8 data){ (void)g; #if RA6963_NEED_READ RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); @@ -275,11 +275,11 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint8_t read_data(GDisplay *g) { +static GFXINLINE gU8 read_data(GDisplay *g) { (void) g; #if RA6963_NEED_READ int ii; - uint8_t data; + gU8 data; write_cmd(g, RA6963_DATA_READ_AND_NONVARIABLE); //RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); diff --git a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c index 3dfc13ef..ca7cf7e0 100755 --- a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c +++ b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c @@ -119,7 +119,7 @@ #if !RA6963_NEED_READ #define BUFFSZ (RA6963_GRAPHIC_SIZE) - #define RAM(g) ((uint8_t *)g->priv) + #define RAM(g) ((gU8 *)g->priv) #define POS (((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)) #endif #ifndef GDISP_INITIAL_CONTRAST @@ -159,23 +159,23 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gfxSleepMilliseconds(50); //RA6963 needs Data first THEN command! - write_data(g, (uint8_t)RA6963_GRAPHIC_HOME); //0 - write_data(g, (uint8_t)(RA6963_GRAPHIC_HOME>>8)); //0 + write_data(g, (gU8)RA6963_GRAPHIC_HOME); //0 + write_data(g, (gU8)(RA6963_GRAPHIC_HOME>>8)); //0 write_cmd(g, RA6963_SET_GRAPHIC_HOME_ADDRESS); //0x42 - write_data(g, (uint8_t)RA6963_GRAPHIC_AREA); //16 + write_data(g, (gU8)RA6963_GRAPHIC_AREA); //16 write_data(g, 0); //0 write_cmd(g, RA6963_SET_GRAPHIC_AREA); //0x43 - write_data(g, (uint8_t)RA6963_TEXT_HOME); //0x00 - write_data(g, (uint8_t)(RA6963_TEXT_HOME>>8)); //0x04 = 0x400 + write_data(g, (gU8)RA6963_TEXT_HOME); //0x00 + write_data(g, (gU8)(RA6963_TEXT_HOME>>8)); //0x04 = 0x400 write_cmd(g, RA6963_SET_TEXT_HOME_ADDRESS); //0x40 - write_data(g, (uint8_t)RA6963_TEXT_AREA); //16 - write_data(g, (uint8_t)(RA6963_TEXT_AREA>>8)); //0 + write_data(g, (gU8)RA6963_TEXT_AREA); //16 + write_data(g, (gU8)(RA6963_TEXT_AREA>>8)); //0 write_cmd(g, RA6963_SET_TEXT_AREA); //0x41 -/* write_data(g, (uint8_t)RA6963_OFFSET_REGISTER); +/* write_data(g, (gU8)RA6963_OFFSET_REGISTER); write_data(g, 0); write_cmd(g, RA6963_SET_OFFSET_REGISTER);*/ @@ -213,20 +213,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { static void set_viewport(GDisplay *g) { if ((g->p.x >= GDISP_SCREEN_WIDTH) || (g->p.y >= GDISP_SCREEN_HEIGHT)) return; // 0 + ( x / 8 ) + ( y * 16 ) - //uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)); - uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x >> 3) + (g->p.y << 4))); + //gU16 addr = (RA6963_GRAPHIC_HOME + ((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)); + gU16 addr = (RA6963_GRAPHIC_HOME + ((g->p.x >> 3) + (g->p.y << 4))); #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT #warning "check function set_viewport about the shift operations if you change the resolution!" #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO COMPILER_WARNING("check function set_viewport about the shift operations if you change the resolution!") #endif - write_data(g, (uint8_t)addr); - write_data(g, (uint8_t)(addr>>8)); + write_data(g, (gU8)addr); + write_data(g, (gU8)(addr>>8)); write_cmd(g, RA6963_SET_ADDRESS_POINTER); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint8_t temp; + gU8 temp; #if RA6963_NEED_READ temp = read_data(g); @@ -275,7 +275,7 @@ LLDSPEC void gdisp_lld_read_start(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); @@ -289,7 +289,7 @@ LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t data, j; + gU8 data, j; set_viewport(g); if (g->p.color != GFX_WHITE) { diff --git a/drivers/gdisp/RA8875/board_RA8875_template.h b/drivers/gdisp/RA8875/board_RA8875_template.h index 01b5b65d..7ed5bf07 100644 --- a/drivers/gdisp/RA8875/board_RA8875_template.h +++ b/drivers/gdisp/RA8875/board_RA8875_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -47,7 +47,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; } diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index d1d0a4d4..d9b2ba97 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -38,7 +38,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg8(g, reg, data) { write_index(g, reg); write_data(g, data); } #define write_reg16(g, reg, data) { write_index(g, reg); write_data(g, data); write_index(g, reg+1); write_data(g, (data)>>8); } #define write_reg8x2(g, reg, d1, d2) { write_index(g, reg); write_data(g, d1); write_data(g, d2); } @@ -58,8 +58,8 @@ static GFXINLINE void set_viewport(GDisplay* g) { // On this controller the back-light is controlled by the controllers internal PWM // which is why it is in this file rather than the board file. -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) { - uint8_t temp; +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { + gU8 temp; //Work in progress: the RA8875 has a built-in PWM, its output can //be used by a Dynamic Background Control or by a host (user) diff --git a/drivers/gdisp/S6D1121/board_S6D1121_template.h b/drivers/gdisp/S6D1121/board_S6D1121_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/S6D1121/board_S6D1121_template.h +++ b/drivers/gdisp/S6D1121/board_S6D1121_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index 4bbb6213..942f9a65 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -47,7 +47,7 @@ /*===========================================================================*/ /* Some common routines and macros */ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } #define delay(us) gfxSleepMicroseconds(us) #define delayms(ms) gfxSleepMilliseconds(ms) @@ -235,7 +235,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h b/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h index 778d6fc5..ea6a92eb 100644 --- a/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h +++ b/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; diff --git a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c index 3c83273c..6dd867ee 100644 --- a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c +++ b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c @@ -68,8 +68,8 @@ /*===========================================================================*/ // Use the priv pointer itself to save our color. This save allocating ram for it -// and works provided sizeof(uint16_t) <= sizeof(void *) -#define savecolor(g) (*(uint16_t *)&g->priv) +// and works provided sizeof(gU16) <= sizeof(void *) +#define savecolor(g) (*(gU16 *)&g->priv) /*===========================================================================*/ /* Driver local functions. */ @@ -94,7 +94,7 @@ static GFXINLINE void set_viewport(GDisplay* g) /* Driver exported functions. */ /*===========================================================================*/ -const uint16_t lcd_init_list[] = { +const gU16 lcd_init_list[] = { SPFD54124B_CMD_SLPOUT, SPFD54124B_CMD_COLMOD, SPFD54124B_SEND_DATA | SPFD54124B_CMD_COLMOD_MCU16bit, SPFD54124B_CMD_DISPON, @@ -118,8 +118,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) acquire_bus(g); - const uint16_t *list = &lcd_init_list[0]; - uint8_t size = sizeof(lcd_init_list) / sizeof(lcd_init_list[0]); + const gU16 *list = &lcd_init_list[0]; + gU8 size = sizeof(lcd_init_list) / sizeof(lcd_init_list[0]); while(size--) { write_index(g, *list++); diff --git a/drivers/gdisp/SSD1289/board_SSD1289_template.h b/drivers/gdisp/SSD1289/board_SSD1289_template.h index 1cb21fb4..6cee8f1d 100644 --- a/drivers/gdisp/SSD1289/board_SSD1289_template.h +++ b/drivers/gdisp/SSD1289/board_SSD1289_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 4c05f80f..8aff458c 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -43,7 +43,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -224,7 +224,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SSD1306/board_SSD1306_template.h b/drivers/gdisp/SSD1306/board_SSD1306_template.h index 51b6e5f4..518f932a 100644 --- a/drivers/gdisp/SSD1306/board_SSD1306_template.h +++ b/drivers/gdisp/SSD1306/board_SSD1306_template.h @@ -31,12 +31,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index ed55f12a..ebe44447 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -49,7 +49,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } @@ -114,7 +114,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #else write_cmd2(g, SSD1306_SETCOMPINS, 0x22); #endif - write_cmd2(g, SSD1306_SETCONTRAST, (uint8_t)(GDISP_INITIAL_CONTRAST*256/101)); // Set initial contrast. + write_cmd2(g, SSD1306_SETCONTRAST, (gU8)(GDISP_INITIAL_CONTRAST*256/101)); // Set initial contrast. write_cmd2(g, SSD1306_SETVCOMDETECT, 0x10); write_cmd(g, SSD1306_DISPLAYON); write_cmd(g, SSD1306_NORMALDISPLAY); @@ -139,7 +139,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned pages; // Don't flush if we don't need it. @@ -173,8 +173,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gCoord sx, ex; gCoord col; unsigned spage, zpages; - uint8_t * base; - uint8_t mask; + gU8 * base; + gU8 mask; switch(g->g.Orientation) { default: diff --git a/drivers/gdisp/SSD1322/board_SSD1322_template.h b/drivers/gdisp/SSD1322/board_SSD1322_template.h index 0fd6de8b..931c6e82 100644 --- a/drivers/gdisp/SSD1322/board_SSD1322_template.h +++ b/drivers/gdisp/SSD1322/board_SSD1322_template.h @@ -37,18 +37,18 @@ static GFXINLINE void release_bus(GDisplay *g) { } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } #if SSD1322_USE_DMA - static GFXINLINE void write_data_DMA(GDisplay *g, uint8_t* data) { + static GFXINLINE void write_data_DMA(GDisplay *g, gU8* data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c index 5f54cc47..054c1201 100644 --- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c +++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c @@ -47,7 +47,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) // Some common routines and macros #define xyaddr(x, y) ((x) + (y)*SSD1322_ROW_WIDTH) @@ -157,7 +157,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned cols,rows; // Don't flush if we don't need it. @@ -190,7 +190,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { gCoord x, y; - uint8_t *ram; + gU8 *ram; switch(g->g.Orientation) { default: diff --git a/drivers/gdisp/SSD1331/board_SSD1331_template.h b/drivers/gdisp/SSD1331/board_SSD1331_template.h index 943a857d..daa5f4c0 100644 --- a/drivers/gdisp/SSD1331/board_SSD1331_template.h +++ b/drivers/gdisp/SSD1331/board_SSD1331_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c index c15c6370..76042c75 100644 --- a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c +++ b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c @@ -55,7 +55,7 @@ /* Driver exported functions. */ /*===========================================================================*/ -static const uint8_t initdata[] = { +static const gU8 initdata[] = { SSD1331_DISPLAY_OFF, SSD1331_START_LINE, 0x00, SSD1331_COM_OFFSET, 0x00, @@ -157,7 +157,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t a6, b6, c6; + gU8 a6, b6, c6; acquire_bus(g); diff --git a/drivers/gdisp/SSD1351/board_SSD1351_template.h b/drivers/gdisp/SSD1351/board_SSD1351_template.h index fc6fa7b4..b024520f 100644 --- a/drivers/gdisp/SSD1351/board_SSD1351_template.h +++ b/drivers/gdisp/SSD1351/board_SSD1351_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c index 536f3a5e..854cbdce 100644 --- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c +++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c @@ -49,7 +49,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } /*===========================================================================*/ @@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { //dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SSD1848/board_ssd1848_template.h b/drivers/gdisp/SSD1848/board_ssd1848_template.h index 294703e5..f3a3cb2f 100644 --- a/drivers/gdisp/SSD1848/board_ssd1848_template.h +++ b/drivers/gdisp/SSD1848/board_ssd1848_template.h @@ -21,7 +21,7 @@ static void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static void set_backlight(GDisplay *g, uint8_t percent) { +static void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,18 +34,18 @@ static void release_bus(GDisplay *g) { (void) g; } -static void spi_write_cmd(GDisplay *g, uint8_t cmd) { +static void spi_write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static void spi_write_data_array(GDisplay *g, uint8_t* datas, size_t length) { +static void spi_write_data_array(GDisplay *g, gU8* datas, gMemSize length) { (void) g; (void) datas; (void) length; } -static void spi_write_data(GDisplay *g, uint8_t data) { +static void spi_write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c index 8cefac96..1ae57273 100644 --- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c +++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c @@ -15,13 +15,13 @@ typedef struct LCD_Parameters { - uint8_t curXPtr; - uint8_t startXPtr; /* The area start bit position in the start column */ - uint8_t endXPtr; /* The area end bit position in the end column */ - uint8_t curCol; - uint8_t startCol; /* The area start column */ - uint8_t endCol; /* The area end column */ - uint8_t curYPtr; + gU8 curXPtr; + gU8 startXPtr; /* The area start bit position in the start column */ + gU8 endXPtr; /* The area end bit position in the end column */ + gU8 curCol; + gU8 startCol; /* The area start column */ + gU8 endCol; /* The area end column */ + gU8 curYPtr; } LCD_Parameters; #include "board_SSD1848.h" @@ -61,7 +61,7 @@ typedef struct LCD_Parameters /* Some common routines and macros */ #define PRM(g) ((LCD_Parameters *)g->priv) -#define RAM(g) ((uint8_t *)(PRM(g)+1)) +#define RAM(g) ((gU8 *)(PRM(g)+1)) #define write_cmd2(g, cmd1, cmd2) { spi_write_cmd (g, cmd1); spi_write_data (g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { spi_write_cmd (g, cmd1); spi_write_data2 (g, cmd2, cmd3); } @@ -76,7 +76,7 @@ static void set_viewport (GDisplay* g) default: case gOrientation0: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); - spi_write_data2 (g, (uint8_t) (g->p.x / 8), (uint8_t) ((g->p.x + g->p.cx - 1) / 8)); + spi_write_data2 (g, (gU8) (g->p.x / 8), (gU8) ((g->p.x + g->p.cx - 1) / 8)); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); spi_write_data2 (g, g->p.y, g->p.y + g->p.cy - 1); spi_write_cmd (g, SSD1848_WRITE_DISP_DATA); @@ -118,7 +118,7 @@ static void set_viewport (GDisplay* g) LLDSPEC gBool gdisp_lld_init (GDisplay *g) { - uint8_t temp [5] = { 0 }; + gU8 temp [5] = { 0 }; /* The private area is the display surface. */ g->priv = gfxAlloc (sizeof(DisplayData) + GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT); @@ -226,18 +226,18 @@ LLDSPEC void gdisp_lld_write_start (GDisplay *g) acquire_bus (g); set_viewport (g); - PRM(g)->curCol = PRM(g)->startCol = (uint8_t) (g->p.x / 8); - PRM(g)->endCol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - PRM(g)->curXPtr = PRM(g)->startXPtr = (uint8_t) (g->p.x % 8); - PRM(g)->endXPtr = (uint8_t) ((g->p.x + g->p.cx - 1) % 8); + PRM(g)->curCol = PRM(g)->startCol = (gU8) (g->p.x / 8); + PRM(g)->endCol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + PRM(g)->curXPtr = PRM(g)->startXPtr = (gU8) (g->p.x % 8); + PRM(g)->endXPtr = (gU8) ((g->p.x + g->p.cx - 1) % 8); PRM(g)->curYPtr = g->p.y; } LLDSPEC void gdisp_lld_write_color (GDisplay *g) { - uint8_t temp; - uint8_t a; - uint16_t y = PRM(g)->curYPtr; - uint16_t c = PRM(g)->curCol; + gU8 temp; + gU8 a; + gU16 y = PRM(g)->curYPtr; + gU16 c = PRM(g)->curCol; temp = RAM (g)[y * 16 + c]; if (gdispColor2Native (g->p.color)) @@ -286,7 +286,7 @@ LLDSPEC void gdisp_lld_write_stop (GDisplay *g) #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush (GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned pages; /* Don't flush if we don't need it. */ @@ -312,7 +312,7 @@ LLDSPEC void gdisp_lld_flush (GDisplay *g) #if GDISP_HARDWARE_CLEARS LLDSPEC void gdisp_lld_clear (GDisplay *g) { - uint16_t area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT; + gU16 area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT; if (gdispColor2Native (g->p.color)) { @@ -343,13 +343,13 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g) { gCoord scol, ecol, sx, ex; gCoord y, col, x; - uint16_t area = (uint16_t) g->p.cx * g->p.cy; - uint8_t temp; + gU16 area = (gU16) g->p.cx * g->p.cy; + gU8 temp; - col = scol = (uint8_t) (g->p.x / 8); - ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - x = sx = (uint8_t) (g->p.x % 8); - ex = (uint8_t) ((g->p.x + g->p.cx - 1) % 8); + col = scol = (gU8) (g->p.x / 8); + ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + x = sx = (gU8) (g->p.x % 8); + ex = (gU8) ((g->p.x + g->p.cx - 1) % 8); y = g->p.y; @@ -534,9 +534,9 @@ LLDSPEC void gdisp_lld_control (GDisplay *g) g->p.ptr = (void *) 100; acquire_bus (g); spi_write_cmd (g, SSD1848_SETCONTRAST); - spi_write_data (g, (((uint16_t) g->p.ptr) << 8) / 101); + spi_write_data (g, (((gU16) g->p.ptr) << 8) / 101); release_bus (g); - g->g.Contrast = (uint8_t) g->p.ptr; + g->g.Contrast = (gU8) g->p.ptr; return; /* Our own special controller code to inverse the display */ @@ -556,12 +556,12 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) { gCoord scol, ecol, sx; gCoord y, col; - uint16_t area; - uint8_t temp, temp2, i; + gU16 area; + gU8 temp, temp2, i; - col = scol = (uint8_t) (g->p.x / 8); - ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - sx = (uint8_t) (g->p.x % 8); + col = scol = (gU8) (g->p.x / 8); + ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + sx = (gU8) (g->p.x % 8); y = g->p.y; area = (ecol - scol + 1) * (g->p.cy); @@ -574,7 +574,7 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) { for (; area; area--) { - temp = RAM (g)[y * 16 + col] = *((uint8_t *) g->p.ptr)++; + temp = RAM (g)[y * 16 + col] = *((gU8 *) g->p.ptr)++; spi_write_data (g, temp); if (col == ecol) { @@ -595,13 +595,13 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) temp = RAM (g)[y * 16 + col]; if (col != ecol) { - temp |= (*((uint8_t *) g->p.ptr) >> sx); + temp |= (*((gU8 *) g->p.ptr) >> sx); RAM (g)[y * 16 + col] = temp; temp2 = RAM (g)[y * 16 + col + 1]; - temp2 |= (*((uint8_t *) g->p.ptr) << (8-sx)); + temp2 |= (*((gU8 *) g->p.ptr) << (8-sx)); RAM (g)[y * 16 + col + 1] = temp2; - ((uint8_t *) g->p.ptr)++; + ((gU8 *) g->p.ptr)++; } spi_write_data (g, temp); diff --git a/drivers/gdisp/SSD1963/board_SSD1963_template.h b/drivers/gdisp/SSD1963/board_SSD1963_template.h index 82010c3d..9fa5ad6b 100644 --- a/drivers/gdisp/SSD1963/board_SSD1963_template.h +++ b/drivers/gdisp/SSD1963/board_SSD1963_template.h @@ -43,12 +43,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index 9c5ad960..145e9728 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -18,16 +18,16 @@ typedef struct LCD_Parameters { gCoord width, height; // Panel width and height - uint16_t hbporch; // Horizontal Back Porch - uint16_t hfporch; // Horizontal Front Porch - uint16_t hpulse; // Horizontal Pulse - uint16_t hperiod; // Horizontal Period (Total) - uint16_t vbporch; // Vertical Back Porch - uint16_t vfporch; // Vertical Front Porch - uint16_t vpulse; // Vertical Pulse - uint16_t vperiod; // Vertical Period (Total) - uint32_t fpr; // Calculated FPR - uint16_t mode; // For command "SSD1963_SET_LCD_MODE" + gU16 hbporch; // Horizontal Back Porch + gU16 hfporch; // Horizontal Front Porch + gU16 hpulse; // Horizontal Pulse + gU16 hperiod; // Horizontal Period (Total) + gU16 vbporch; // Vertical Back Porch + gU16 vfporch; // Vertical Front Porch + gU16 vpulse; // Vertical Pulse + gU16 vperiod; // Vertical Period (Total) + gU32 fpr; // Calculated FPR + gU16 mode; // For command "SSD1963_SET_LCD_MODE" /* Set the pannel data width */ #define LCD_PANEL_DATA_WIDTH_24BIT (1<<5) // 18bit default /* Set the color deeph enhancement */ @@ -71,7 +71,7 @@ typedef struct LCD_Parameters { #include "ssd1963.h" -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } #define write_data16(g, data) { write_data(g, (data)>>8); write_data(g, (data) & 0xFF); } #define read_reg(g, reg) { write_index(g, reg); read_data(g); } @@ -124,7 +124,7 @@ static GFXINLINE void set_viewport(GDisplay* g) { * * Backlight appears to be forced off (by chip) when display blanked */ -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { // The SSD1963 has a built-in PWM (duty_cycle 00..FF). // Its output can be used by a Dynamic Background Control or by a host (user) // Check your LCD's hardware, the PWM connection is default left open and instead diff --git a/drivers/gdisp/SSD2119/board_SSD2119_template.h b/drivers/gdisp/SSD2119/board_SSD2119_template.h index 1cb21fb4..6cee8f1d 100644 --- a/drivers/gdisp/SSD2119/board_SSD2119_template.h +++ b/drivers/gdisp/SSD2119/board_SSD2119_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 82b8edaa..cea3319a 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -45,7 +45,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay* g) { @@ -260,7 +260,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay* g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ST7565/board_ST7565_template.h b/drivers/gdisp/ST7565/board_ST7565_template.h index 6835c187..44dfab39 100644 --- a/drivers/gdisp/ST7565/board_ST7565_template.h +++ b/drivers/gdisp/ST7565/board_ST7565_template.h @@ -38,12 +38,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index a651b6b7..2998eb3b 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -57,7 +57,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } @@ -150,7 +150,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; acquire_bus(g); - uint8_t pagemap[8]={ST7565_PAGE_ORDER}; + gU8 pagemap[8]={ST7565_PAGE_ORDER}; for (p = 0; p < 8; p++) { write_cmd(g, ST7565_PAGE | pagemap[p]); write_cmd(g, ST7565_COLUMN_MSB | 0); diff --git a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c index bc6b8084..3095dbbf 100644 --- a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c +++ b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c @@ -94,7 +94,7 @@ #include "drivers/gdisp/ST7735/st7735.h" // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } // Serial write data for fast fill. @@ -215,7 +215,7 @@ static const unsigned char #endif -static void execute_cmds(GDisplay *g, const uint8_t *addr) { +static void execute_cmds(GDisplay *g, const gU8 *addr) { unsigned int cmds = *addr++; while (cmds--) { diff --git a/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h b/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h index a3658680..20e47b5e 100644 --- a/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h +++ b/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h @@ -69,7 +69,7 @@ static GFXINLINE void post_init_board(GDisplay* g) (void)g; } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { // This is function may be called with the display for either the foreground // or the background layer. diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 54ecf0cc..7cb8e8a0 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -50,19 +50,19 @@ typedef struct ltdcLayerConfig { LLDCOLOR_TYPE* frame; // Frame buffer address gCoord width, height; // Frame size in pixels gCoord pitch; // Line pitch, in bytes - uint16_t fmt; // Pixel format in LTDC format + gU16 fmt; // Pixel format in LTDC format // Window gCoord x, y; // Start pixel position of the virtual layer gCoord cx, cy; // Size of the virtual layer - uint32_t defcolor; // Default color, ARGB8888 - uint32_t keycolor; // Color key, RGB888 - uint32_t blending; // Blending factors - const uint32_t* palette; // The palette, RGB888 (can be NULL) - uint16_t palettelen; // Palette length - uint8_t alpha; // Constant alpha factor - uint8_t layerflags; // Layer configuration + gU32 defcolor; // Default color, ARGB8888 + gU32 keycolor; // Color key, RGB888 + gU32 blending; // Blending factors + const gU32* palette; // The palette, RGB888 (can be NULL) + gU16 palettelen; // Palette length + gU8 alpha; // Constant alpha factor + gU8 layerflags; // Layer configuration } ltdcLayerConfig; typedef struct ltdcConfig { @@ -70,8 +70,8 @@ typedef struct ltdcConfig { gCoord hsync, vsync; // Horizontal and Vertical sync pixels gCoord hbackporch, vbackporch; // Horizontal and Vertical back porch pixels gCoord hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels - uint32_t syncflags; // Sync flags - uint32_t bgcolor; // Clear screen color RGB888 + gU32 syncflags; // Sync flags + gU32 bgcolor; // Clear screen color RGB888 ltdcLayerConfig bglayer; // Background layer config ltdcLayerConfig fglayer; // Foreground layer config @@ -109,7 +109,7 @@ typedef struct ltdcConfig { /*===========================================================================*/ #define PIXIL_POS(g, x, y) ((y) * ((ltdcLayerConfig *)g->priv)->pitch + (x) * LTDC_PIXELBYTES) -#define PIXEL_ADDR(g, pos) ((LLDCOLOR_TYPE *)((uint8_t *)((ltdcLayerConfig *)g->priv)->frame+pos)) +#define PIXEL_ADDR(g, pos) ((LLDCOLOR_TYPE *)((gU8 *)((ltdcLayerConfig *)g->priv)->frame+pos)) /*===========================================================================*/ /* Driver exported functions. */ @@ -124,7 +124,7 @@ static void _ltdc_reload(void) { } static void _ltdc_layer_init(LTDC_Layer_TypeDef* pLayReg, const ltdcLayerConfig* pCfg) { - static const uint8_t fmt2Bpp[] = { + static const gU8 fmt2Bpp[] = { 4, /* LTDC_FMT_ARGB8888 */ 3, /* LTDC_FMT_RGB888 */ 2, /* LTDC_FMT_RGB565 */ @@ -134,37 +134,37 @@ static void _ltdc_layer_init(LTDC_Layer_TypeDef* pLayReg, const ltdcLayerConfig* 1, /* LTDC_FMT_AL44 */ 2 /* LTDC_FMT_AL88 */ }; - uint32_t start, stop; + gU32 start, stop; // Set the framebuffer dimensions and format - pLayReg->PFCR = (pLayReg->PFCR & ~LTDC_LxPFCR_PF) | ((uint32_t)pCfg->fmt & LTDC_LxPFCR_PF); - pLayReg->CFBAR = (uint32_t)pCfg->frame & LTDC_LxCFBAR_CFBADD; - pLayReg->CFBLR = ((((uint32_t)pCfg->pitch << 16) & LTDC_LxCFBLR_CFBP) | (((uint32_t)fmt2Bpp[pCfg->fmt] * pCfg->width + 3) & LTDC_LxCFBLR_CFBLL)); - pLayReg->CFBLNR = (uint32_t)pCfg->height & LTDC_LxCFBLNR_CFBLNBR; + pLayReg->PFCR = (pLayReg->PFCR & ~LTDC_LxPFCR_PF) | ((gU32)pCfg->fmt & LTDC_LxPFCR_PF); + pLayReg->CFBAR = (gU32)pCfg->frame & LTDC_LxCFBAR_CFBADD; + pLayReg->CFBLR = ((((gU32)pCfg->pitch << 16) & LTDC_LxCFBLR_CFBP) | (((gU32)fmt2Bpp[pCfg->fmt] * pCfg->width + 3) & LTDC_LxCFBLR_CFBLL)); + pLayReg->CFBLNR = (gU32)pCfg->height & LTDC_LxCFBLNR_CFBLNBR; // Set the display window boundaries - start = (uint32_t)pCfg->x + driverCfg.hsync + driverCfg.hbackporch; + start = (gU32)pCfg->x + driverCfg.hsync + driverCfg.hbackporch; stop = start + pCfg->cx - 1; pLayReg->WHPCR = ((start << 0) & LTDC_LxWHPCR_WHSTPOS) | ((stop << 16) & LTDC_LxWHPCR_WHSPPOS); - start = (uint32_t)pCfg->y + driverCfg.vsync + driverCfg.vbackporch; + start = (gU32)pCfg->y + driverCfg.vsync + driverCfg.vbackporch; stop = start + pCfg->cy - 1; pLayReg->WVPCR = ((start << 0) & LTDC_LxWVPCR_WVSTPOS) | ((stop << 16) & LTDC_LxWVPCR_WVSPPOS); // Set colors pLayReg->DCCR = pCfg->defcolor; pLayReg->CKCR = (pLayReg->CKCR & ~0x00FFFFFF) | (pCfg->keycolor & 0x00FFFFFF); - pLayReg->CACR = (pLayReg->CACR & ~LTDC_LxCACR_CONSTA) | ((uint32_t)pCfg->alpha & LTDC_LxCACR_CONSTA); - pLayReg->BFCR = (pLayReg->BFCR & ~(LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)) | ((uint32_t)pCfg->blending & (LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)); + pLayReg->CACR = (pLayReg->CACR & ~LTDC_LxCACR_CONSTA) | ((gU32)pCfg->alpha & LTDC_LxCACR_CONSTA); + pLayReg->BFCR = (pLayReg->BFCR & ~(LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)) | ((gU32)pCfg->blending & (LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)); for (start = 0; start < pCfg->palettelen; start++) - pLayReg->CLUTWR = ((uint32_t)start << 24) | (pCfg->palette[start] & 0x00FFFFFF); + pLayReg->CLUTWR = ((gU32)start << 24) | (pCfg->palette[start] & 0x00FFFFFF); // Final flags - pLayReg->CR = (pLayReg->CR & ~LTDC_LEF_MASK) | ((uint32_t)pCfg->layerflags & LTDC_LEF_MASK); + pLayReg->CR = (pLayReg->CR & ~LTDC_LEF_MASK) | ((gU32)pCfg->layerflags & LTDC_LEF_MASK); } static void _ltdc_init(void) { // Set up the display scanning - uint32_t hacc, vacc; + gU32 hacc, vacc; // Reset the LTDC peripheral RCC->APB2RSTR |= RCC_APB2RSTR_LTDCRST; @@ -446,9 +446,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { // Uses p.x,p.y p.cx,p.cy p.color LLDSPEC void gdisp_lld_fill_area(GDisplay* g) { - uint32_t pos; - uint32_t lineadd; - uint32_t shape; + gU32 pos; + gU32 lineadd; + gU32 shape; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { @@ -484,13 +484,13 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { { // This is slightly less than optimal as we flush the whole line in the source and destination image // instead of just the cx portion but this saves us having to iterate over each line. - uint32_t f, e; + gU32 f, e; // Data memory barrier __ugfxDSB(); // Flush then invalidate the destination area - e = pos + (g->p.cy > 1 ? ((uint32_t)((ltdcLayerConfig *)g->priv)->pitch*(shape & 0xFFFF)) : ((shape>>16)*LTDC_PIXELBYTES)); + e = pos + (g->p.cy > 1 ? ((gU32)((ltdcLayerConfig *)g->priv)->pitch*(shape & 0xFFFF)) : ((shape>>16)*LTDC_PIXELBYTES)); for(f=(pos & ~31); f < e; f += 32) { SCB->DCCIMVAC = f; SCB->DCIMVAC = f; @@ -505,16 +505,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { while(DMA2D->CR & DMA2D_CR_START); // Start the DMA2D - DMA2D->OMAR = (uint32_t)PIXEL_ADDR(g, pos); + DMA2D->OMAR = (gU32)PIXEL_ADDR(g, pos); DMA2D->OOR = lineadd; DMA2D->NLR = shape; #if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888 // As we don't support ARGB pixel types in uGFX yet we will // use RGB with an inverted alpha value for compatibility // ie. 0x00FFFFFF is fully opaque white, 0xFFFFFFFF is fully transparent white - DMA2D->OCOLR = (uint32_t)(gdispColor2Native(g->p.color)) ^ 0xFF000000; + DMA2D->OCOLR = (gU32)(gdispColor2Native(g->p.color)) ^ 0xFF000000; #else - DMA2D->OCOLR = (uint32_t)(gdispColor2Native(g->p.color)); + DMA2D->OCOLR = (gU32)(gdispColor2Native(g->p.color)); #endif ; DMA2D->CR = DMA2D_CR_MODE_R2M | DMA2D_CR_START; @@ -540,27 +540,27 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_HARDWARE_BITFILLS // Uses p.x,p.y p.cx,p.cy p.x1,p.y1 (=srcx,srcy) p.x2 (=srccx), p.ptr (=buffer) LLDSPEC void gdisp_lld_blit_area(GDisplay* g) { - uint32_t srcstart, dststart; + gU32 srcstart, dststart; - srcstart = LTDC_PIXELBYTES * ((uint32_t)g->p.x2 * g->p.y1 * + g->p.x1) + (uint32_t)g->p.ptr; - dststart = (uint32_t)PIXEL_ADDR(g, PIXIL_POS(g, g->p.x, g->p.y)); + srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 * + g->p.x1) + (gU32)g->p.ptr; + dststart = (gU32)PIXEL_ADDR(g, PIXIL_POS(g, g->p.x, g->p.y)); #if LTDC_DMA_CACHE_FLUSH { // This is slightly less than optimal as we flush the whole line in the source and destination image // instead of just the cx portion but this saves us having to iterate over each line. - uint32_t f, e; + gU32 f, e; // Data memory barrier __ugfxDSB(); // Flush the source area - e = srcstart + (g->p.cy > 1 ? ((uint32_t)g->p.x2*g->p.cy) : (uint32_t)g->p.cx)*LTDC_PIXELBYTES; + e = srcstart + (g->p.cy > 1 ? ((gU32)g->p.x2*g->p.cy) : (gU32)g->p.cx)*LTDC_PIXELBYTES; for(f=(srcstart & ~31); f < e; f += 32) SCB->DCCIMVAC = f; // Flush then invalidate the destination area - e = dststart + (g->p.cy > 1 ? ((uint32_t)((ltdcLayerConfig *)g->priv)->pitch*g->p.cy) : ((uint32_t)g->p.cx*LTDC_PIXELBYTES)); + e = dststart + (g->p.cy > 1 ? ((gU32)((ltdcLayerConfig *)g->priv)->pitch*g->p.cy) : ((gU32)g->p.cx*LTDC_PIXELBYTES)); for(f=(dststart & ~31); f < e; f += 32) { SCB->DCCIMVAC = f; SCB->DCIMVAC = f; diff --git a/drivers/gdisp/STM32LTDC/stm32_dma2d.h b/drivers/gdisp/STM32LTDC/stm32_dma2d.h index 1b3478c9..38995479 100644 --- a/drivers/gdisp/STM32LTDC/stm32_dma2d.h +++ b/drivers/gdisp/STM32LTDC/stm32_dma2d.h @@ -11,8 +11,8 @@ #define FGPFCCR_CM_RGB888 0x01 #define FGPFCCR_CM_RGB565 0x02 -#define DMA2D_CR_MODE_R2M ((uint32_t)0x00030000) /* Register-to-memory mode */ -#define DMA2D_CR_MODE_M2M ((uint32_t)0x00000000) /* Register-to-memory mode */ +#define DMA2D_CR_MODE_R2M ((gU32)0x00030000) /* Register-to-memory mode */ +#define DMA2D_CR_MODE_M2M ((gU32)0x00000000) /* Register-to-memory mode */ static void dma2d_init(void); diff --git a/drivers/gdisp/TLS8204/board_TLS8204_template.h b/drivers/gdisp/TLS8204/board_TLS8204_template.h index 6b48d83b..0749f5a8 100644 --- a/drivers/gdisp/TLS8204/board_TLS8204_template.h +++ b/drivers/gdisp/TLS8204/board_TLS8204_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index c7ec75a8..8cfdb862 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -33,7 +33,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_TLS8204_WIDTH) #define xybit(y) (1 << ((y) & 7)) @@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { case GDISP_CONTROL_CONTRAST: if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100; { - uint8_t cval; + gU8 cval; cval = (unsigned)g->p.ptr * 2 + 22; acquire_bus(g); diff --git a/drivers/gdisp/UC1601s/board_UC1601s_template.h b/drivers/gdisp/UC1601s/board_UC1601s_template.h index 51b6e5f4..518f932a 100644 --- a/drivers/gdisp/UC1601s/board_UC1601s_template.h +++ b/drivers/gdisp/UC1601s/board_UC1601s_template.h @@ -31,12 +31,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c index 9b801ea5..c5c78cad 100644 --- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c +++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c @@ -53,7 +53,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_SCREEN_WIDTH) #define xybit(y) (1 << ((y) & 7)) @@ -94,7 +94,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { write_cmd(g, UC1601s_RESET); gfxSleepMilliseconds(10); - write_cmd2(g, UC1601s_SET_BIAS, (uint8_t)(((GDISP_INITIAL_CONTRAST << 8) - 1) / 100)); + write_cmd2(g, UC1601s_SET_BIAS, (gU8)(((GDISP_INITIAL_CONTRAST << 8) - 1) / 100)); write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE); @@ -266,7 +266,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { case GDISP_CONTROL_CONTRAST: if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100; acquire_bus(g); - write_cmd2(g, UC1601s_SET_BIAS, (uint8_t)(((((unsigned)g->p.ptr) << 8) - 1) / 100)); + write_cmd2(g, UC1601s_SET_BIAS, (gU8)(((((unsigned)g->p.ptr) << 8) - 1) / 100)); release_bus(g); g->g.Contrast = (unsigned)g->p.ptr; return; diff --git a/drivers/gdisp/UC1610/board_UC1610_template.h b/drivers/gdisp/UC1610/board_UC1610_template.h index bc5d3a88..ee27a6e3 100644 --- a/drivers/gdisp/UC1610/board_UC1610_template.h +++ b/drivers/gdisp/UC1610/board_UC1610_template.h @@ -30,13 +30,13 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t * cmd, uint8_t length) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 * cmd, gU8 length) { (void) g; (void) cmd; (void) length; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c index 10e1e2f3..001a87a6 100644 --- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c +++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c @@ -39,7 +39,7 @@ // Some common routines and macros #define PRIV(g) ((UC1610_Window *)g->priv) -#define RAM(g) ((uint8_t *)(PRIV(g) + 1)) +#define RAM(g) ((gU8 *)(PRIV(g) + 1)) #define xyaddr(x, y) ((x) + GDISP_SCREEN_WIDTH * ((y) >> 2)) #define xybit(y, c) ((c) << (((y) & 3) << 1)) #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0) @@ -55,7 +55,7 @@ typedef struct UC1610_Window { /* Driver local varriables. */ /*===========================================================================*/ -static uint8_t cmdBuffer[11]; +static gU8 cmdBuffer[11]; /*===========================================================================*/ /* Driver local functions. */ @@ -70,7 +70,7 @@ static void GFXINLINE power_on_sequence(GDisplay* g) { cmdBuffer[2] = UC1610_SET_PANEL_LOADING; cmdBuffer[3] = UC1610_SET_LCD_BIAS_RATIO; cmdBuffer[4] = UC1610_SET_VBIAS_POT; // set contrast - cmdBuffer[5] = (uint8_t) (GDISP_INITIAL_CONTRAST * 254 / 100); + cmdBuffer[5] = (gU8) (GDISP_INITIAL_CONTRAST * 254 / 100); cmdBuffer[6] = UC1610_SET_MAPPING_CONTROL; // bottom view cmdBuffer[7] = UC1610_SET_SCROLL_LINES_LSB | 0; cmdBuffer[8] = UC1610_SET_SCROLL_LINES_MSB | 0; // set scroll line on line 0 @@ -134,7 +134,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { gCoord x, y; - uint8_t *c; + gU8 *c; // handle orientation switch (g->g.Orientation) { @@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_flush(GDisplay* g) { gCoord x1, y1, x2, y2, cx; - uint8_t *c; + gU8 *c; // Don't flush unless we really need to if (!(g->flags & GDISP_FLG_NEEDFLUSH)) @@ -307,7 +307,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { if ((unsigned)g->p.ptr > 100) { g->p.ptr = (void *)100; } acquire_bus(g); cmdBuffer[0] = UC1610_SET_VBIAS_POT; - cmdBuffer[1] = (uint8_t)((unsigned)g->p.ptr * 254 / 100); + cmdBuffer[1] = (gU8)((unsigned)g->p.ptr * 254 / 100); write_cmd(g, cmdBuffer, 2); release_bus(g); g->g.Contrast = (unsigned)g->p.ptr; diff --git a/drivers/gdisp/UC8173/UC8173_waveform_examples.h b/drivers/gdisp/UC8173/UC8173_waveform_examples.h index e8ac919b..8bfaf93f 100644 --- a/drivers/gdisp/UC8173/UC8173_waveform_examples.h +++ b/drivers/gdisp/UC8173/UC8173_waveform_examples.h @@ -1,4 +1,4 @@ -static uint8_t const _lut_ft[] = { +static gU8 const _lut_ft[] = { 0x55,0x55,0x55,0x55,0x55,0xAA,0xAA,0xAA,0xAA,0xAA,0x55,0x55,0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5A,0x5A, 0x5A,0x5A,0x5A,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x5A,0x5A, @@ -9,11 +9,11 @@ static uint8_t const _lut_ft[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_GU[] = { +static gU8 const _lut_KWvcom_DC_GU[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_GU[] = { +static gU8 const _lut_kw_GU[] = { 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80, 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80, 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, @@ -48,11 +48,11 @@ static uint8_t const _lut_kw_GU[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_GC[] = { +static gU8 const _lut_KWvcom_GC[] = { 0x55,0x6A,0xA5,0x55,0x55,0x55,0x55,0x55,0x56,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0C, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_GC[] = { +static gU8 const _lut_kw_GC[] = { 0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81, 0x41,0x00,0x00,0x81,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82, 0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x42,0x00,0x00,0x41,0x42,0x00,0x00,0x41, @@ -87,11 +87,11 @@ static uint8_t const _lut_kw_GC[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_A2_240ms[] = { +static gU8 const _lut_KWvcom_DC_A2_240ms[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_A2_240ms[] = { +static gU8 const _lut_kw_A2_240ms[] = { 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, @@ -126,11 +126,11 @@ static uint8_t const _lut_kw_A2_240ms[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_A2_120ms[] = { +static gU8 const _lut_KWvcom_DC_A2_120ms[] = { 0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_A2_120ms[] = { +static gU8 const _lut_kw_A2_120ms[] = { 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, diff --git a/drivers/gdisp/UC8173/board_UC8173_template.h b/drivers/gdisp/UC8173/board_UC8173_template.h index 94677979..5321afe7 100644 --- a/drivers/gdisp/UC8173/board_UC8173_template.h +++ b/drivers/gdisp/UC8173/board_UC8173_template.h @@ -61,19 +61,19 @@ static GFXINLINE void release_bus(GDisplay* g) (void) g; } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) +static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay* g, uint8_t data) +static GFXINLINE void write_data(GDisplay* g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, unsigned length) +static GFXINLINE void write_data_burst(GDisplay* g, gU8* data, unsigned length) { (void) g; (void) data; @@ -81,7 +81,7 @@ static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, unsigned leng } #if UC8173_CAN_READ - static GFXINLINE uint8_t read_data(GDisplay* g) + static GFXINLINE gU8 read_data(GDisplay* g) { (void)g; return 0; diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c index 05fcf557..fdd9fd23 100644 --- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c +++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c @@ -25,9 +25,9 @@ /*------------------ Load the board file ------------------*/ typedef struct UC8173Lut { - uint8_t const *lutVCOM; // 32 bytes - uint8_t const *lutFW; // 512 bytes - uint8_t const *lutFT; // 128 bytes + gU8 const *lutVCOM; // 32 bytes + gU8 const *lutFW; // 512 bytes + gU8 const *lutFT; // 128 bytes gBool regal; } UC8173Lut; @@ -115,7 +115,7 @@ typedef struct UC8173_Private { } UC8173_Private; #if !UC8173_INIT_REAL_LUT - static uint8_t const UC8173_LUT_None[] = { + static gU8 const UC8173_LUT_None[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) write_data(g, UC8173_VCOM_VOLTAGEBYTE); // was 0x12 in example code = -1.0V #elif UC8173_CAN_READ { - uint8_t vc; + gU8 vc; write_cmd(g, VV); vc = read_data(g); @@ -340,12 +340,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) // Setup the window // Datasheet says x,y,w,h but in practice it needs to be x,y,w-1,h-1 write_cmd(g, DTMW); - write_data(g, (uint8_t)((priv->fb.fa0.x >> 0) & 0xFF)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 8) & 0x03)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cx-1) >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cy-1) >> 8) & 0x03)); - write_data(g, (uint8_t)(((cy-1) >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.x >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.y >> 8) & 0x03)); + write_data(g, (gU8)((priv->fb.fa0.y >> 0) & 0xFF)); + write_data(g, (gU8)(((cx-1) >> 0) & 0xFF)); + write_data(g, (gU8)(((cy-1) >> 8) & 0x03)); + write_data(g, (gU8)(((cy-1) >> 0) & 0xFF)); // Transfer the buffer #if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_MONO @@ -357,7 +357,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) #endif dx = (cx+FB_TYPE_PIXELS-1)/FB_TYPE_PIXELS * (LLDCOLOR_TYPE_BITS/8); for (fb = FB_ADDR(&priv->fb, 0, priv->fb.fa0.x, priv->fb.fa0.y), dy = cy; dy; dy--, fb += FB_LINE_TYPES) - write_data_burst(g, (uint8_t *)fb, dx); + write_data_burst(g, (gU8 *)fb, dx); // Power-up the DC/DC converter to update the display panel write_cmd(g, PON); @@ -367,12 +367,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) // Datasheet says x,y,w,h but in practice it needs to be x,y,w-1,h-1 write_cmd(g, DRF); // data: Partial Scan = 0x10, REGAL = 0x08, VCOM_DoNothing = 0x04 (GC4/A2 = 0x00, GU4 = 0x08) write_data(g, (priv->lut->regal ? 0x08 : 0x00)); - write_data(g, (uint8_t)((priv->fb.fa0.x >> 0) & 0xFF)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 8) & 0x03)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cx-1) >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cy-1) >> 8) & 0x03)); - write_data(g, (uint8_t)(((cy-1) >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.x >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.y >> 8) & 0x03)); + write_data(g, (gU8)((priv->fb.fa0.y >> 0) & 0xFF)); + write_data(g, (gU8)(((cx-1) >> 0) & 0xFF)); + write_data(g, (gU8)(((cy-1) >> 8) & 0x03)); + write_data(g, (gU8)(((cy-1) >> 0) & 0xFF)); while (!getpin_busy(g)); // Power-down the DC/DC converter diff --git a/drivers/gdisp/WS29EPD/board_WS29EPD_template.h b/drivers/gdisp/WS29EPD/board_WS29EPD_template.h index 8d8b1077..1682ebf6 100644 --- a/drivers/gdisp/WS29EPD/board_WS29EPD_template.h +++ b/drivers/gdisp/WS29EPD/board_WS29EPD_template.h @@ -31,23 +31,23 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_reg(GDisplay *g, uint8_t reg, uint8_t data){ +static GFXINLINE void write_reg(GDisplay *g, gU8 reg, gU8 data){ (void) g; (void) reg; (void) data; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t reg){ +static GFXINLINE void write_cmd(GDisplay *g, gU8 reg){ (void) g; (void) reg; } -static GFXINLINE void write_reg_data(GDisplay *g, uint8_t reg, uint8_t *data, uint8_t len) { +static GFXINLINE void write_reg_data(GDisplay *g, gU8 reg, gU8 *data, gU8 len) { (void) g; (void) reg; (void) data; diff --git a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c index 5073ed61..07bf8e8f 100644 --- a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c +++ b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c @@ -37,9 +37,9 @@ /*===========================================================================*/ /* initialization variables according to WaveShare. */ -uint8_t GDOControl[] = {(GDISP_SCREEN_HEIGHT-1)%256,(GDISP_SCREEN_HEIGHT-1)/256,0x00}; -uint8_t softstart[] = {0xd7,0xd6,0x9d}; -uint8_t LUTDefault_full[] = {0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00}; // Initialize the full display +gU8 GDOControl[] = {(GDISP_SCREEN_HEIGHT-1)%256,(GDISP_SCREEN_HEIGHT-1)/256,0x00}; +gU8 softstart[] = {0xd7,0xd6,0x9d}; +gU8 LUTDefault_full[] = {0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00}; // Initialize the full display /*===========================================================================*/ /* Driver local functions. */ @@ -55,7 +55,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { * [y=0; y=1; y=2; y=3; ...; y=GDISP_SCREEN_HEIGHT][y=0; y=1; y=2; y=3; ...; y=GDISP_SCREEN_HEIGHT]... * */ - g->priv = gfxAlloc((GDISP_SCREEN_WIDTH / WS29EPD_PPB) * GDISP_SCREEN_HEIGHT * sizeof(uint8_t)); + g->priv = gfxAlloc((GDISP_SCREEN_WIDTH / WS29EPD_PPB) * GDISP_SCREEN_HEIGHT * sizeof(gU8)); if (!g->priv) return gFalse; @@ -85,12 +85,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { write_cmd(g, MASTER_ACTIVATION); write_reg(g, DEEP_SLEEP_MODE, 0x00); - uint8_t zeros[2] = { 0, 0 }; + gU8 zeros[2] = { 0, 0 }; write_reg(g, SET_RAM_X_CNT, 0x00); // Set cursor at origin write_reg_data(g, SET_RAM_Y_CNT, zeros, 2); - uint8_t dataX[2] = { 0, (GDISP_SCREEN_WIDTH-1)/8 }; - uint8_t dataY[4] = { 0, 0, (GDISP_SCREEN_HEIGHT-1)%256, (GDISP_SCREEN_HEIGHT-1)/256 }; + gU8 dataX[2] = { 0, (GDISP_SCREEN_WIDTH-1)/8 }; + gU8 dataY[4] = { 0, 0, (GDISP_SCREEN_HEIGHT-1)%256, (GDISP_SCREEN_HEIGHT-1)/256 }; write_reg_data(g, SET_RAM_X_ADR, dataX, 2); // Set viewport for the whole screen write_reg_data(g, SET_RAM_Y_ADR, dataY, 4); @@ -111,7 +111,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if 0 // Not needed yet static void set_cursor(GDisplay *g) { - uint8_t dataY[2]; + gU8 dataY[2]; dataY[0] = g->p.y % 256; // Y-data is send in two bytes dataY[1] = g->p.y / 256; @@ -133,8 +133,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { } static void set_viewport(GDisplay *g) { - uint8_t dataX[2]; - uint8_t dataY[4]; + gU8 dataX[2]; + gU8 dataY[4]; // Fill up the X and Y position buffers. dataX[0] = g->p.x / WS29EPD_PPB; @@ -186,9 +186,9 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { } /* There is only black and no black (white). */ if (gdispColor2Native(g->p.color) != Black) // Indexing in the array is done as described in the init routine - ((uint8_t *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] |= (1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); + ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] |= (1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); else - ((uint8_t *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] &= ~(1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); + ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] &= ~(1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); } #endif @@ -201,7 +201,7 @@ LLDSPEC void gdisp_lld_flush(GDisplay *g) { for(int i=0; ipriv)[(GDISP_SCREEN_HEIGHT*j) + i]); + write_data(g, ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*j) + i]); /* Update the screen. */ write_reg(g, DISPLAY_UPDATE_CTRL2, 0xc7); // Full update (partial hasn't been implemented yet) diff --git a/drivers/gdisp/framebuffer/board_framebuffer_template.h b/drivers/gdisp/framebuffer/board_framebuffer_template.h index 594f4340..9b01f075 100644 --- a/drivers/gdisp/framebuffer/board_framebuffer_template.h +++ b/drivers/gdisp/framebuffer/board_framebuffer_template.h @@ -35,13 +35,13 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c index 99dfe8fd..d6674d80 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c +++ b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c @@ -18,7 +18,7 @@ static adcsample_t samplebuf[GINPUT_DIAL_NUM_PORTS]; #if GINPUT_DIAL_CYCLE_POLL - static uint16_t cycle; + static gU16 cycle; #endif static void GADCCallback(adcsample_t *buffer, void *param) { diff --git a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h index 7b4bcb58..59a78a53 100644 --- a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h +++ b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h @@ -35,7 +35,7 @@ static GFXINLINE void release_bus(GMouse* m) { } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { } diff --git a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c index c7afd0d7..e4d6247a 100644 --- a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c +++ b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c @@ -28,7 +28,7 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) static gBool read_xyz(GMouse* m, GMouseReading* pdr) { - uint8_t rxbuf[10]; + gU8 rxbuf[10]; // We don't support buttons. This is a regular touchscreen pdr->buttons = 0; diff --git a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h index 9cd8eb7d..d4a8365b 100644 --- a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h +++ b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h @@ -31,15 +31,15 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { } diff --git a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h index 5cbbbd1a..5e835f37 100644 --- a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h +++ b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h @@ -33,27 +33,27 @@ static gBool init_board(GMouse* m, unsigned instance) return gTrue; } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { (void)m; (void)reg; (void)val; } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { (void)m; (void)reg; - return (uint16_t)0x00; + return (gU16)0x00; } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { (void)m; (void)reg; - return (uint16_t)0x0000; + return (gU16)0x0000; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h index 45f0a66e..4a36c297 100644 --- a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h +++ b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h @@ -34,13 +34,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h index d81f55f0..17fa35a9 100644 --- a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h +++ b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h @@ -34,13 +34,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c index acfe2142..4fca15d9 100644 --- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c +++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c @@ -29,9 +29,9 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) { - const uint8_t *p; + const gU8 *p; - static const uint8_t commandList[] = { + static const gU8 commandList[] = { MAX11802_CMD_GEN_WR, 0xf0, // General config - leave TIRQ enabled, even though we ignore it ATM MAX11802_CMD_RES_WR, 0x00, // A-D resolution, hardware config - rewriting default; all 12-bit resolution MAX11802_CMD_AVG_WR, MAX11802_AVG, // A-D averaging - 8 samples, average four median samples @@ -70,8 +70,8 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) static gBool read_xyz(GMouse* m, GMouseReading* pdr) { - uint8_t readyCount; - uint8_t notReadyCount; + gU8 readyCount; + gU8 notReadyCount; // Assume not touched. pdr->buttons = 0; @@ -153,8 +153,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) } // Strip the tags (we need to take care because gCoord is signed - and sign bit gets extended on shift!) - pdr->x = (uint16_t)(pdr->x) >> 4; - pdr->y = (uint16_t)(pdr->y) >> 4; + pdr->x = (gU16)(pdr->x) >> 4; + pdr->y = (gU16)(pdr->y) >> 4; pdr->z = Z_MAX; return gTrue; diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h index ec5d6982..f0461db6 100644 --- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h +++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h @@ -47,7 +47,7 @@ static GFXINLINE void release_bus(GMouse* m) { * * Return the second byte read in case of interest */ -static GFXINLINE uint8_t write_command(GMouse* m, uint8_t command, uint8_t value) { +static GFXINLINE gU8 write_command(GMouse* m, gU8 command, gU8 value) { } /** @@ -55,14 +55,14 @@ static GFXINLINE uint8_t write_command(GMouse* m, uint8_t command, uint8_t value * * Return the byte read in case of interest */ -static GFXINLINE uint8_t gfintWriteCommand(GMouse* m, uint8_t command) { +static GFXINLINE gU8 gfintWriteCommand(GMouse* m, gU8 command) { } /* * Read 2 bytes as 16-bit value (command to read must have been sent previously) * Note: Analog value is in bits 15..4, tags (reading status) in bits 3..0 */ -static GFXINLINE uint16_t read_value(GMouse* m) { +static GFXINLINE gU16 read_value(GMouse* m) { } diff --git a/drivers/ginput/touch/QWidget/example/mywidget.cpp b/drivers/ginput/touch/QWidget/example/mywidget.cpp index c4599193..0a7ca29e 100644 --- a/drivers/ginput/touch/QWidget/example/mywidget.cpp +++ b/drivers/ginput/touch/QWidget/example/mywidget.cpp @@ -5,7 +5,7 @@ extern GMouse* qwidgetMouse; extern gCoord qwidgetMouseX; extern gCoord qwidgetMouseY; extern gCoord qwidgetMouseZ; -extern uint16_t qwidgetMouseButtons; +extern gU16 qwidgetMouseButtons; MyWidget::MyWidget(QWidget* parent) : QWidget(parent) { diff --git a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c index acbc0406..42b1f2b9 100644 --- a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c +++ b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c @@ -17,7 +17,7 @@ GMouse* qwidgetMouse; gCoord qwidgetMouseX; gCoord qwidgetMouseY; gCoord qwidgetMouseZ; -uint16_t qwidgetMouseButtons; +gU16 qwidgetMouseButtons; static gBool _init(GMouse* m, unsigned driverinstance) { diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c index 21581077..c44289c6 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c @@ -103,7 +103,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GMOUSE_STMPE610_TEST_MODE static GMouseReading n; #endif - uint8_t status; + gU8 status; // Button information will be regenerated pdr->buttons = 0; diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h index d68a0be3..e4d4527c 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h @@ -48,13 +48,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c index ab2c87b4..90ea953f 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c @@ -103,7 +103,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GMOUSE_STMPE811_TEST_MODE static GMouseReading n; #endif - uint8_t status; + gU8 status; // Button information will be regenerated pdr->buttons = 0; diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h index bcc9ab57..9d38b797 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h @@ -48,13 +48,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c index e594e649..e306dd7f 100644 --- a/drivers/multiple/SDL/gdisp_lld_SDL.c +++ b/drivers/multiple/SDL/gdisp_lld_SDL.c @@ -79,7 +79,7 @@ // Forward definitions static gBool SDL_KeyboardInit(GKeyboard *k, unsigned driverinstance); - static int SDL_KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int SDL_KeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -97,7 +97,7 @@ static struct KeyMap { SDL_Keycode k_sdl; - uint16_t k_ugfx; + gU16 k_ugfx; } SDL_keymap[] = { {SDLK_UP, GKEY_UP}, @@ -136,7 +136,7 @@ }; static struct ModMap { SDL_Keycode s_sdl; - uint32_t s_ugfx; + gU32 s_ugfx; } SDL_modmap[] = { {KMOD_LSHIFT, GKEYSTATE_SHIFT_L}, {KMOD_RSHIFT, GKEYSTATE_SHIFT_R}, @@ -149,23 +149,23 @@ {0,0} }; struct SDL_keymsg { - uint32_t key; - uint32_t keystate; + gU32 key; + gU32 keystate; }; static GKeyboard *keyboard = 0; #endif // shared IPC context struct SDL_UGFXContext { - uint32_t framebuf[GDISP_SCREEN_WIDTH*GDISP_SCREEN_HEIGHT]; - int16_t need_redraw; + gU32 framebuf[GDISP_SCREEN_WIDTH*GDISP_SCREEN_HEIGHT]; + gI16 need_redraw; int minx,miny,maxx,maxy; #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t buttons; + gU16 buttons; #endif #if GINPUT_NEED_KEYBOARD - uint16_t keypos; + gU16 keypos; struct SDL_keymsg keybuffer[8]; #endif }; @@ -198,7 +198,7 @@ static int SDL_loop (void) { context->maxx = 0; context->maxy = 0; - SDL_UpdateTexture(texture, &r, context->framebuf+r.y*GDISP_SCREEN_WIDTH+r.x, GDISP_SCREEN_WIDTH*sizeof(uint32_t)); + SDL_UpdateTexture(texture, &r, context->framebuf+r.y*GDISP_SCREEN_WIDTH+r.x, GDISP_SCREEN_WIDTH*sizeof(gU32)); SDL_RenderCopy(render, texture, 0, 0); SDL_RenderPresent(render); } @@ -249,8 +249,8 @@ static int SDL_loop (void) { case SDL_KEYDOWN: case SDL_KEYUP: { SDL_Keycode k_sdl = event.key.keysym.sym; - uint8_t k_ugfx = 0; - uint32_t s_ugfx = (event.type==SDL_KEYDOWN)?0:GKEYSTATE_KEYUP; + gU8 k_ugfx = 0; + gU32 s_ugfx = (event.type==SDL_KEYDOWN)?0:GKEYSTATE_KEYUP; int i; if (!(k_sdl & ~0x7f) && (k_sdl <32 || k_sdl == 127)) { k_ugfx = k_sdl; @@ -409,7 +409,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) LLDCOLOR_TYPE c = gdispColor2Native(g->p.color); if (context) { int x,y; - uint32_t *pbuf = context->framebuf + g->p.y*GDISP_SCREEN_WIDTH + g->p.x; + gU32 *pbuf = context->framebuf + g->p.y*GDISP_SCREEN_WIDTH + g->p.x; int dy = GDISP_SCREEN_WIDTH - g->p.cx; for (y = 0; y < g->p.cy; ++y) { for (x = 0; x < g->p.cx; ++x) @@ -458,7 +458,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) return gTrue; } - static int SDL_KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int SDL_KeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i = 0; if (!context || !context->keypos || !sz) return 0; diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index cd8eb512..1ec52a37 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -144,11 +144,11 @@ #include "../../../src/ginput/ginput_keyboard_microcode.h" // Forward definitions - extern uint8_t GKEYBOARD_WIN32_DEFAULT_LAYOUT[]; + extern gU8 GKEYBOARD_WIN32_DEFAULT_LAYOUT[]; // This is the layout code for the English US keyboard. // We make it public so that a user can switch to a different layout if required. - uint8_t KeyboardLayout_Win32_US[] = { + gU8 KeyboardLayout_Win32_US[] = { KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1, // Transient Shifters: SHIFT, CTRL, ALT, WINKEY @@ -391,7 +391,7 @@ // Forward definitions static gBool Win32KeyboardInit(GKeyboard *k, unsigned driverinstance); - static int Win32KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int Win32KeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT const GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -415,7 +415,7 @@ }}; static int keypos; - static uint8_t keybuffer[8]; + static gU8 keybuffer[8]; static GKeyboard *keyboard; #endif @@ -443,13 +443,13 @@ typedef struct winPriv { HBITMAP dcOldBitmap; #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse *mouse; gBool mouseenabled; - void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y); + void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y); #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE - uint8_t toggles; + gU8 toggles; #endif #if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ gCoord x0, y0, x1, y1; @@ -462,7 +462,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) { } #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE - void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y) { + void gfxEmulatorMouseInject(GDisplay *g, gU16 buttons, gCoord x, gCoord y) { winPriv * priv; priv = (winPriv *)g->priv; @@ -475,7 +475,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) { void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) { ((winPriv *)g->priv)->mouseenabled = enabled; } - void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)) { + void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y)) { ((winPriv *)g->priv)->capfn = capfn; } #endif @@ -487,7 +487,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) GDisplay * g; winPriv * priv; #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE - uint16_t btns; + gU16 btns; #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE HBRUSH hbrOn, hbrOff; @@ -496,7 +496,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) HGDIOBJ old; POINT p; gCoord pos; - uint8_t bit; + gU8 bit; #endif switch (Msg) { @@ -1611,7 +1611,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return gTrue; } - static int Win32KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int Win32KeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i, j; (void) k; diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h index 0eefe49a..9f6f38fe 100644 --- a/drivers/multiple/Win32/gdisp_lld_config.h +++ b/drivers/multiple/Win32/gdisp_lld_config.h @@ -55,14 +55,14 @@ void gfxEmulatorSetParentWindow(void *hwnd); #if GINPUT_NEED_MOUSE // This function allows you to inject mouse events into the ugfx mouse driver - void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y); + void gfxEmulatorMouseInject(GDisplay *g, gU16 buttons, gCoord x, gCoord y); // This function enables you to turn on/off normal mouse functions on a ugfx Win32 display window. void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled); // This function enables you to capture mouse events on a ugfx Win32 display window. // Passing NULL turns off the capture - void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)); + void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y)); #endif #endif /* GFX_USE_GDISP */ diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index d4f7f3da..ace906a7 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -106,14 +106,14 @@ #endif // Forward definitions - extern uint8_t GKEYBOARD_X_DEFAULT_LAYOUT[]; + extern gU8 GKEYBOARD_X_DEFAULT_LAYOUT[]; #include "../../../src/ginput/ginput_keyboard_microcode.h" #include // This is the layout code for the English US keyboard. // We make it public so that a user can switch to a different layout if required. - uint8_t KeyboardLayout_X_US[] = { + gU8 KeyboardLayout_X_US[] = { KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1, // TODO @@ -141,7 +141,7 @@ // Forward definitions static gBool XKeyboardInit(GKeyboard *k, unsigned driverinstance); - static int XKeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int XKeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT const GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -163,7 +163,7 @@ }}; static int keypos; - static uint8_t keybuffer[8]; + static gU8 keybuffer[8]; static GKeyboard *keyboard; #endif @@ -182,7 +182,7 @@ typedef struct xPriv { Window win; #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t buttons; + gU16 buttons; GMouse * mouse; #endif } xPriv; @@ -509,7 +509,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) return gTrue; } - static int XKeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int XKeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i, j; (void) k; diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index ffd3b1f9..a5bfbd97 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -157,10 +157,10 @@ typedef struct netPriv { SOCKET_TYPE netfd; // The current socket unsigned databytes; // How many bytes have been read - uint16_t data[2]; // Buffer for storing data read. + gU16 data[2]; // Buffer for storing data read. #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse * mouse; #endif } netPriv; @@ -180,19 +180,19 @@ static gThread hThread; /** * Send a whole packet of data. - * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want to send as our protocol only talks gU16's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. * If the connection closes before we send all the data - the call returns gFalse. */ -static gBool sendpkt(SOCKET_TYPE netfd, uint16_t *pkt, int len) { +static gBool sendpkt(SOCKET_TYPE netfd, gU16 *pkt, int len) { int i; - // Convert each uint16_t to network order + // Convert each gU16 to network order for(i = 0; i < len; i++) pkt[i] = htons(pkt[i]); // Send it - len *= sizeof(uint16_t); + len *= sizeof(gU16); return send(netfd, (const char *)pkt, len, 0) == len; } @@ -465,7 +465,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { netPriv * priv; - uint16_t buf[1]; + gU16 buf[1]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -486,7 +486,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { netPriv * priv; - uint16_t buf[4]; + gU16 buf[4]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -512,7 +512,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -539,7 +539,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { netPriv * priv; gPixel * buffer; - uint16_t buf[5]; + gU16 buf[5]; gCoord x, y; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -576,7 +576,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_PIXELREAD LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -609,7 +609,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -635,7 +635,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gBool allgood; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -657,9 +657,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; break; case GDISP_CONTROL_BACKLIGHT: - if (g->g.Backlight == (uint16_t)(int)g->p.ptr) + if (g->g.Backlight == (gU16)(int)g->p.ptr) return; - if ((uint16_t)(int)g->p.ptr > 100) + if ((gU16)(int)g->p.ptr > 100) g->p.ptr = (void *)100; break; default: @@ -670,7 +670,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { priv = g->priv; buf[0] = GNETCODE_CONTROL; buf[1] = g->p.x; - buf[2] = (uint16_t)(int)g->p.ptr; + buf[2] = (gU16)(int)g->p.ptr; MUTEX_ENTER; sendpkt(priv->netfd, buf, 3); MUTEX_EXIT; @@ -709,7 +709,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Powermode = (gPowermode)g->p.ptr; break; case GDISP_CONTROL_BACKLIGHT: - g->g.Backlight = (uint16_t)(int)g->p.ptr; + g->g.Backlight = (gU16)(int)g->p.ptr; break; } } diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp index 11b4b144..0e5381e5 100644 --- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp +++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp @@ -117,10 +117,10 @@ static gBool uGFXInitDone; typedef struct netPriv { CLIENTFD netfd; // The current client unsigned databytes; // How many bytes have been read - uint16_t data[2]; // Buffer for storing data read. + gU16 data[2]; // Buffer for storing data read. #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse * mouse; #endif } netPriv; @@ -148,12 +148,12 @@ static void endcon(GDisplay *g) { /** * Send a whole packet of data. - * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want to send as our protocol only talks gU16's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. * If the connection closes before we send all the data - the call returns gFalse. */ -static gBool sendpkt(CLIENTFD fd, uint16_t *pkt, int len) { - // Convert each uint16_t to network order +static gBool sendpkt(CLIENTFD fd, gU16 *pkt, int len) { + // Convert each gU16 to network order #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_LITTLE { int i; @@ -164,8 +164,8 @@ static gBool sendpkt(CLIENTFD fd, uint16_t *pkt, int len) { #endif // Send it - len *= sizeof(uint16_t); - return fd->write((uint8_t *)pkt, len) == len; + len *= sizeof(gU16); + return fd->write((gU8 *)pkt, len) == len; } static void rxdata(GDisplay *g) { @@ -197,7 +197,7 @@ static void rxdata(GDisplay *g) { } // Get the data - if ((len = fd->read(((uint8_t *)priv->data)+priv->databytes, sizeof(priv->data)-priv->databytes, 0)) <= 0) { + if ((len = fd->read(((gU8 *)priv->data)+priv->databytes, sizeof(priv->data)-priv->databytes, 0)) <= 0) { // Socket closed or in error state MUTEX_EXIT; endcon(g); @@ -348,7 +348,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { netPriv * priv; - uint16_t buf[1]; + gU16 buf[1]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -369,7 +369,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { netPriv * priv; - uint16_t buf[4]; + gU16 buf[4]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -395,7 +395,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -422,7 +422,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { netPriv * priv; gPixel * buffer; - uint16_t buf[5]; + gU16 buf[5]; gCoord x, y; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -459,7 +459,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_PIXELREAD LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -492,7 +492,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -518,7 +518,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gBool allgood; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -540,9 +540,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; break; case GDISP_CONTROL_BACKLIGHT: - if (g->g.Backlight == (uint16_t)(int)g->p.ptr) + if (g->g.Backlight == (gU16)(int)g->p.ptr) return; - if ((uint16_t)(int)g->p.ptr > 100) + if ((gU16)(int)g->p.ptr > 100) g->p.ptr = (void *)100; break; default: @@ -553,7 +553,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { priv = g->priv; buf[0] = GNETCODE_CONTROL; buf[1] = g->p.x; - buf[2] = (uint16_t)(int)g->p.ptr; + buf[2] = (gU16)(int)g->p.ptr; MUTEX_ENTER; sendpkt(priv->netfd, buf, 3); MUTEX_EXIT; @@ -592,7 +592,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Powermode = (gPowermode)g->p.ptr; break; case GDISP_CONTROL_BACKLIGHT: - g->g.Backlight = (uint16_t)(int)g->p.ptr; + g->g.Backlight = (gU16)(int)g->p.ptr; break; } } diff --git a/gfxconf.example.h b/gfxconf.example.h index 38c68073..c7e253fd 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -67,6 +67,7 @@ // #define GFX_OS_CALL_UGFXMAIN GFXOFF // #define GFX_OS_UGFXMAIN_STACKSIZE 0 // #define GFX_EMULATE_MALLOC GFXOFF +// #define GFX_MEM_LT64K GFXOFF /////////////////////////////////////////////////////////////////////////// diff --git a/src/gadc/gadc.c b/src/gadc/gadc.c index 0cd9c82e..77a65c19 100644 --- a/src/gadc/gadc.c +++ b/src/gadc/gadc.c @@ -30,8 +30,8 @@ typedef struct NonTimerData_t { GadcNonTimerJob job; } NonTimerData; -static volatile uint16_t hsFlags; -static size_t hsBytesPerConv; +static volatile gU16 hsFlags; +static gMemSize hsBytesPerConv; static GadcTimerJob hsJob; static GDataBuffer *hsData; static gfxQueueGSync hsListDone; @@ -45,7 +45,7 @@ static gfxQueueGSync lsListToDo; static gfxQueueGSync lsListDone; static NonTimerData *lsData; -void gadcGotDataI(size_t n) { +void gadcGotDataI(gMemSize n) { if ((hsFlags & GADC_HSADC_CONVERTION)) { // A set of timer conversions is done - add them @@ -199,7 +199,7 @@ void _gadcDeinit(void) } #endif -void gadcHighSpeedInit(uint32_t physdev, uint32_t frequency) +void gadcHighSpeedInit(gU32 physdev, gU32 frequency) { if ((hsFlags & GADC_HSADC_RUNNING)) gadcHighSpeedStop(); @@ -291,7 +291,7 @@ static void LowSpeedGTimerCallback(void *param) { } } -void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer) { +void gadcLowSpeedGet(gU32 physdev, adcsample_t *buffer) { NonTimerData ndata; // Prepare the job @@ -319,7 +319,7 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer) { gfxSemDestroy(&ndata.sigdone); } -gBool gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param) { +gBool gadcLowSpeedStart(gU32 physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param) { NonTimerData *pdata; /* Start the Low Speed Timer */ diff --git a/src/gadc/gadc.h b/src/gadc/gadc.h index d731f9ef..963be473 100644 --- a/src/gadc/gadc.h +++ b/src/gadc/gadc.h @@ -67,7 +67,7 @@ typedef struct GEventADC_t { /** * @brief The event flags */ - uint16_t flags; + gU16 flags; /** * @brief The event flag values. * @{ @@ -121,7 +121,7 @@ typedef void (*GADCISRCallbackFunction)(void); * * @api */ -void gadcHighSpeedInit(uint32_t physdev, uint32_t frequency); +void gadcHighSpeedInit(gU32 physdev, gU32 frequency); #if GFX_USE_GEVENT || defined(__DOXYGEN__) /** @@ -211,7 +211,7 @@ void gadcHighSpeedStop(void); * * @api */ -void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer); +void gadcLowSpeedGet(gU32 physdev, adcsample_t *buffer); /** * @brief Perform a low speed ADC conversion with callback (in a thread context) @@ -236,7 +236,7 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer); * * @api */ -gBool gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param); +gBool gadcLowSpeedStart(gU32 physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param); #endif /* GFX_USE_GADC */ diff --git a/src/gadc/gadc_driver.h b/src/gadc/gadc_driver.h index ba73aa15..886062c9 100644 --- a/src/gadc/gadc_driver.h +++ b/src/gadc/gadc_driver.h @@ -33,11 +33,11 @@ * @{ */ typedef struct GadcTimerJob_t { - uint32_t physdev; // @< The physical device/s. The exact meaning of physdev is hardware dependent. - uint32_t frequency; // @< The frequency to sample + gU32 physdev; // @< The physical device/s. The exact meaning of physdev is hardware dependent. + gU32 frequency; // @< The frequency to sample adcsample_t *buffer; // @< Where to put the samples - size_t todo; // @< How many conversions to do - size_t done; // @< How many conversions have already been done + gMemSize todo; // @< How many conversions to do + gMemSize done; // @< How many conversions have already been done } GadcTimerJob; /** @} */ @@ -46,7 +46,7 @@ typedef struct GadcTimerJob_t { * @{ */ typedef struct GadcNonTimerJob_t { - uint32_t physdev; // @< The physical device/s. The exact meaning of physdev is hardware dependent. + gU32 physdev; // @< The physical device/s. The exact meaning of physdev is hardware dependent. adcsample_t *buffer; // @< Where to put the samples. } GadcNonTimerJob; /** @} */ @@ -75,7 +75,7 @@ extern "C" { * It can be called in this mode on an ADC conversion error. Any job will then be * restarted by the high level code as appropriate. */ - void gadcGotDataI(size_t n); + void gadcGotDataI(gMemSize n); /** * @} */ @@ -96,7 +96,7 @@ void gadc_lld_init(void); * * @api */ -size_t gadc_lld_samplesperconversion(uint32_t physdev); +gMemSize gadc_lld_samplesperconversion(gU32 physdev); /** * @brief Start a periodic timer for high frequency conversions. @@ -108,7 +108,7 @@ size_t gadc_lld_samplesperconversion(uint32_t physdev); * @api * @iclass */ -void gadc_lld_start_timerI(uint32_t freq); +void gadc_lld_start_timerI(gU32 freq); /** * @brief Stop the periodic timer for high frequency conversions. diff --git a/src/gaudio/gaudio.c b/src/gaudio/gaudio.c index d5ee0eee..e20999e6 100644 --- a/src/gaudio/gaudio.c +++ b/src/gaudio/gaudio.c @@ -14,7 +14,7 @@ static gfxQueueASync playList; static gfxSem playComplete; - static uint16_t playFlags; + static gU16 playFlags; #define PLAYFLG_USEEVENTS 0x0001 #define PLAYFLG_PLAYING 0x0002 #define PLAYFLG_ISINIT 0x0004 @@ -28,7 +28,7 @@ #include "gaudio_driver_record.h" static gfxQueueGSync recordList; - static uint16_t recordFlags; + static gU16 recordFlags; #define RECORDFLG_USEEVENTS 0x0001 #define RECORDFLG_RECORDING 0x0002 #define RECORDFLG_STALLED 0x0004 @@ -76,7 +76,7 @@ void _gaudioDeinit(void) #if GAUDIO_NEED_PLAY - gBool gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + gBool gaudioPlayInit(gU16 channel, gU32 frequency, ArrayDataFormat format) { gaudioPlayStop(); playFlags &= ~PLAYFLG_ISINIT; if (!gaudio_play_lld_init(channel, frequency, format)) @@ -115,7 +115,7 @@ void _gaudioDeinit(void) gfxBufferRelease(pd); } - gBool gaudioPlaySetVolume(uint8_t vol) { + gBool gaudioPlaySetVolume(gU8 vol) { return gaudio_play_lld_set_volume(vol); } @@ -185,7 +185,7 @@ void _gaudioDeinit(void) #endif #if GAUDIO_NEED_RECORD - gBool gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + gBool gaudioRecordInit(gU16 channel, gU32 frequency, ArrayDataFormat format) { gaudioRecordStop(); recordFlags &= ~RECORDFLG_ISINIT; if (!gaudio_record_lld_init(channel, frequency, format)) diff --git a/src/gaudio/gaudio.h b/src/gaudio/gaudio.h index 4be67a99..f082234b 100644 --- a/src/gaudio/gaudio.h +++ b/src/gaudio/gaudio.h @@ -51,7 +51,7 @@ /** * @brief The event flags */ - uint16_t flags; + gU16 flags; /** * @brief The event flag values. * @{ @@ -75,7 +75,7 @@ /** * @brief The event flags */ - uint16_t flags; + gU16 flags; /** * @brief The event flag values. * @{ @@ -110,7 +110,7 @@ * * @api */ - gBool gaudioPlayInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); + gBool gaudioPlayInit(gU16 channel, gU32 frequency, ArrayDataFormat format); /** * @brief Play the specified sample data. @@ -164,7 +164,7 @@ * * @api */ - gBool gaudioPlaySetVolume(uint8_t vol); + gBool gaudioPlaySetVolume(gU8 vol); #if GFX_USE_GEVENT || defined(__DOXYGEN__) /** @@ -225,7 +225,7 @@ * * @api */ - gBool gaudioRecordInit(uint16_t channel, uint32_t frequency, ArrayDataFormat format); + gBool gaudioRecordInit(gU16 channel, gU32 frequency, ArrayDataFormat format); /** * @brief Start the audio recording. diff --git a/src/gaudio/gaudio_driver_play.h b/src/gaudio/gaudio_driver_play.h index 9ae26a7c..55342b45 100644 --- a/src/gaudio/gaudio_driver_play.h +++ b/src/gaudio/gaudio_driver_play.h @@ -81,7 +81,7 @@ void gaudioPlayDoneI(void); * * @api */ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format); /** * @brief Start the audio output playing @@ -117,7 +117,7 @@ void gaudio_play_lld_stop(void); * * @api */ -gBool gaudio_play_lld_set_volume(uint8_t vol); +gBool gaudio_play_lld_set_volume(gU8 vol); #ifdef __cplusplus } diff --git a/src/gaudio/gaudio_driver_record.h b/src/gaudio/gaudio_driver_record.h index 516f6aa1..dcba9bd1 100644 --- a/src/gaudio/gaudio_driver_record.h +++ b/src/gaudio/gaudio_driver_record.h @@ -81,7 +81,7 @@ extern "C" { * * @api */ -gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format); +gBool gaudio_record_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format); /** * @brief Start the audio recording diff --git a/src/gdisp/fonts/DejaVuSans10.c b/src/gdisp/fonts/DejaVuSans10.c index 604fcd02..f3abbae4 100644 --- a/src/gdisp/fonts/DejaVuSans10.c +++ b/src/gdisp/fonts/DejaVuSans10.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_DejaVuSans10_glyph_data_0[1222] = { +static const gU8 mf_bwfont_DejaVuSans10_glyph_data_0[1222] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xe8, 0x00, 0x3e, 0x00, 0x28, 0x00, 0xf8, 0x00, 0x2e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x94, 0x00, 0xfe, 0x01, 0xa4, 0x00, @@ -91,7 +91,7 @@ static const uint8_t mf_bwfont_DejaVuSans10_glyph_data_0[1222] = { 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, }; -static const uint16_t mf_bwfont_DejaVuSans10_glyph_offsets_0[96] = { +static const gU16 mf_bwfont_DejaVuSans10_glyph_offsets_0[96] = { 0x0000, 0x0000, 0x0004, 0x0009, 0x0012, 0x0019, 0x0023, 0x002c, 0x002f, 0x0033, 0x0037, 0x003d, 0x0046, 0x0049, 0x004e, 0x0051, 0x0055, 0x005c, 0x0063, 0x006a, 0x0071, 0x0078, 0x007f, 0x0086, @@ -106,7 +106,7 @@ static const uint16_t mf_bwfont_DejaVuSans10_glyph_offsets_0[96] = { 0x0238, 0x023f, 0x0246, 0x024c, 0x0252, 0x0255, 0x025b, 0x0263, }; -static const uint8_t mf_bwfont_DejaVuSans10_glyph_widths_0[95] = { +static const gU8 mf_bwfont_DejaVuSans10_glyph_widths_0[95] = { 0x03, 0x04, 0x05, 0x08, 0x06, 0x0a, 0x09, 0x03, 0x04, 0x04, 0x05, 0x08, 0x03, 0x04, 0x03, 0x03, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x03, 0x03, 0x08, 0x08, 0x08, 0x05, 0x0b, 0x07, 0x07, 0x08, 0x08, 0x07, 0x06, 0x08, 0x08, 0x03, 0x03, 0x07, 0x06, 0x09, 0x08, 0x08, diff --git a/src/gdisp/fonts/DejaVuSans12.c b/src/gdisp/fonts/DejaVuSans12.c index e9e16118..e7e39ac3 100644 --- a/src/gdisp/fonts/DejaVuSans12.c +++ b/src/gdisp/fonts/DejaVuSans12.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_DejaVuSans12_glyph_data_0[1372] = { +static const gU8 mf_bwfont_DejaVuSans12_glyph_data_0[1372] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x90, 0x02, 0xf0, 0x01, 0x9c, 0x00, 0x90, 0x03, 0xf8, 0x00, 0x94, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x24, 0x02, @@ -100,7 +100,7 @@ static const uint8_t mf_bwfont_DejaVuSans12_glyph_data_0[1372] = { 0x20, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x20, 0x00, }; -static const uint16_t mf_bwfont_DejaVuSans12_glyph_offsets_0[96] = { +static const gU16 mf_bwfont_DejaVuSans12_glyph_offsets_0[96] = { 0x0000, 0x0000, 0x0004, 0x0009, 0x0013, 0x001b, 0x0026, 0x0030, 0x0033, 0x0038, 0x003d, 0x0044, 0x004d, 0x0050, 0x0055, 0x0058, 0x005d, 0x0065, 0x006c, 0x0074, 0x007c, 0x0084, 0x008c, 0x0094, @@ -115,7 +115,7 @@ static const uint16_t mf_bwfont_DejaVuSans12_glyph_offsets_0[96] = { 0x027d, 0x0284, 0x028b, 0x0291, 0x0299, 0x029d, 0x02a4, 0x02ae, }; -static const uint8_t mf_bwfont_DejaVuSans12_glyph_widths_0[95] = { +static const gU8 mf_bwfont_DejaVuSans12_glyph_widths_0[95] = { 0x04, 0x05, 0x05, 0x0a, 0x08, 0x0b, 0x0a, 0x03, 0x05, 0x05, 0x06, 0x0a, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x0a, 0x0a, 0x0a, 0x06, 0x0d, 0x08, 0x08, 0x08, 0x09, 0x08, 0x07, 0x09, 0x09, 0x03, 0x03, 0x07, 0x06, 0x0a, 0x09, 0x09, diff --git a/src/gdisp/fonts/DejaVuSans12_aa.c b/src/gdisp/fonts/DejaVuSans12_aa.c index 3384b4e3..9f5021ea 100644 --- a/src/gdisp/fonts/DejaVuSans12_aa.c +++ b/src/gdisp/fonts/DejaVuSans12_aa.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans12_aa_dictionary_data[329] = { +static const gU8 mf_rlefont_DejaVuSans12_aa_dictionary_data[329] = { 0x27, 0x02, 0x0b, 0x80, 0x01, 0x80, 0x07, 0x80, 0x04, 0x80, 0x02, 0x80, 0x06, 0x04, 0x80, 0x02, 0x0e, 0xc9, 0xde, 0xc7, 0x0a, 0x06, 0x2a, 0x10, 0x84, 0x07, 0x80, 0x02, 0x80, 0x0c, 0x80, 0x0c, 0x0f, 0x80, 0x08, 0xcd, 0xc3, 0x86, 0x0d, 0x0c, 0xc2, 0xca, 0x29, 0xc8, 0xcb, 0xc4, 0xcc, 0xce, @@ -35,7 +35,7 @@ static const uint8_t mf_rlefont_DejaVuSans12_aa_dictionary_data[329] = { 0x45, 0x0f, 0x45, 0x0c, 0x08, 0x48, 0x08, 0x0c, 0x3f, }; -static const uint16_t mf_rlefont_DejaVuSans12_aa_dictionary_offsets[122] = { +static const gU16 mf_rlefont_DejaVuSans12_aa_dictionary_offsets[122] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0005, 0x000b, 0x000d, 0x000e, 0x0010, 0x0011, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001c, 0x0020, 0x0021, 0x0023, 0x0025, 0x0026, 0x0027, 0x0028, @@ -54,7 +54,7 @@ static const uint16_t mf_rlefont_DejaVuSans12_aa_dictionary_offsets[122] = { 0x0143, 0x0149, }; -static const uint8_t mf_rlefont_DejaVuSans12_aa_glyph_data_0[2069] = { +static const gU8 mf_rlefont_DejaVuSans12_aa_glyph_data_0[2069] = { 0x04, 0x00, 0x10, 0x05, 0x25, 0x8b, 0x0e, 0x2e, 0x0d, 0x20, 0x83, 0x0f, 0x10, 0x05, 0x1a, 0x94, 0x1d, 0x94, 0x6b, 0xac, 0x10, 0x0a, 0x29, 0x25, 0x0d, 0x01, 0x5d, 0x3f, 0x55, 0x0c, 0x00, 0x08, 0x06, 0x23, 0x05, 0xc3, 0x6b, 0x0a, 0x05, 0x49, 0x45, 0x0d, 0x01, 0x5d, 0x3f, 0x2c, 0x05, 0x23, @@ -187,7 +187,7 @@ static const uint8_t mf_rlefont_DejaVuSans12_aa_glyph_data_0[2069] = { 0x05, 0x70, 0x0c, 0x05, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans12_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans12_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000d, 0x0015, 0x0039, 0x005e, 0x008a, 0x00b7, 0x00bb, 0x00d2, 0x00ec, 0x0104, 0x010d, 0x0112, 0x0117, 0x011c, 0x0133, 0x0152, 0x015a, 0x0175, 0x0196, 0x01ad, 0x01c7, 0x01f1, diff --git a/src/gdisp/fonts/DejaVuSans16.c b/src/gdisp/fonts/DejaVuSans16.c index 375ec048..bfe62297 100644 --- a/src/gdisp/fonts/DejaVuSans16.c +++ b/src/gdisp/fonts/DejaVuSans16.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans16_dictionary_data[247] = { +static const gU8 mf_rlefont_DejaVuSans16_dictionary_data[247] = { 0x0f, 0x15, 0x83, 0x0a, 0x41, 0x2f, 0x06, 0x0a, 0x80, 0x01, 0x0b, 0x83, 0x01, 0x3d, 0x05, 0x80, 0x09, 0x80, 0x06, 0x80, 0x09, 0x80, 0x06, 0x80, 0x09, 0x80, 0x01, 0x05, 0x80, 0x03, 0x0a, 0x81, 0x0e, 0x80, 0x0d, 0x03, 0x80, 0x01, 0x0f, 0x80, 0x10, 0x80, 0x10, 0x80, 0x01, 0x09, 0x80, 0x01, @@ -30,7 +30,7 @@ static const uint8_t mf_rlefont_DejaVuSans16_dictionary_data[247] = { 0xc0, 0xc4, 0x2d, 0x2d, 0x23, 0xfc, 0x36, }; -static const uint16_t mf_rlefont_DejaVuSans16_dictionary_offsets[88] = { +static const gU16 mf_rlefont_DejaVuSans16_dictionary_offsets[88] = { 0x0000, 0x0001, 0x0002, 0x0004, 0x0006, 0x0007, 0x000a, 0x000d, 0x000e, 0x001b, 0x001e, 0x0020, 0x0023, 0x0026, 0x002d, 0x0030, 0x0031, 0x0037, 0x0038, 0x003b, 0x0040, 0x0042, 0x0046, 0x0049, @@ -44,7 +44,7 @@ static const uint16_t mf_rlefont_DejaVuSans16_dictionary_offsets[88] = { 0x00e6, 0x00e8, 0x00ea, 0x00ed, 0x00f0, 0x00f1, 0x00f4, 0x00f7, }; -static const uint8_t mf_rlefont_DejaVuSans16_glyph_data_0[1166] = { +static const gU8 mf_rlefont_DejaVuSans16_glyph_data_0[1166] = { 0x05, 0x00, 0x10, 0x06, 0x27, 0x43, 0x49, 0x18, 0x2f, 0x2b, 0x10, 0x06, 0x58, 0x55, 0x3d, 0x55, 0x10, 0x0d, 0xf4, 0x19, 0x41, 0x8d, 0x42, 0xfa, 0x5e, 0x29, 0xdd, 0x5e, 0x29, 0xdd, 0x10, 0x0a, 0x2f, 0x65, 0x2c, 0x1a, 0xfe, 0xa9, 0x1d, 0x55, 0xe0, 0x38, 0x8b, 0x4a, 0x36, 0xd6, 0x1d, 0xde, @@ -120,7 +120,7 @@ static const uint8_t mf_rlefont_DejaVuSans16_glyph_data_0[1166] = { 0x18, 0x8a, 0x4a, 0x49, 0x4c, 0x10, 0x0d, 0x00, 0x1f, 0x1f, 0x93, 0x68, 0x7c, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans16_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans16_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000b, 0x0011, 0x001f, 0x0034, 0x004f, 0x0064, 0x0068, 0x0074, 0x007f, 0x008d, 0x0097, 0x009c, 0x00a2, 0x00a6, 0x00b2, 0x00c0, 0x00ca, 0x00d9, 0x00e7, 0x00f8, 0x0106, 0x0116, diff --git a/src/gdisp/fonts/DejaVuSans16_aa.c b/src/gdisp/fonts/DejaVuSans16_aa.c index adcf9a37..63de43dc 100644 --- a/src/gdisp/fonts/DejaVuSans16_aa.c +++ b/src/gdisp/fonts/DejaVuSans16_aa.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans16_aa_dictionary_data[425] = { +static const gU8 mf_rlefont_DejaVuSans16_aa_dictionary_data[425] = { 0x02, 0x07, 0x05, 0x16, 0x0a, 0x80, 0x02, 0x09, 0x04, 0x11, 0x10, 0x0a, 0x08, 0x01, 0x80, 0x04, 0x80, 0x08, 0x80, 0x40, 0x08, 0x86, 0x14, 0x80, 0x01, 0x80, 0x11, 0x80, 0x11, 0x80, 0xc1, 0x80, 0xc3, 0xcb, 0xde, 0x88, 0x85, 0x80, 0x0e, 0x01, 0xc1, 0x07, 0xc7, 0xc9, 0x07, 0x80, 0x03, 0xca, @@ -41,7 +41,7 @@ static const uint8_t mf_rlefont_DejaVuSans16_aa_dictionary_data[425] = { 0x30, 0x47, 0x05, 0x66, 0x02, 0x65, 0x06, 0x02, 0x00, }; -static const uint16_t mf_rlefont_DejaVuSans16_aa_dictionary_offsets[140] = { +static const gU16 mf_rlefont_DejaVuSans16_aa_dictionary_offsets[140] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000f, 0x0011, 0x0013, 0x0015, 0x0016, 0x0017, 0x0019, 0x001e, 0x0020, 0x0023, 0x0024, 0x0025, @@ -62,7 +62,7 @@ static const uint16_t mf_rlefont_DejaVuSans16_aa_dictionary_offsets[140] = { 0x019a, 0x01a2, 0x01a7, 0x01a9, }; -static const uint8_t mf_rlefont_DejaVuSans16_aa_glyph_data_0[2853] = { +static const gU8 mf_rlefont_DejaVuSans16_aa_glyph_data_0[2853] = { 0x05, 0x00, 0x10, 0x06, 0x6a, 0x89, 0x1f, 0x0e, 0x1f, 0x0d, 0x82, 0x69, 0x61, 0x10, 0x06, 0x28, 0xed, 0x48, 0xa8, 0x48, 0xa8, 0x48, 0xa8, 0x10, 0x0d, 0x18, 0x69, 0x70, 0x00, 0x2b, 0x03, 0x48, 0x0d, 0x06, 0x00, 0x05, 0x0e, 0x48, 0x4a, 0xa2, 0x70, 0x22, 0x65, 0x2d, 0x88, 0x0a, 0x09, 0x65, @@ -244,7 +244,7 @@ static const uint8_t mf_rlefont_DejaVuSans16_aa_glyph_data_0[2853] = { 0x7c, 0x36, 0x19, 0x30, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans16_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans16_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000e, 0x0018, 0x004e, 0x007e, 0x00d1, 0x010e, 0x0111, 0x0136, 0x0158, 0x016f, 0x0179, 0x0183, 0x0188, 0x018e, 0x01ab, 0x01db, 0x01e8, 0x0210, 0x023c, 0x025c, 0x027b, 0x02b1, diff --git a/src/gdisp/fonts/DejaVuSans20.c b/src/gdisp/fonts/DejaVuSans20.c index cf9bd271..ccc36cb3 100644 --- a/src/gdisp/fonts/DejaVuSans20.c +++ b/src/gdisp/fonts/DejaVuSans20.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans20_dictionary_data[320] = { +static const gU8 mf_rlefont_DejaVuSans20_dictionary_data[320] = { 0x05, 0x0a, 0x81, 0x03, 0x17, 0x05, 0x81, 0x0b, 0x81, 0x84, 0x0b, 0x04, 0x83, 0x03, 0x82, 0x0b, 0x81, 0x02, 0x81, 0x02, 0x85, 0x12, 0x81, 0x0a, 0x80, 0x01, 0x80, 0x40, 0x18, 0x01, 0x87, 0x0b, 0x12, 0x81, 0x12, 0x81, 0x12, 0x81, 0x12, 0x81, 0x10, 0x04, 0x81, 0x1e, 0x11, 0x06, 0x81, 0x83, @@ -34,7 +34,7 @@ static const uint8_t mf_rlefont_DejaVuSans20_dictionary_data[320] = { 0xaa, 0x34, 0x1c, 0x34, 0x9c, 0x38, 0x20, 0x37, 0xba, 0x34, 0x28, 0x34, 0x3b, 0x34, 0x39, 0x40, }; -static const uint16_t mf_rlefont_DejaVuSans20_dictionary_offsets[110] = { +static const gU16 mf_rlefont_DejaVuSans20_dictionary_offsets[110] = { 0x0000, 0x0001, 0x0004, 0x0005, 0x0009, 0x000b, 0x000d, 0x000f, 0x0011, 0x0014, 0x0015, 0x0018, 0x001b, 0x001d, 0x0020, 0x0028, 0x0029, 0x002b, 0x002c, 0x002d, 0x002f, 0x0031, 0x0033, 0x0036, @@ -51,7 +51,7 @@ static const uint16_t mf_rlefont_DejaVuSans20_dictionary_offsets[110] = { 0x0135, 0x0137, 0x0139, 0x013b, 0x013e, 0x0140, }; -static const uint8_t mf_rlefont_DejaVuSans20_glyph_data_0[1558] = { +static const gU8 mf_rlefont_DejaVuSans20_glyph_data_0[1558] = { 0x06, 0x00, 0x10, 0x08, 0x1a, 0x83, 0x65, 0x22, 0x29, 0x70, 0x10, 0x0a, 0x3e, 0x80, 0x7b, 0xd0, 0x80, 0x7b, 0x5f, 0xfc, 0xb7, 0x10, 0x11, 0x1a, 0x5e, 0x5f, 0xea, 0x20, 0x1f, 0x8c, 0x38, 0xa6, 0x3d, 0x33, 0x6e, 0x33, 0x3e, 0xa7, 0x38, 0x5b, 0x38, 0xa6, 0x3d, 0x33, 0x6e, 0x33, 0x19, 0x3d, @@ -152,7 +152,7 @@ static const uint8_t mf_rlefont_DejaVuSans20_glyph_data_0[1558] = { 0x3f, 0x42, 0x93, 0x43, 0xc2, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans20_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans20_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000b, 0x0016, 0x0037, 0x0058, 0x0084, 0x00a7, 0x00aa, 0x00b7, 0x00c5, 0x00d9, 0x00e5, 0x00ed, 0x00f4, 0x00fa, 0x0104, 0x0114, 0x011f, 0x012f, 0x013d, 0x0155, 0x0165, 0x017d, diff --git a/src/gdisp/fonts/DejaVuSans20_aa.c b/src/gdisp/fonts/DejaVuSans20_aa.c index d05ab3b0..5297d319 100644 --- a/src/gdisp/fonts/DejaVuSans20_aa.c +++ b/src/gdisp/fonts/DejaVuSans20_aa.c @@ -10,7 +10,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans20_aa_dictionary_data[486] = { +static const gU8 mf_rlefont_DejaVuSans20_aa_dictionary_data[486] = { 0x05, 0x0b, 0x09, 0x81, 0x12, 0x81, 0x81, 0x05, 0x81, 0x0b, 0x0d, 0x17, 0x10, 0x28, 0x0b, 0x86, 0x12, 0x81, 0x12, 0x81, 0x08, 0x0e, 0x06, 0x84, 0x40, 0x1d, 0x80, 0xce, 0x8b, 0x08, 0x8b, 0x15, 0x80, 0xc3, 0x80, 0xcb, 0xca, 0x81, 0x12, 0x0a, 0x02, 0x81, 0xc7, 0x41, 0x3e, 0x01, 0xc9, 0x80, @@ -44,7 +44,7 @@ static const uint8_t mf_rlefont_DejaVuSans20_aa_dictionary_data[486] = { 0x0f, 0x60, 0x08, 0x4e, 0x0d, 0x28, }; -static const uint16_t mf_rlefont_DejaVuSans20_aa_dictionary_offsets[156] = { +static const gU16 mf_rlefont_DejaVuSans20_aa_dictionary_offsets[156] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0006, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x0010, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x001a, 0x001c, 0x001f, 0x0020, 0x0022, 0x0024, 0x0026, 0x0027, @@ -67,7 +67,7 @@ static const uint16_t mf_rlefont_DejaVuSans20_aa_dictionary_offsets[156] = { 0x01e0, 0x01e2, 0x01e4, 0x01e6, }; -static const uint8_t mf_rlefont_DejaVuSans20_aa_glyph_data_0[3979] = { +static const gU8 mf_rlefont_DejaVuSans20_aa_glyph_data_0[3979] = { 0x06, 0x00, 0x10, 0x08, 0x25, 0x22, 0x8a, 0x2e, 0x3d, 0x2e, 0x0d, 0x0d, 0x2e, 0x48, 0x20, 0x22, 0x10, 0x0a, 0x1e, 0xb7, 0x96, 0x96, 0x10, 0x11, 0x58, 0x50, 0x05, 0x6d, 0x30, 0x48, 0x1d, 0x09, 0xf5, 0x01, 0x6f, 0x1d, 0x0d, 0x0b, 0x30, 0x05, 0x6d, 0x37, 0x02, 0x0f, 0x07, 0x00, 0x33, 0x2f, @@ -319,7 +319,7 @@ static const uint8_t mf_rlefont_DejaVuSans20_aa_glyph_data_0[3979] = { 0x00, 0x01, 0x04, 0x08, 0x0c, 0x47, 0x55, 0x01, 0x25, 0x56, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans20_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans20_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x0011, 0x0017, 0x0066, 0x00ad, 0x0120, 0x017c, 0x017f, 0x01ac, 0x01db, 0x0207, 0x0210, 0x0219, 0x0222, 0x0227, 0x024f, 0x029c, 0x02af, 0x02e3, 0x031d, 0x034d, 0x0378, 0x03bb, diff --git a/src/gdisp/fonts/DejaVuSans24.c b/src/gdisp/fonts/DejaVuSans24.c index caabb080..224b6cfe 100644 --- a/src/gdisp/fonts/DejaVuSans24.c +++ b/src/gdisp/fonts/DejaVuSans24.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans24_dictionary_data[395] = { +static const gU8 mf_rlefont_DejaVuSans24_dictionary_data[395] = { 0x80, 0x0a, 0x80, 0x3d, 0x81, 0x02, 0x81, 0x81, 0x09, 0x81, 0x0c, 0x81, 0x09, 0x81, 0x0c, 0x81, 0x09, 0x81, 0x08, 0x16, 0x81, 0x01, 0x82, 0x0e, 0x84, 0x01, 0x07, 0x87, 0x01, 0x86, 0x0d, 0x85, 0x80, 0x0c, 0x83, 0x0f, 0x89, 0x0f, 0x82, 0x07, 0x0b, 0x81, 0x09, 0x81, 0x0c, 0x13, 0x81, 0x16, @@ -39,7 +39,7 @@ static const uint8_t mf_rlefont_DejaVuSans24_dictionary_data[395] = { 0xc2, 0x90, 0x3b, 0x3a, 0x2a, 0xf0, 0x2d, 0x34, 0x3d, 0xf0, 0x54, }; -static const uint16_t mf_rlefont_DejaVuSans24_dictionary_offsets[119] = { +static const gU16 mf_rlefont_DejaVuSans24_dictionary_offsets[119] = { 0x0000, 0x0003, 0x0004, 0x0007, 0x0013, 0x0016, 0x0018, 0x001a, 0x001b, 0x001d, 0x001f, 0x0020, 0x0022, 0x0026, 0x0028, 0x002d, 0x002f, 0x0031, 0x0032, 0x0035, 0x0037, 0x003a, 0x003d, 0x0043, @@ -57,7 +57,7 @@ static const uint16_t mf_rlefont_DejaVuSans24_dictionary_offsets[119] = { 0x0172, 0x0173, 0x0178, 0x017e, 0x0184, 0x0189, 0x018b, }; -static const uint8_t mf_rlefont_DejaVuSans24_glyph_data_0[1873] = { +static const gU8 mf_rlefont_DejaVuSans24_glyph_data_0[1873] = { 0x08, 0x00, 0x10, 0x0a, 0x00, 0x4a, 0x47, 0x5d, 0x56, 0x19, 0x74, 0x10, 0x0b, 0x4c, 0x1a, 0x64, 0xfc, 0x1a, 0x64, 0xfc, 0x1a, 0x10, 0x14, 0xc4, 0x4e, 0xc7, 0xc6, 0x82, 0x8d, 0xc7, 0xc7, 0x82, 0x8d, 0xc5, 0xc7, 0x2b, 0x4b, 0x2c, 0x4b, 0xe7, 0x4a, 0x77, 0x8d, 0x4f, 0x3c, 0x2b, 0xa5, 0x4a, @@ -178,7 +178,7 @@ static const uint8_t mf_rlefont_DejaVuSans24_glyph_data_0[1873] = { 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans24_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans24_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000c, 0x0016, 0x0043, 0x006c, 0x00a8, 0x00cf, 0x00d3, 0x00e0, 0x00ec, 0x0101, 0x010f, 0x0114, 0x011d, 0x0121, 0x0130, 0x014a, 0x0157, 0x016d, 0x0186, 0x01a5, 0x01bb, 0x01dd, diff --git a/src/gdisp/fonts/DejaVuSans24_aa.c b/src/gdisp/fonts/DejaVuSans24_aa.c index 9afd72c9..8a3d235b 100644 --- a/src/gdisp/fonts/DejaVuSans24_aa.c +++ b/src/gdisp/fonts/DejaVuSans24_aa.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans24_aa_dictionary_data[596] = { +static const gU8 mf_rlefont_DejaVuSans24_aa_dictionary_data[596] = { 0x20, 0x0f, 0x04, 0x81, 0x05, 0x1e, 0x11, 0x0c, 0x81, 0x01, 0x81, 0x0e, 0x81, 0x07, 0x81, 0x0e, 0x10, 0xc8, 0x80, 0xce, 0xc5, 0xd1, 0x04, 0x0b, 0x84, 0x09, 0x17, 0x81, 0x17, 0x81, 0x06, 0x88, 0x0e, 0x15, 0x12, 0x0a, 0x17, 0x81, 0x02, 0x09, 0x81, 0xce, 0x85, 0x0c, 0x83, 0x85, 0x06, 0xc2, @@ -52,7 +52,7 @@ static const uint8_t mf_rlefont_DejaVuSans24_aa_dictionary_data[596] = { 0x38, 0x30, 0x0d, 0x65, }; -static const uint16_t mf_rlefont_DejaVuSans24_aa_dictionary_offsets[170] = { +static const gU16 mf_rlefont_DejaVuSans24_aa_dictionary_offsets[170] = { 0x0000, 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0007, 0x0009, 0x0010, 0x0011, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001e, 0x001f, 0x0021, 0x0022, 0x0023, 0x0024, 0x0026, 0x0027, 0x0029, @@ -77,7 +77,7 @@ static const uint16_t mf_rlefont_DejaVuSans24_aa_dictionary_offsets[170] = { 0x0252, 0x0254, }; -static const uint8_t mf_rlefont_DejaVuSans24_aa_glyph_data_0[4800] = { +static const gU8 mf_rlefont_DejaVuSans24_aa_glyph_data_0[4800] = { 0x08, 0x00, 0x10, 0x0a, 0x2d, 0x4c, 0xae, 0x7e, 0x5c, 0x7e, 0x8a, 0x7e, 0x0d, 0x0d, 0x7e, 0x0c, 0x0c, 0x7f, 0x81, 0x98, 0x10, 0x0b, 0x4c, 0x50, 0x7f, 0x93, 0x93, 0x93, 0x10, 0x14, 0x3a, 0x18, 0x52, 0x54, 0x53, 0x1d, 0x36, 0x01, 0x2d, 0x09, 0x55, 0x1d, 0x4a, 0x3a, 0x6c, 0x44, 0xb3, 0x85, @@ -380,7 +380,7 @@ static const uint8_t mf_rlefont_DejaVuSans24_aa_glyph_data_0[4800] = { 0x58, 0x2b, 0x39, 0x05, 0x01, 0x60, 0x0a, 0xc3, 0x46, 0x2b, 0x07, 0x27, 0x8e, 0x4a, 0x8d, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans24_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans24_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x0015, 0x001d, 0x0077, 0x00d4, 0x0174, 0x01dd, 0x01e1, 0x021d, 0x0251, 0x0282, 0x028f, 0x0299, 0x02a2, 0x02a7, 0x02de, 0x0337, 0x034b, 0x0389, 0x03d2, 0x040b, 0x0440, 0x049d, diff --git a/src/gdisp/fonts/DejaVuSans32.c b/src/gdisp/fonts/DejaVuSans32.c index ca669582..b63d201f 100644 --- a/src/gdisp/fonts/DejaVuSans32.c +++ b/src/gdisp/fonts/DejaVuSans32.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans32_dictionary_data[578] = { +static const gU8 mf_rlefont_DejaVuSans32_dictionary_data[578] = { 0x06, 0x83, 0x1e, 0x82, 0x03, 0x0c, 0x80, 0x09, 0x8b, 0x84, 0x0e, 0x80, 0x82, 0x0c, 0x80, 0x05, 0x83, 0x16, 0x83, 0x93, 0x0d, 0x87, 0x83, 0x11, 0x81, 0x1c, 0x87, 0x17, 0x80, 0x01, 0x1e, 0x82, 0x1e, 0x82, 0x1b, 0x81, 0x07, 0x82, 0x06, 0x06, 0x82, 0x03, 0x0b, 0x82, 0x08, 0x03, 0x82, 0x85, @@ -51,7 +51,7 @@ static const uint8_t mf_rlefont_DejaVuSans32_dictionary_data[578] = { 0xd2, 0x5e, }; -static const uint16_t mf_rlefont_DejaVuSans32_dictionary_offsets[141] = { +static const gU16 mf_rlefont_DejaVuSans32_dictionary_offsets[141] = { 0x0000, 0x0002, 0x0005, 0x0007, 0x0008, 0x0009, 0x000a, 0x000c, 0x000f, 0x0011, 0x0013, 0x0016, 0x0017, 0x0019, 0x001a, 0x001e, 0x0022, 0x0024, 0x0027, 0x002a, 0x002d, 0x002f, 0x0031, 0x0034, @@ -72,7 +72,7 @@ static const uint16_t mf_rlefont_DejaVuSans32_dictionary_offsets[141] = { 0x0233, 0x0239, 0x023b, 0x023f, 0x0242, }; -static const uint8_t mf_rlefont_DejaVuSans32_glyph_data_0[2504] = { +static const gU8 mf_rlefont_DejaVuSans32_glyph_data_0[2504] = { 0x0a, 0x00, 0x10, 0x0d, 0x6e, 0x6c, 0x80, 0x6f, 0x25, 0x6e, 0x8b, 0x10, 0x0f, 0x6e, 0x68, 0x2c, 0x7e, 0x7e, 0x7e, 0x7e, 0x10, 0x1b, 0x67, 0x6e, 0x52, 0x58, 0x5e, 0x74, 0xc7, 0x4f, 0x9d, 0x2c, 0x8c, 0x5a, 0x24, 0x9d, 0x2c, 0x9d, 0x2c, 0x8c, 0x5a, 0x24, 0x9d, 0xb4, 0x9d, 0xdc, 0xa5, 0xc7, @@ -232,7 +232,7 @@ static const uint8_t mf_rlefont_DejaVuSans32_glyph_data_0[2504] = { 0x36, 0x3d, 0xf0, 0x4b, 0x1e, 0x3b, 0xff, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans32_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans32_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000c, 0x0015, 0x0038, 0x0077, 0x00c9, 0x0105, 0x0109, 0x011f, 0x0135, 0x0156, 0x0165, 0x016f, 0x0179, 0x017f, 0x0196, 0x01b7, 0x01c8, 0x01dc, 0x01f8, 0x0225, 0x023e, 0x026b, diff --git a/src/gdisp/fonts/DejaVuSans32_aa.c b/src/gdisp/fonts/DejaVuSans32_aa.c index 8b8f6e8d..78f56141 100644 --- a/src/gdisp/fonts/DejaVuSans32_aa.c +++ b/src/gdisp/fonts/DejaVuSans32_aa.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSans32_aa_dictionary_data[740] = { +static const gU8 mf_rlefont_DejaVuSans32_aa_dictionary_data[740] = { 0x86, 0x1a, 0x86, 0x1a, 0x85, 0x1e, 0x82, 0x1e, 0x81, 0x12, 0x82, 0x08, 0x1a, 0x1d, 0x05, 0x85, 0x13, 0x1c, 0x88, 0x0f, 0x81, 0xcb, 0x0a, 0x82, 0x0f, 0x80, 0x1e, 0x82, 0x1e, 0x82, 0x83, 0x08, 0x0c, 0xce, 0x1d, 0x0d, 0x40, 0x07, 0x8d, 0x13, 0xc9, 0x85, 0x1e, 0x82, 0x15, 0x17, 0x8c, 0x01, @@ -61,7 +61,7 @@ static const uint8_t mf_rlefont_DejaVuSans32_aa_dictionary_data[740] = { 0x3b, 0x2a, 0x0c, 0x1c, }; -static const uint16_t mf_rlefont_DejaVuSans32_aa_dictionary_offsets[188] = { +static const gU16 mf_rlefont_DejaVuSans32_aa_dictionary_offsets[188] = { 0x0000, 0x0005, 0x0009, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0014, 0x0016, 0x0019, 0x001e, 0x001f, 0x0020, 0x0021, 0x0023, 0x0024, 0x0026, 0x0028, 0x002a, 0x002c, 0x002d, @@ -88,7 +88,7 @@ static const uint16_t mf_rlefont_DejaVuSans32_aa_dictionary_offsets[188] = { 0x02de, 0x02e0, 0x02e2, 0x02e4, }; -static const uint8_t mf_rlefont_DejaVuSans32_aa_glyph_data_0[6702] = { +static const gU8 mf_rlefont_DejaVuSans32_aa_glyph_data_0[6702] = { 0x0a, 0x00, 0x10, 0x0d, 0x82, 0xe0, 0x3b, 0xac, 0x3b, 0x53, 0x28, 0x78, 0x0f, 0x28, 0x78, 0x52, 0x3b, 0x0c, 0x38, 0x3b, 0x0b, 0x88, 0x20, 0x82, 0xc1, 0x10, 0x0f, 0x82, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0x10, 0x1b, 0x76, 0x82, 0x81, 0x4f, 0x3d, 0x0e, 0x93, 0x9f, 0xc6, @@ -510,7 +510,7 @@ static const uint8_t mf_rlefont_DejaVuSans32_aa_glyph_data_0[6702] = { 0x01, 0x29, 0x0e, 0x06, 0x26, 0x04, 0x09, 0x0c, 0x90, 0x45, 0x03, 0x6b, 0x8f, 0x10, }; -static const uint16_t mf_rlefont_DejaVuSans32_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSans32_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x001a, 0x0026, 0x00a6, 0x0132, 0x020e, 0x02a9, 0x02ad, 0x0301, 0x0353, 0x039e, 0x03ad, 0x03b9, 0x03c3, 0x03cb, 0x0416, 0x0497, 0x04b2, 0x0511, 0x0571, 0x05c3, 0x060c, 0x0698, diff --git a/src/gdisp/fonts/DejaVuSansBold12.c b/src/gdisp/fonts/DejaVuSansBold12.c index b2581760..f3fe8701 100644 --- a/src/gdisp/fonts/DejaVuSansBold12.c +++ b/src/gdisp/fonts/DejaVuSansBold12.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_DejaVuSansBold12_glyph_data_0[1540] = { +static const gU8 mf_bwfont_DejaVuSansBold12_glyph_data_0[1540] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x03, 0x7e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xc8, 0x03, 0xf8, 0x01, 0x4e, 0x00, 0xc8, 0x03, 0x7c, 0x00, 0x4e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x02, 0x7c, 0x02, @@ -111,7 +111,7 @@ static const uint8_t mf_bwfont_DejaVuSansBold12_glyph_data_0[1540] = { 0x40, 0x00, 0x20, 0x00, }; -static const uint16_t mf_bwfont_DejaVuSansBold12_glyph_offsets_0[96] = { +static const gU16 mf_bwfont_DejaVuSansBold12_glyph_offsets_0[96] = { 0x0000, 0x0000, 0x0005, 0x000a, 0x0014, 0x001d, 0x002a, 0x0035, 0x0038, 0x003e, 0x0043, 0x004a, 0x0053, 0x0057, 0x005d, 0x0061, 0x0066, 0x006f, 0x0077, 0x0080, 0x0089, 0x0092, 0x009b, 0x00a4, @@ -126,7 +126,7 @@ static const uint16_t mf_bwfont_DejaVuSansBold12_glyph_offsets_0[96] = { 0x02cc, 0x02d4, 0x02dc, 0x02e4, 0x02ec, 0x02f0, 0x02f8, 0x0302, }; -static const uint8_t mf_bwfont_DejaVuSansBold12_glyph_widths_0[95] = { +static const gU8 mf_bwfont_DejaVuSansBold12_glyph_widths_0[95] = { 0x04, 0x05, 0x06, 0x0a, 0x08, 0x0c, 0x0a, 0x04, 0x05, 0x05, 0x06, 0x0a, 0x05, 0x05, 0x05, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x05, 0x05, 0x0a, 0x0a, 0x0a, 0x07, 0x0c, 0x09, 0x09, 0x09, 0x0a, 0x08, 0x08, 0x0a, 0x0a, 0x04, 0x04, 0x09, 0x08, 0x0c, 0x0a, 0x0b, diff --git a/src/gdisp/fonts/DejaVuSansBold12_aa.c b/src/gdisp/fonts/DejaVuSansBold12_aa.c index bab54f58..798444a0 100644 --- a/src/gdisp/fonts/DejaVuSansBold12_aa.c +++ b/src/gdisp/fonts/DejaVuSansBold12_aa.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_DejaVuSansBold12_aa_dictionary_data[295] = { +static const gU8 mf_rlefont_DejaVuSansBold12_aa_dictionary_data[295] = { 0x09, 0x06, 0xce, 0x80, 0xc2, 0x02, 0x11, 0x80, 0xc5, 0x07, 0x0a, 0x03, 0x0b, 0x02, 0x01, 0xc2, 0x06, 0x81, 0x81, 0x0c, 0x81, 0x86, 0x04, 0x81, 0x2c, 0x83, 0x05, 0x2b, 0x80, 0xc3, 0x80, 0xcb, 0x0f, 0x40, 0x07, 0xce, 0xcb, 0x80, 0xc6, 0x0c, 0xd9, 0x0c, 0x01, 0xca, 0x84, 0x1a, 0xc5, 0xc1, @@ -33,7 +33,7 @@ static const uint8_t mf_rlefont_DejaVuSansBold12_aa_dictionary_data[295] = { 0x36, 0x0b, 0x1c, 0x0d, 0x63, 0x0a, 0x49, }; -static const uint16_t mf_rlefont_DejaVuSansBold12_aa_dictionary_offsets[115] = { +static const gU16 mf_rlefont_DejaVuSansBold12_aa_dictionary_offsets[115] = { 0x0000, 0x0001, 0x0002, 0x0006, 0x0007, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x0010, 0x0012, 0x0015, 0x0016, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001e, 0x0020, 0x0021, 0x0023, @@ -51,7 +51,7 @@ static const uint16_t mf_rlefont_DejaVuSansBold12_aa_dictionary_offsets[115] = { 0x0123, 0x0125, 0x0127, }; -static const uint8_t mf_rlefont_DejaVuSansBold12_aa_glyph_data_0[2289] = { +static const gU8 mf_rlefont_DejaVuSansBold12_aa_glyph_data_0[2289] = { 0x04, 0x00, 0x10, 0x05, 0x1b, 0x6d, 0x50, 0x0d, 0x0d, 0x50, 0x0c, 0x0c, 0x34, 0x24, 0x10, 0x06, 0x2d, 0xee, 0x52, 0xac, 0x52, 0xac, 0x10, 0x0a, 0x52, 0x82, 0x4a, 0x06, 0x0d, 0x18, 0x46, 0x32, 0x09, 0x19, 0x51, 0x56, 0x69, 0x3f, 0x01, 0x1d, 0x74, 0x4a, 0x06, 0x0d, 0x52, 0xc3, 0x1c, 0x1d, @@ -198,7 +198,7 @@ static const uint8_t mf_rlefont_DejaVuSansBold12_aa_glyph_data_0[2289] = { 0x10, }; -static const uint16_t mf_rlefont_DejaVuSansBold12_aa_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_DejaVuSansBold12_aa_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x000f, 0x0017, 0x003e, 0x0064, 0x00a2, 0x00d5, 0x00d9, 0x00f5, 0x0113, 0x0129, 0x0132, 0x0136, 0x013d, 0x0142, 0x0158, 0x017b, 0x0184, 0x01a5, 0x01cd, 0x01eb, 0x0201, 0x0227, diff --git a/src/gdisp/fonts/LargeNumbers.c b/src/gdisp/fonts/LargeNumbers.c index 08517248..d2251524 100644 --- a/src/gdisp/fonts/LargeNumbers.c +++ b/src/gdisp/fonts/LargeNumbers.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_LargeNumbers_dictionary_data[141] = { +static const gU8 mf_rlefont_LargeNumbers_dictionary_data[141] = { 0x82, 0x11, 0x85, 0x11, 0x82, 0x0f, 0x10, 0x82, 0x02, 0x82, 0x10, 0x82, 0x02, 0x82, 0x16, 0x0d, 0x04, 0x15, 0x81, 0x8c, 0x0b, 0x8c, 0x03, 0x86, 0x11, 0x86, 0x80, 0x14, 0x82, 0x84, 0x0a, 0x1a, 0x82, 0x08, 0x03, 0x81, 0x89, 0x80, 0x0c, 0x44, 0x10, 0x09, 0x82, 0x81, 0x13, 0x83, 0x13, 0x84, @@ -23,7 +23,7 @@ static const uint8_t mf_rlefont_LargeNumbers_dictionary_data[141] = { 0x3c, 0x65, 0x39, 0x23, 0x23, 0x00, 0x2e, 0x25, 0x2c, 0x3d, 0x2a, 0x23, 0x0f, }; -static const uint16_t mf_rlefont_LargeNumbers_dictionary_offsets[55] = { +static const gU16 mf_rlefont_LargeNumbers_dictionary_offsets[55] = { 0x0000, 0x0005, 0x0006, 0x000c, 0x000e, 0x000f, 0x0010, 0x0011, 0x0013, 0x0016, 0x0018, 0x001a, 0x001d, 0x001e, 0x001f, 0x0021, 0x0022, 0x0024, 0x0025, 0x0027, 0x0029, 0x002b, 0x003a, 0x003c, @@ -33,7 +33,7 @@ static const uint16_t mf_rlefont_LargeNumbers_dictionary_offsets[55] = { 0x0080, 0x0082, 0x0085, 0x0087, 0x0089, 0x008b, 0x008d, }; -static const uint8_t mf_rlefont_LargeNumbers_glyph_data_0[630] = { +static const gU8 mf_rlefont_LargeNumbers_glyph_data_0[630] = { 0x08, 0x00, 0x10, 0x0b, 0x00, 0x26, 0x45, 0x49, 0x45, 0x3b, 0x7c, 0x49, 0x0f, 0x10, 0x0d, 0x26, 0x1b, 0x1a, 0x1b, 0x1a, 0x1b, 0x1a, 0x1b, 0x10, 0x14, 0x37, 0x1f, 0x75, 0x19, 0x40, 0x42, 0x37, 0x34, 0x29, 0x27, 0xd4, 0x75, 0x19, 0x40, 0xec, 0x2a, 0x34, 0x29, 0x37, 0x40, 0x42, 0x10, 0x11, @@ -76,7 +76,7 @@ static const uint8_t mf_rlefont_LargeNumbers_glyph_data_0[630] = { 0x37, 0x47, 0x3f, 0x3e, 0x21, 0x10, }; -static const uint16_t mf_rlefont_LargeNumbers_glyph_offsets_0[26] = { +static const gU16 mf_rlefont_LargeNumbers_glyph_offsets_0[26] = { 0x0000, 0x0003, 0x000e, 0x0018, 0x002f, 0x0065, 0x00a5, 0x00d5, 0x00db, 0x00eb, 0x00fb, 0x0114, 0x0125, 0x012d, 0x0136, 0x013b, 0x014c, 0x016a, 0x0180, 0x0199, 0x01b7, 0x01dc, 0x01f5, 0x021b, diff --git a/src/gdisp/fonts/UI1.c b/src/gdisp/fonts/UI1.c index c61c0f4f..05af02d8 100644 --- a/src/gdisp/fonts/UI1.c +++ b/src/gdisp/fonts/UI1.c @@ -26,7 +26,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_UI1_dictionary_data[283] = { +static const gU8 mf_rlefont_UI1_dictionary_data[283] = { 0x03, 0x80, 0x05, 0x84, 0x04, 0x03, 0x82, 0x08, 0x07, 0x81, 0x24, 0x0b, 0x05, 0x80, 0x02, 0x02, 0x81, 0x80, 0x0f, 0x83, 0x06, 0x01, 0x80, 0x05, 0x80, 0x03, 0x37, 0x22, 0x03, 0x83, 0x20, 0x06, 0x80, 0x01, 0x80, 0x85, 0x04, 0x80, 0x01, 0x80, 0x06, 0x12, 0x05, 0x82, 0x07, 0x80, 0x07, 0x15, @@ -47,7 +47,7 @@ static const uint8_t mf_rlefont_UI1_dictionary_data[283] = { 0x26, 0x37, 0x2f, 0x3e, 0xec, 0x86, 0x00, 0x85, 0x88, 0x27, 0x86, }; -static const uint16_t mf_rlefont_UI1_dictionary_offsets[108] = { +static const gU16 mf_rlefont_UI1_dictionary_offsets[108] = { 0x0000, 0x0003, 0x0005, 0x0008, 0x000a, 0x000b, 0x000c, 0x000f, 0x0011, 0x0013, 0x0015, 0x001a, 0x001b, 0x001c, 0x001e, 0x001f, 0x0020, 0x0023, 0x0024, 0x0029, 0x002a, 0x002c, 0x002f, 0x0030, @@ -64,15 +64,15 @@ static const uint16_t mf_rlefont_UI1_dictionary_offsets[108] = { 0x0114, 0x0116, 0x0118, 0x011b, }; -static const uint8_t mf_rlefont_UI1_glyph_data_0[3] = { +static const gU8 mf_rlefont_UI1_glyph_data_0[3] = { 0x03, 0x00, 0x10, }; -static const uint16_t mf_rlefont_UI1_glyph_offsets_0[1] = { +static const gU16 mf_rlefont_UI1_glyph_offsets_0[1] = { 0x0000, }; -static const uint8_t mf_rlefont_UI1_glyph_data_1[786] = { +static const gU8 mf_rlefont_UI1_glyph_data_1[786] = { 0x03, 0x00, 0x10, 0x03, 0x56, 0x50, 0x34, 0x32, 0x10, 0x05, 0xfd, 0x5e, 0xee, 0x10, 0x08, 0xc4, 0x44, 0x5e, 0x19, 0x80, 0xac, 0x1b, 0x8b, 0x2a, 0xd8, 0x10, 0x07, 0x35, 0x66, 0x64, 0x35, 0x57, 0x8a, 0x48, 0x88, 0x76, 0x0f, 0x10, 0x0b, 0x2f, 0xd4, 0x8c, 0x8d, 0xa8, 0x81, 0x9a, 0x32, 0x8a, @@ -125,7 +125,7 @@ static const uint8_t mf_rlefont_UI1_glyph_data_1[786] = { 0x1b, 0x10, }; -static const uint16_t mf_rlefont_UI1_glyph_offsets_1[100] = { +static const gU16 mf_rlefont_UI1_glyph_offsets_1[100] = { 0x0000, 0x0003, 0x0009, 0x000e, 0x001a, 0x0026, 0x0036, 0x0045, 0x0048, 0x004f, 0x0056, 0x005e, 0x0066, 0x006c, 0x0070, 0x0075, 0x007c, 0x0088, 0x0090, 0x0098, 0x00a1, 0x00ac, 0x00b5, 0x00bc, @@ -141,7 +141,7 @@ static const uint16_t mf_rlefont_UI1_glyph_offsets_1[100] = { 0x02ff, 0x02fe, 0x02fe, 0x030a, }; -static const uint8_t mf_rlefont_UI1_glyph_data_2[786] = { +static const gU8 mf_rlefont_UI1_glyph_data_2[786] = { 0x06, 0x26, 0xf8, 0x66, 0x21, 0xa2, 0x1b, 0x10, 0x08, 0x23, 0x29, 0x10, 0x0c, 0x23, 0x43, 0x83, 0x10, 0x00, 0x0b, 0x7d, 0x37, 0xdd, 0x8a, 0xad, 0x7a, 0xae, 0x10, 0x03, 0x1d, 0x47, 0x5f, 0x10, 0x06, 0x34, 0x8c, 0x1b, 0x6e, 0xfd, 0x78, 0x70, 0xd0, 0x32, 0x10, 0x07, 0x00, 0x2f, 0x6e, 0x3e, @@ -194,7 +194,7 @@ static const uint8_t mf_rlefont_UI1_glyph_data_2[786] = { 0x82, 0x10, }; -static const uint16_t mf_rlefont_UI1_glyph_offsets_2[107] = { +static const gU16 mf_rlefont_UI1_glyph_offsets_2[107] = { 0x0000, 0x0008, 0x000c, 0x0011, 0x0012, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001b, 0x0020, 0x002b, 0x0035, 0x0041, 0x004c, 0x0053, 0x0060, 0x0064, 0x0073, 0x007d, 0x0086, diff --git a/src/gdisp/fonts/UI2.c b/src/gdisp/fonts/UI2.c index b1f368c2..6bee68ec 100644 --- a/src/gdisp/fonts/UI2.c +++ b/src/gdisp/fonts/UI2.c @@ -26,7 +26,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_rlefont_UI2_dictionary_data[159] = { +static const gU8 mf_rlefont_UI2_dictionary_data[159] = { 0x2c, 0x80, 0x06, 0x80, 0x03, 0x80, 0x06, 0x80, 0x03, 0x80, 0x01, 0x01, 0x80, 0x06, 0x80, 0x80, 0x0a, 0x80, 0x06, 0x21, 0x82, 0x01, 0x80, 0x07, 0x03, 0x80, 0x01, 0x80, 0x05, 0x02, 0x80, 0x07, 0x80, 0x0a, 0x80, 0x0a, 0x0b, 0x80, 0x01, 0x80, 0x05, 0x80, 0x02, 0x04, 0x80, 0x02, 0x09, 0x01, @@ -39,7 +39,7 @@ static const uint8_t mf_rlefont_UI2_dictionary_data[159] = { 0xc6, 0xa9, 0x25, 0x2e, 0x1e, 0xd6, 0x29, 0x1e, 0x25, 0x28, 0x1b, 0x1f, 0x22, 0x1b, 0x74, }; -static const uint16_t mf_rlefont_UI2_dictionary_offsets[62] = { +static const gU16 mf_rlefont_UI2_dictionary_offsets[62] = { 0x0000, 0x0001, 0x000b, 0x000f, 0x0013, 0x0014, 0x0015, 0x0018, 0x001c, 0x001d, 0x001f, 0x0021, 0x0024, 0x0025, 0x0028, 0x002b, 0x002e, 0x002f, 0x0031, 0x0032, 0x0034, 0x0035, 0x0038, 0x003a, @@ -50,7 +50,7 @@ static const uint16_t mf_rlefont_UI2_dictionary_offsets[62] = { 0x0092, 0x0095, 0x0096, 0x0098, 0x009d, 0x009f, }; -static const uint8_t mf_rlefont_UI2_glyph_data_0[822] = { +static const gU8 mf_rlefont_UI2_glyph_data_0[822] = { 0x03, 0x00, 0x10, 0x03, 0x46, 0x39, 0x4e, 0x10, 0x05, 0x50, 0xee, 0x10, 0x08, 0xfc, 0x24, 0x50, 0xe3, 0x22, 0x86, 0x1f, 0x22, 0x38, 0x50, 0x10, 0x07, 0xfc, 0x1e, 0x92, 0x48, 0x28, 0xd0, 0x23, 0x86, 0x88, 0x41, 0x2e, 0x10, 0x0b, 0x28, 0xdc, 0x94, 0xa8, 0x88, 0x96, 0x85, 0x9a, 0x28, 0x91, @@ -105,7 +105,7 @@ static const uint8_t mf_rlefont_UI2_glyph_data_0[822] = { 0x07, 0x2c, 0x2e, 0x89, 0x6c, 0x10, }; -static const uint16_t mf_rlefont_UI2_glyph_offsets_0[95] = { +static const gU16 mf_rlefont_UI2_glyph_offsets_0[95] = { 0x0000, 0x0003, 0x0008, 0x000c, 0x0018, 0x0025, 0x0036, 0x0045, 0x0048, 0x004e, 0x0054, 0x005e, 0x0067, 0x006c, 0x0070, 0x0075, 0x007e, 0x008c, 0x0095, 0x009e, 0x00a8, 0x00b4, 0x00be, 0x00c5, diff --git a/src/gdisp/fonts/fixed_10x20.c b/src/gdisp/fonts/fixed_10x20.c index 6c6fc416..daff69ff 100644 --- a/src/gdisp/fonts/fixed_10x20.c +++ b/src/gdisp/fonts/fixed_10x20.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_fixed_10x20_glyph_data_0[2193] = { +static const gU8 mf_bwfont_fixed_10x20_glyph_data_0[2193] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1b, 0x00, 0xff, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x0f, 0x00, 0xf0, 0x0f, 0x00, 0xfe, 0x01, 0x00, @@ -152,7 +152,7 @@ static const uint8_t mf_bwfont_fixed_10x20_glyph_data_0[2193] = { 0x00, }; -static const uint16_t mf_bwfont_fixed_10x20_glyph_offsets_0[96] = { +static const gU16 mf_bwfont_fixed_10x20_glyph_offsets_0[96] = { 0x0000, 0x0000, 0x0005, 0x000c, 0x0015, 0x001d, 0x0026, 0x002f, 0x0034, 0x003b, 0x0041, 0x0049, 0x0051, 0x0057, 0x005f, 0x0065, 0x006d, 0x0075, 0x007d, 0x0085, 0x008d, 0x0095, 0x009d, 0x00a5, @@ -167,7 +167,7 @@ static const uint16_t mf_bwfont_fixed_10x20_glyph_offsets_0[96] = { 0x02a6, 0x02ae, 0x02b6, 0x02be, 0x02c6, 0x02cb, 0x02d3, 0x02db, }; -static const uint8_t mf_bwfont_fixed_10x20_glyph_widths_0[95] = { +static const gU8 mf_bwfont_fixed_10x20_glyph_widths_0[95] = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, diff --git a/src/gdisp/fonts/fixed_5x8.c b/src/gdisp/fonts/fixed_5x8.c index d65d58bf..367971f5 100644 --- a/src/gdisp/fonts/fixed_5x8.c +++ b/src/gdisp/fonts/fixed_5x8.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_fixed_5x8_glyph_data_0[475] = { +static const gU8 mf_bwfont_fixed_5x8_glyph_data_0[475] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14, 0x04, 0x2a, 0x7f, 0x2a, 0x10, 0x00, 0x16, 0x08, 0x34, 0x00, 0x36, 0x49, 0x36, 0x40, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x00, 0x00, 0x00, 0x42, 0x3c, diff --git a/src/gdisp/fonts/fixed_7x14.c b/src/gdisp/fonts/fixed_7x14.c index 28b05608..bff0ef77 100644 --- a/src/gdisp/fonts/fixed_7x14.c +++ b/src/gdisp/fonts/fixed_7x14.c @@ -11,7 +11,7 @@ #error The font file is not compatible with this version of mcufont. #endif -static const uint8_t mf_bwfont_fixed_7x14_glyph_data_0[1330] = { +static const gU8 mf_bwfont_fixed_7x14_glyph_data_0[1330] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00, 0xfe, 0x07, diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 8f8dbd7c..7b5438d7 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -196,7 +196,7 @@ static GFXINLINE void fillarea(GDisplay *g) { if (gvmt(g)->writestart) #endif { - uint32_t area; + gU32 area; #if GDISP_HARDWARE_STREAM_POS if ((g->flags & GDISP_FLG_SCRSTREAM)) { @@ -205,7 +205,7 @@ static GFXINLINE void fillarea(GDisplay *g) { } #endif - area = (uint32_t)g->p.cx * g->p.cy; + area = (gU32)g->p.cx * g->p.cy; gdisp_lld_write_start(g); #if GDISP_HARDWARE_STREAM_POS #if GDISP_HARDWARE_STREAM_POS == HARDWARE_AUTODETECT @@ -426,9 +426,9 @@ static void vline_clip(GDisplay *g) { // Parameters: x,y and x1,y1 // Alters: x,y x1,y1 cx,cy static void line_clip(GDisplay *g) { - int16_t dy, dx; - int16_t addx, addy; - int16_t P, diff, i; + gI16 dy, dx; + gI16 addx, addy; + gI16 P, diff, i; // Is this a horizontal line (or a point) if (g->p.y == g->p.y1) { @@ -713,8 +713,8 @@ gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; } gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; } gPowermode gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; } gOrientation gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; } -uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; } -uint8_t gdispGGetContrast(GDisplay *g) { return g->g.Contrast; } +gU8 gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; } +gU8 gdispGGetContrast(GDisplay *g) { return g->g.Contrast; } void gdispGFlush(GDisplay *g) { #if GDISP_HARDWARE_FLUSH @@ -1041,13 +1041,13 @@ void gdispGClear(GDisplay *g, gColor color) { if (gvmt(g)->writestart) #endif { - uint32_t area; + gU32 area; g->p.x = g->p.y = 0; g->p.cx = g->g.Width; g->p.cy = g->g.Height; g->p.color = color; - area = (uint32_t)g->p.cx * g->p.cy; + area = (gU32)g->p.cx * g->p.cy; gdisp_lld_write_start(g); #if GDISP_HARDWARE_STREAM_POS @@ -1428,8 +1428,8 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor #if GDISP_NEED_ELLIPSE void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) { gCoord dx, dy; - int32_t a2, b2; - int32_t err, e2; + gI32 a2, b2; + gI32 err, e2; MUTEX_ENTER(g); @@ -1467,8 +1467,8 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor #if GDISP_NEED_ELLIPSE void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) { gCoord dx, dy; - int32_t a2, b2; - int32_t err, e2; + gI32 a2, b2; + gI32 err, e2; MUTEX_ENTER(g); @@ -1502,7 +1502,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor #endif #if GDISP_NEED_ARCSECTORS - void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) { + void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color) { gCoord a, b, P; MUTEX_ENTER(g); @@ -1546,7 +1546,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor #endif #if GDISP_NEED_ARCSECTORS - void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) { + void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color) { gCoord a, b, P; MUTEX_ENTER(g); @@ -1733,7 +1733,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) { gCoord a, b, P, sedge, eedge; - uint8_t full, sbit, ebit, tbit; + gU8 full, sbit, ebit, tbit; // Normalize the angles if (start < 0) @@ -2036,7 +2036,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor gCoord a, b, P; gCoord sy, ey; fixed sxa, sxb, sxd, exa, exb, exd; - uint8_t qtr; + gU8 qtr; MUTEX_ENTER(g); @@ -3099,7 +3099,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor } } - static int32_t rounding_div(const int32_t n, const int32_t d) + static gI32 rounding_div(const gI32 n, const gI32 d) { if ((n < 0) != (d < 0)) return (n - d/2) / d; @@ -3112,7 +3112,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor static void get_normal_vector(gCoord dx, gCoord dy, gCoord norm, gCoord *nx, gCoord *ny) { gCoord absDx, absDy; - int32_t len_n, len, len2; + gI32 len_n, len, len2; char maxSteps; /* Take the absolute value of dx and dy, multiplied by 2 for precision */ @@ -3259,7 +3259,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #include "mcufont/mcufont.h" #if GDISP_NEED_ANTIALIAS && GDISP_HARDWARE_PIXELREAD - static void drawcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) { + static void drawcharline(gI16 x, gI16 y, gU8 count, gU8 alpha, void *state) { #define GD ((GDisplay *)state) if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x+count <= GD->t.clipx0 || x >= GD->t.clipx1) return; @@ -3282,7 +3282,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #undef GD } #else - static void drawcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) { + static void drawcharline(gI16 x, gI16 y, gU8 count, gU8 alpha, void *state) { #define GD ((GDisplay *)state) if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x+count <= GD->t.clipx0 || x >= GD->t.clipx1) return; @@ -3301,7 +3301,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #endif #if GDISP_NEED_ANTIALIAS - static void fillcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) { + static void fillcharline(gI16 x, gI16 y, gU8 count, gU8 alpha, void *state) { #define GD ((GDisplay *)state) if (y < GD->t.clipy0 || y >= GD->t.clipy1 || x+count <= GD->t.clipx0 || x >= GD->t.clipx1) return; @@ -3325,14 +3325,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #endif /* Callback to render characters. */ - static uint8_t drawcharglyph(int16_t x, int16_t y, mf_char ch, void *state) { + static gU8 drawcharglyph(gI16 x, gI16 y, mf_char ch, void *state) { #define GD ((GDisplay *)state) return mf_render_character(GD->t.font, x, y, ch, drawcharline, state); #undef GD } /* Callback to render characters. */ - static uint8_t fillcharglyph(int16_t x, int16_t y, mf_char ch, void *state) { + static gU8 fillcharglyph(gI16 x, gI16 y, mf_char ch, void *state) { #define GD ((GDisplay *)state) return mf_render_character(GD->t.font, x, y, ch, fillcharline, state); #undef GD @@ -3340,21 +3340,21 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor /* Callback to render string boxes with word wrap. */ #if GDISP_NEED_TEXT_WORDWRAP - static gBool mf_countline_callback(mf_str line, uint16_t count, void *state) { + static gBool mf_countline_callback(mf_str line, gU16 count, void *state) { (void) line; (void) count; ((gCoord*)state)[0]++; return gTrue; } - static gBool mf_drawline_callback(mf_str line, uint16_t count, void *state) { + static gBool mf_drawline_callback(mf_str line, gU16 count, void *state) { #define GD ((GDisplay *)state) mf_render_aligned(GD->t.font, GD->t.wrapx, GD->t.wrapy, GD->t.lrj, line, count, drawcharglyph, state); GD->t.wrapy += GD->t.font->line_height; #undef GD return gTrue; } - static gBool mf_fillline_callback(mf_str line, uint16_t count, void *state) { + static gBool mf_fillline_callback(mf_str line, gU16 count, void *state) { #define GD ((GDisplay *)state) mf_render_aligned(GD->t.font, GD->t.wrapx, GD->t.wrapy, GD->t.lrj, line, count, fillcharglyph, state); GD->t.wrapy += GD->t.font->line_height; @@ -3363,7 +3363,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor } #endif - void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, gFont font, gColor color) { + void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color) { if (!font) return; MUTEX_ENTER(g); @@ -3378,7 +3378,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor MUTEX_EXIT(g); } - void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, gFont font, gColor color, gColor bgcolor) { + void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color, gColor bgcolor) { if (!font) return; MUTEX_ENTER(g); @@ -3632,7 +3632,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor return mf_character_width(font, c); } - gCoord gdispGetStringWidthCount(const char* str, gFont font, uint16_t count) { + gCoord gdispGetStringWidthCount(const char* str, gFont font, gU16 count) { if (!str || !font) return 0; @@ -3652,14 +3652,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #if GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888 // Special alpha hacked version. // Note: this will still work with real RGB888 - gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha) + gColor gdispBlendColor(gColor fg, gColor bg, gU8 alpha) { - uint32_t ratio; - uint32_t a1, r1, g1, b1; - uint32_t a2, r2, g2, b2; + gU32 ratio; + gU32 a1, r1, g1, b1; + gU32 a2, r2, g2, b2; // Ratio - add one to get 1 to 256 - ratio = (uint32_t)alpha + 1; // 0 to 1 in 0.8 fixed point + ratio = (gU32)alpha + 1; // 0 to 1 in 0.8 fixed point // Calculate the pre-multiplied values of r, g, b for the fg color a1 = ALPHA_OF(fg); // 0 to 1 in 0.8 fixed point @@ -3699,11 +3699,11 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor return ARGB2COLOR(a1, r1, g1, b1); } #else - gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha) + gColor gdispBlendColor(gColor fg, gColor bg, gU8 alpha) { - uint16_t fg_ratio = alpha + 1; - uint16_t bg_ratio = 256 - alpha; - uint16_t r, g, b; + gU16 fg_ratio = alpha + 1; + gU16 bg_ratio = 256 - alpha; + gU16 r, g, b; r = RED_OF(fg) * fg_ratio; g = GREEN_OF(fg) * fg_ratio; @@ -3722,7 +3722,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #endif gColor gdispContrastColor(gColor color) { - uint16_t r, g, b; + gU16 r, g, b; r = RED_OF(color) > 128 ? 0 : 255; g = GREEN_OF(color) > 128 ? 0 : 255; diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index a7d4ea4c..dffde4aa 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -36,7 +36,7 @@ /** * @brief The type for a coordinate or length on the screen. */ -typedef int16_t gCoord; +typedef gI16 gCoord; #if GFX_USE_GDISP || defined(__DOXYGEN__) @@ -237,7 +237,7 @@ typedef gColor gPixel; * * @api */ -gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha); +gColor gdispBlendColor(gColor fg, gColor bg, gU8 alpha); /** * @brief Find a contrasting color @@ -346,7 +346,7 @@ gOrientation gdispGGetOrientation(GDisplay *g); * * @api */ -uint8_t gdispGGetBacklight(GDisplay *g); +gU8 gdispGGetBacklight(GDisplay *g); #define gdispGetBacklight() gdispGGetBacklight(GDISP) /** @@ -358,7 +358,7 @@ uint8_t gdispGGetBacklight(GDisplay *g); * * @api */ -uint8_t gdispGGetContrast(GDisplay *g); +gU8 gdispGGetContrast(GDisplay *g); #define gdispGetContrast() gdispGGetContrast(GDISP) /* Drawing Functions */ @@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * * @api */ - void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color); + void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color); #define gdispDrawArcSectors(x,y,r,s,c) gdispGDrawArcSectors(GDISP,x,y,r,s,c) /** @@ -686,7 +686,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * * @api */ - void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color); + void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, gU8 sectors, gColor color); #define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c) #endif @@ -917,7 +917,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * * @api */ - void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, gFont font, gColor color); + void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color); #define gdispDrawChar(x,y,s,f,c) gdispGDrawChar(GDISP,x,y,s,f,c) /** @@ -933,7 +933,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * * @api */ - void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, gFont font, gColor color, gColor bgcolor); + void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, gU16 c, gFont font, gColor color, gColor bgcolor); #define gdispFillChar(x,y,s,f,c,b) gdispGFillChar(GDISP,x,y,s,f,c,b) /** @@ -1040,7 +1040,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * * @api */ - gCoord gdispGetStringWidthCount(const char* str, gFont font, uint16_t count); + gCoord gdispGetStringWidthCount(const char* str, gFont font, gU16 count); /** * @brief Get the pixel width of an entire string. @@ -1090,7 +1090,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor * @param[in] scale_x The scale factor in horizontal direction. * @param[in] scale_y The scale factor in vertical direction. */ - gFont gdispScaleFont(gFont font, uint8_t scale_x, uint8_t scale_y); + gFont gdispScaleFont(gFont font, gU8 scale_x, gU8 scale_y); /** * @brief Get the name of the specified font. diff --git a/src/gdisp/gdisp_colors.h b/src/gdisp/gdisp_colors.h index 4f4521a8..37484165 100644 --- a/src/gdisp/gdisp_colors.h +++ b/src/gdisp/gdisp_colors.h @@ -23,7 +23,7 @@ #if GFX_USE_GDISP || defined(__DOXYGEN__) -typedef uint16_t gColorformat; +typedef gU16 gColorformat; /** * @name Color system masks @@ -173,7 +173,7 @@ typedef uint16_t gColorformat; /** * @brief The color type */ - #define COLOR_TYPE uint16_t + #define COLOR_TYPE gU16 /** * @brief The number of bits in the color type (not necessarily the same as COLOR_BITS). @@ -214,7 +214,7 @@ typedef uint16_t gColorformat; * @note A 5 bit color component maximum value (0x1F) converts to 0xF8 (slightly off-color) * @{ */ - #define LUMA_OF(c) ((RED_OF(c)+((uint16_t)GREEN_OF(c)<<1)+BLUE_OF(c))>>2) + #define LUMA_OF(c) ((RED_OF(c)+((gU16)GREEN_OF(c)<<1)+BLUE_OF(c))>>2) #define RED_OF(c) (((c) & 0xF800)>>8) #define GREEN_OF(c) (((c)&0x007E)>>3) #define BLUE_OF(c) (((c)&0x001F)<<3) @@ -234,7 +234,7 @@ typedef uint16_t gColorformat; * @note A 5 bit color component maximum value (0x1F) converts to 0xFF (the true equivalent color) * @{ */ - #define EXACT_LUMA_OF(c) ((EXACT_RED_OF(c)+((uint16_t)EXACT_GREEN_OF(c)<<1)+EXACT_BLUE_OF(c))>>2) + #define EXACT_LUMA_OF(c) ((EXACT_RED_OF(c)+((gU16)EXACT_GREEN_OF(c)<<1)+EXACT_BLUE_OF(c))>>2) #define EXACT_RED_OF(c) (((((c)>>11)&0x1F)*255)/31) #define EXACT_GREEN_OF(c) (((((c)>>5)&0x3F)*255)/63) #define EXACT_BLUE_OF(c) (((((c)>>0)&0x1F)*255)/31) @@ -261,13 +261,13 @@ typedef uint16_t gColorformat; // From the number of bits determine COLOR_TYPE, COLOR_TYPE_BITS and masking #if COLOR_BITS <= 8 - #define COLOR_TYPE uint8_t + #define COLOR_TYPE gU8 #define COLOR_TYPE_BITS 8 #elif COLOR_BITS <= 16 - #define COLOR_TYPE uint16_t + #define COLOR_TYPE gU16 #define COLOR_TYPE_BITS 16 #elif COLOR_BITS <= 32 - #define COLOR_TYPE uint32_t + #define COLOR_TYPE gU32 #define COLOR_TYPE_BITS 32 #else #error "GDISP: Cannot define color types with more than 32 bits" @@ -321,11 +321,11 @@ typedef uint16_t gColorformat; #define BLUE_OF(c) (((c) & (((1<> (8-(COLOR_BITS_B+COLOR_SHIFT_B))) #endif - #define LUMA_OF(c) ((RED_OF(c)+((uint16_t)GREEN_OF(c)<<1)+BLUE_OF(c))>>2) - #define EXACT_RED_OF(c) (((uint16_t)(((c)>>COLOR_SHIFT_R)&((1<>COLOR_SHIFT_G)&((1<>COLOR_SHIFT_B)&((1<>2) + #define LUMA_OF(c) ((RED_OF(c)+((gU16)GREEN_OF(c)<<1)+BLUE_OF(c))>>2) + #define EXACT_RED_OF(c) (((gU16)(((c)>>COLOR_SHIFT_R)&((1<>COLOR_SHIFT_G)&((1<>COLOR_SHIFT_B)&((1<>2) #define LUMA2COLOR(l) (RGB2COLOR_R(l) | RGB2COLOR_G(l) | RGB2COLOR_B(l)) #define RGB2COLOR(r,g,b) (RGB2COLOR_R(r) | RGB2COLOR_G(g) | RGB2COLOR_B(b)) @@ -382,7 +382,7 @@ typedef uint16_t gColorformat; // From the number of bits determine COLOR_TYPE, COLOR_TYPE_BITS and masking #if COLOR_BITS <= 8 - #define COLOR_TYPE uint8_t + #define COLOR_TYPE gU8 #define COLOR_TYPE_BITS 8 #else #error "GDISP: Cannot define gray-scale color types with more than 8 bits" @@ -402,11 +402,11 @@ typedef uint16_t gColorformat; #define EXACT_LUMA_OF(c) LUMA_OF(c) #else // They eye is more sensitive to green - #define RGB2COLOR(r,g,b) ((COLOR_TYPE)(((uint16_t)(r)+(g)+(g)+(b)) >> (10-COLOR_BITS))) + #define RGB2COLOR(r,g,b) ((COLOR_TYPE)(((gU16)(r)+(g)+(g)+(b)) >> (10-COLOR_BITS))) #define LUMA2COLOR(l) ((COLOR_TYPE)((l)>>(8-COLOR_BITS))) #define HTML2COLOR(h) ((COLOR_TYPE)(((((h)&0xFF0000)>>16)+(((h)&0x00FF00)>>7)+((h)&0x0000FF)) >> (10-COLOR_BITS))) #define LUMA_OF(c) (((c) & ((1<> (8-(LLDCOLOR_BITS_B+LLDCOLOR_SHIFT_B))) #endif - #define LLDLUMA_OF(c) ((LLDRED_OF(c)+((uint16_t)LLDGREEN_OF(c)<<1)+LLDBLUE_OF(c))>>2) - #define LLDEXACT_RED_OF(c) (((uint16_t)(((c)>>LLDCOLOR_SHIFT_R)&((1<>LLDCOLOR_SHIFT_G)&((1<>LLDCOLOR_SHIFT_B)&((1<>2) + #define LLDLUMA_OF(c) ((LLDRED_OF(c)+((gU16)LLDGREEN_OF(c)<<1)+LLDBLUE_OF(c))>>2) + #define LLDEXACT_RED_OF(c) (((gU16)(((c)>>LLDCOLOR_SHIFT_R)&((1<>LLDCOLOR_SHIFT_G)&((1<>LLDCOLOR_SHIFT_B)&((1<>2) #define LLDLUMA2COLOR(l) (LLDRGB2COLOR_R(l) | LLDRGB2COLOR_G(l) | LLDRGB2COLOR_B(l)) #define LLDRGB2COLOR(r,g,b) (LLDRGB2COLOR_R(r) | LLDRGB2COLOR_G(g) | LLDRGB2COLOR_B(b)) @@ -937,7 +937,7 @@ typedef struct GDISPVMT { // From the number of bits determine COLOR_TYPE, COLOR_TYPE_BITS and masking #if LLDCOLOR_BITS <= 8 - #define LLDCOLOR_TYPE uint8_t + #define LLDCOLOR_TYPE gU8 #define LLDCOLOR_TYPE_BITS 8 #else #error "GDISP: Cannot define gray-scale low level driver color types with more than 8 bits" @@ -957,11 +957,11 @@ typedef struct GDISPVMT { #define LLDEXACT_LUMA_OF(c) LLDLUMA_OF(c) #else // They eye is more sensitive to green - #define LLDRGB2COLOR(r,g,b) ((LLDCOLOR_TYPE)(((uint16_t)(r)+(g)+(g)+(b)) >> (10-LLDCOLOR_BITS))) + #define LLDRGB2COLOR(r,g,b) ((LLDCOLOR_TYPE)(((gU16)(r)+(g)+(g)+(b)) >> (10-LLDCOLOR_BITS))) #define LLDLUMA2COLOR(l) ((LLDCOLOR_TYPE)((l)>>(8-LLDCOLOR_BITS))) #define LLDHTML2COLOR(h) ((LLDCOLOR_TYPE)(((((h)&0xFF0000)>>16)+(((h)&0x00FF00)>>7)+((h)&0x0000FF)) >> (10-LLDCOLOR_BITS))) #define LLDLUMA_OF(c) (((c) & ((1<fns->next(img); } -uint16_t gdispImageGetPaletteSize(gdispImage *img) { +gU16 gdispImageGetPaletteSize(gdispImage *img) { if (!img || !img->fns) return 0; if (!img->fns->getPaletteSize) return 0; return img->fns->getPaletteSize(img); } -gColor gdispImageGetPalette(gdispImage *img, uint16_t index) { +gColor gdispImageGetPalette(gdispImage *img, gU16 index) { if (!img || !img->fns) return 0; if (!img->fns->getPalette) return 0; return img->fns->getPalette(img, index); } -gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor) { +gBool gdispImageAdjustPalette(gdispImage *img, gU16 index, gColor newColor) { if (!img || !img->fns) return gFalse; if (!img->fns->adjustPalette) return gFalse; return img->fns->adjustPalette(img, index, newColor); @@ -212,7 +212,7 @@ gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor) // Helper Routines -void *gdispImageAlloc(gdispImage *img, size_t sz) { +void *gdispImageAlloc(gdispImage *img, gMemSize sz) { #if GDISP_NEED_IMAGE_ACCOUNTING void *ptr; @@ -229,7 +229,7 @@ void *gdispImageAlloc(gdispImage *img, size_t sz) { #endif } -void gdispImageFree(gdispImage *img, void *ptr, size_t sz) { +void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz) { #if GDISP_NEED_IMAGE_ACCOUNTING gfxFree(ptr); img->memused -= sz; @@ -244,44 +244,44 @@ void gdispImageFree(gdispImage *img, void *ptr, size_t sz) { && GFX_CPU_ENDIAN != GFX_CPU_ENDIAN_WBDWL && GFX_CPU_ENDIAN != GFX_CPU_ENDIAN_WLDWB union wbyteorder_u { - uint8_t b[2]; - uint32_t w; + gU8 b[2]; + gU32 w; }; union dwbyteorder_u { - uint8_t b[4]; - uint32_t l; + gU8 b[4]; + gU32 l; }; - uint16_t gdispImageH16toLE16(uint16_t w) { + gU16 gdispImageH16toLE16(gU16 w) { union wbyteorder_u we; we.w = w; - return (((uint16_t)we.b[0]))|(((uint16_t)we.b[1]) << 8); + return (((gU16)we.b[0]))|(((gU16)we.b[1]) << 8); } - uint16_t gdispImageH16toBE16(uint16_t w) { + gU16 gdispImageH16toBE16(gU16 w) { union wbyteorder_u we; we.w = w; - return (((uint16_t)we.b[0]) << 8)|(((uint16_t)we.b[1])); + return (((gU16)we.b[0]) << 8)|(((gU16)we.b[1])); } - uint32_t gdispImageH32toLE32(uint32_t dw) { + gU32 gdispImageH32toLE32(gU32 dw) { union dwbyteorder_u we; we.l = dw; - return (((uint32_t)we.b[0])) - |(((uint32_t)we.b[1]) << 8) - |(((uint32_t)we.b[2]) << 16) - |(((uint32_t)we.b[3]) << 24); + return (((gU32)we.b[0])) + |(((gU32)we.b[1]) << 8) + |(((gU32)we.b[2]) << 16) + |(((gU32)we.b[3]) << 24); } - uint32_t gdispImageH32toBE32(uint32_t dw) { + gU32 gdispImageH32toBE32(gU32 dw) { union dwbyteorder_u we; we.l = dw; - return (((uint32_t)we.b[0]) << 24) - |(((uint32_t)we.b[1]) << 16) - |(((uint32_t)we.b[2]) << 8) - |(((uint32_t)we.b[3])); + return (((gU32)we.b[0]) << 24) + |(((gU32)we.b[1]) << 16) + |(((gU32)we.b[2]) << 8) + |(((gU32)we.b[3])); } #endif diff --git a/src/gdisp/gdisp_image.h b/src/gdisp/gdisp_image.h index eeb45475..a590774c 100644 --- a/src/gdisp/gdisp_image.h +++ b/src/gdisp/gdisp_image.h @@ -23,7 +23,7 @@ /** * @brief The type of image */ -typedef uint16_t gdispImageType; +typedef gU16 gdispImageType; #define GDISP_IMAGE_TYPE_UNKNOWN 0 #define GDISP_IMAGE_TYPE_NATIVE 1 #define GDISP_IMAGE_TYPE_GIF 2 @@ -34,7 +34,7 @@ typedef uint16_t gdispImageType; /** * @brief An image error code */ -typedef uint16_t gdispImageError; +typedef gU16 gdispImageError; #define GDISP_IMAGE_ERR_OK 0 #define GDISP_IMAGE_ERR_UNRECOVERABLE 0x8000 #define GDISP_IMAGE_ERR_BADFORMAT (GDISP_IMAGE_ERR_UNRECOVERABLE+1) @@ -48,7 +48,7 @@ typedef uint16_t gdispImageError; /** * @brief Image flags */ -typedef uint16_t gdispImageFlags; +typedef gU16 gdispImageFlags; #define GDISP_IMAGE_FLG_TRANSPARENT 0x0001 /* The image has transparency */ #define GDISP_IMAGE_FLG_ANIMATED 0x0002 /* The image has animation */ #define GDISP_IMAGE_FLG_MULTIPAGE 0x0004 /* The image has multiple pages */ @@ -63,8 +63,8 @@ typedef struct gdispImage { gCoord width, height; /* @< The image dimensions */ GFILE * f; /* @< The underlying GFILE */ #if GDISP_NEED_IMAGE_ACCOUNTING - uint32_t memused; /* @< How much RAM is currently allocated */ - uint32_t maxmemused; /* @< How much RAM has been allocated (maximum) */ + gU32 memused; /* @< How much RAM is currently allocated */ + gU32 maxmemused; /* @< How much RAM has been allocated (maximum) */ #endif const struct gdispImageHandlers * fns; /* @< Don't mess with this! */ void * priv; /* @< Don't mess with this! */ @@ -253,7 +253,7 @@ gDelay gdispImageNext(gdispImage *img); * * @pre gdispImageOpen() must have returned successfully. */ -uint16_t gdispImageGetPaletteSize(gdispImage *img); +gU16 gdispImageGetPaletteSize(gdispImage *img); /** * @brief Get an entry in the color palette. @@ -266,7 +266,7 @@ uint16_t gdispImageGetPaletteSize(gdispImage *img); * * @note This function will return 0 if the index is out of bounds or if the image doesn't use a color palette. */ -gColor gdispImageGetPalette(gdispImage *img, uint16_t index); +gColor gdispImageGetPalette(gdispImage *img, gU16 index); /** * @brief Modify an entry in the color palette. @@ -279,7 +279,7 @@ gColor gdispImageGetPalette(gdispImage *img, uint16_t index); * @pre gdispImageOpen() must have returned successfully. * @note This function will return @p gFalse if the index is out of bounds or if the image doesn't use a color palette. */ -gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor); +gBool gdispImageAdjustPalette(gdispImage *img, gU16 index, gColor newColor); #endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE */ #endif /* _GDISP_IMAGE_H */ diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c index 98c8b3c9..c358a565 100644 --- a/src/gdisp/gdisp_image_bmp.c +++ b/src/gdisp/gdisp_image_bmp.c @@ -12,7 +12,7 @@ #include "gdisp_image_support.h" typedef struct gdispImagePrivate_BMP { - uint8_t bmpflags; + gU8 bmpflags; #define BMP_V2 0x01 // Version 2 (old) header format #define BMP_V4 0x02 // Version 4 (alpha support) header format #define BMP_PALETTE 0x04 // Uses a palette @@ -21,26 +21,26 @@ typedef struct gdispImagePrivate_BMP { #define BMP_RLE_ENC 0x20 // Currently in RLE encoded run #define BMP_RLE_ABS 0x40 // Currently in RLE absolute run #define BMP_TOP_TO_BOTTOM 0x80 // Decodes bottom to top line - uint8_t bitsperpixel; + gU8 bitsperpixel; #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_4_RLE || GDISP_NEED_IMAGE_BMP_8 || GDISP_NEED_IMAGE_BMP_8_RLE - uint16_t palsize; + gU16 palsize; gPixel *palette; #endif #if GDISP_NEED_IMAGE_BMP_4_RLE || GDISP_NEED_IMAGE_BMP_8_RLE - uint16_t rlerun; - uint8_t rlecode; + gU16 rlerun; + gU8 rlecode; #endif #if GDISP_NEED_IMAGE_BMP_16 || GDISP_NEED_IMAGE_BMP_32 - int8_t shiftred; - int8_t shiftgreen; - int8_t shiftblue; - int8_t shiftalpha; - uint32_t maskred; - uint32_t maskgreen; - uint32_t maskblue; - uint32_t maskalpha; + gI8 shiftred; + gI8 shiftgreen; + gI8 shiftblue; + gI8 shiftalpha; + gU32 maskred; + gU32 maskgreen; + gU32 maskblue; + gU32 maskalpha; #endif - size_t frame0pos; + gFileSize frame0pos; gPixel *frame0cache; gPixel buf[GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE]; } gdispImagePrivate_BMP; @@ -63,10 +63,10 @@ void gdispImageClose_BMP(gdispImage *img) { gdispImageError gdispImageOpen_BMP(gdispImage *img) { gdispImagePrivate_BMP *priv; - uint8_t hdr[2]; - uint16_t aword; - uint32_t adword; - uint32_t offsetColorTable; + gU8 hdr[2]; + gU16 aword; + gU32 adword; + gU32 offsetColorTable; /* Read the file identifier */ if (gfileRead(img->f, hdr, 2) != 2) @@ -172,7 +172,7 @@ gdispImageError gdispImageOpen_BMP(gdispImage *img) { img->width = adword; // Get the height adword = gdispImageGetAlignedLE32(priv->buf, 4); - if ((int32_t)adword < 0) { // Negative test + if ((gI32)adword < 0) { // Negative test priv->bmpflags |= BMP_TOP_TO_BOTTOM; adword = -adword; } @@ -267,12 +267,12 @@ gdispImageError gdispImageOpen_BMP(gdispImage *img) { if (priv->bmpflags & BMP_V2) { for(aword = 0; aword < priv->palsize; aword++) { if (gfileRead(img->f, &priv->buf, 3) != 3) goto baddatacleanup; - priv->palette[aword] = RGB2COLOR(((uint8_t *)priv->buf)[2], ((uint8_t *)priv->buf)[1], ((uint8_t *)priv->buf)[0]); + priv->palette[aword] = RGB2COLOR(((gU8 *)priv->buf)[2], ((gU8 *)priv->buf)[1], ((gU8 *)priv->buf)[0]); } } else { for(aword = 0; aword < priv->palsize; aword++) { if (gfileRead(img->f, &priv->buf, 4) != 4) goto baddatacleanup; - priv->palette[aword] = RGB2COLOR(((uint8_t *)priv->buf)[2], ((uint8_t *)priv->buf)[1], ((uint8_t *)priv->buf)[0]); + priv->palette[aword] = RGB2COLOR(((gU8 *)priv->buf)[2], ((gU8 *)priv->buf)[1], ((gU8 *)priv->buf)[0]); } } @@ -365,8 +365,8 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #if GDISP_NEED_IMAGE_BMP_1 case 1: { - uint8_t b[4]; - uint8_t m; + gU8 b[4]; + gU8 m; priv = (gdispImagePrivate_BMP *)img->priv; pc = priv->buf; @@ -398,7 +398,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { if (priv->bmpflags & BMP_COMP_RLE) #endif { - uint8_t b[4]; + gU8 b[4]; while(x < img->width) { if (priv->bmpflags & BMP_RLE_ENC) { @@ -462,7 +462,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { // There are always at least 2 bytes in an RLE code if (gfileRead(img->f, &b, 2) != 2) return 0; - priv->rlerun = b[0] + (uint16_t)b[1] * img->width; + priv->rlerun = b[0] + (gU16)b[1] * img->width; priv->rlecode = 0; // Who knows what color this should really be priv->bmpflags |= BMP_RLE_ENC; } else { // Absolute mode @@ -475,7 +475,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #endif #if GDISP_NEED_IMAGE_BMP_4 { - uint8_t b[4]; + gU8 b[4]; while(x < img->width && len <= GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE-8) { if (gfileRead(img->f, &b, 4) != 4) @@ -504,7 +504,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { if (priv->bmpflags & BMP_COMP_RLE) #endif { - uint8_t b[4]; + gU8 b[4]; while(x < img->width) { if (priv->bmpflags & BMP_RLE_ENC) { @@ -556,7 +556,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { // There are always at least 2 bytes in an RLE code if (gfileRead(img->f, &b, 2) != 2) return GDISP_IMAGE_ERR_BADDATA; - priv->rlerun = b[0] + (uint16_t)b[1] * img->width; + priv->rlerun = b[0] + (gU16)b[1] * img->width; priv->rlecode = 0; // Who knows what color this should really be priv->bmpflags |= BMP_RLE_ENC; } else { // Absolute mode @@ -569,7 +569,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #endif #if GDISP_NEED_IMAGE_BMP_8 { - uint8_t b[4]; + gU8 b[4]; while(x < img->width && len <= GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE-4) { if (gfileRead(img->f, &b, 4) != 4) @@ -590,7 +590,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #if GDISP_NEED_IMAGE_BMP_16 case 16: { - uint16_t w[2]; + gU16 w[2]; gColor r, g, b; while(x < img->width && len <= GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE-2) { @@ -623,7 +623,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { if (priv->shiftblue < 0) b = (gColor)((w[1] & priv->maskblue) << -priv->shiftblue); else - b = (uint8_t)((w[1] & priv->maskblue) >> priv->shiftblue); + b = (gU8)((w[1] & priv->maskblue) >> priv->shiftblue); /* We don't support alpha yet */ *pc++ = RGB2COLOR(r, g, b); x += 2; @@ -636,7 +636,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #if GDISP_NEED_IMAGE_BMP_24 case 24: { - uint8_t b[3]; + gU8 b[3]; while(x < img->width && len < GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE) { if (gfileRead(img->f, &b, 3) != 3) @@ -658,7 +658,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) { #if GDISP_NEED_IMAGE_BMP_32 case 32: { - uint32_t dw; + gU32 dw; gColor r, g, b; while(x < img->width && len < GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE) { @@ -696,7 +696,7 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) { gColor * pcs; gColor * pcd; gCoord pos, x, y; - size_t len; + gMemSize len; /* If we are already cached - just return OK */ priv = (gdispImagePrivate_BMP *)img->priv; @@ -822,7 +822,7 @@ gDelay gdispImageNext_BMP(gdispImage *img) { return gDelayForever; } -uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img) { +gU16 gdispImageGetPaletteSize_BMP(gdispImage *img) { #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 gdispImagePrivate_BMP *priv; @@ -839,7 +839,7 @@ uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img) { #endif } -gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) { +gColor gdispImageGetPalette_BMP(gdispImage *img, gU16 index) { #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 gdispImagePrivate_BMP *priv; @@ -853,14 +853,14 @@ gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) { if (index >= priv->palsize) return 0; - return priv->palette[(uint8_t)index]; + return priv->palette[(gU8)index]; #else return 0; #endif } -gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newColor) { +gBool gdispImageAdjustPalette_BMP(gdispImage *img, gU16 index, gColor newColor) { #if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8 gdispImagePrivate_BMP *priv; @@ -874,7 +874,7 @@ gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newCol if (index >= priv->palsize) return gFalse; - priv->palette[(uint8_t)index] = newColor; + priv->palette[(gU8)index] = newColor; return gTrue; diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c index 632d168e..804dce52 100644 --- a/src/gdisp/gdisp_image_gif.c +++ b/src/gdisp/gdisp_image_gif.c @@ -22,7 +22,7 @@ #define GIF_CODE_NONE (GIF_CODE_MAX+3) // Illegal code to signal empty // Convert bits to masks for that number of bits -static const uint16_t GifBitMask[] = { +static const gU16 GifBitMask[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, @@ -31,68 +31,68 @@ static const uint16_t GifBitMask[] = { // Structure for decoding a single frame typedef struct gifimgdecode { - uint8_t blocksz; // The size of the block currently being processed - uint8_t maxpixel; // The maximum allowed pixel value - uint8_t bitsperpixel; - uint8_t bitspercode; - uint8_t shiftbits; - uint16_t maxcodesz; - uint16_t stackcnt; // The number of items on the stack - uint16_t code_clear; - uint16_t code_eof; - uint16_t code_max; - uint16_t code_last; - uint32_t shiftdata; + gU8 blocksz; // The size of the block currently being processed + gU8 maxpixel; // The maximum allowed pixel value + gU8 bitsperpixel; + gU8 bitspercode; + gU8 shiftbits; + gU16 maxcodesz; + gU16 stackcnt; // The number of items on the stack + gU16 code_clear; + gU16 code_eof; + gU16 code_max; + gU16 code_last; + gU32 shiftdata; gColor * palette; - uint8_t buf[GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE]; // Buffer for decoded pixels - uint16_t prefix[1<priv; @@ -182,8 +182,8 @@ static void stopDecodeGif(gdispImage *img) { } } -static uint16_t getPrefixGif(gifimgdecode *decode, uint16_t code) { - uint16_t i; +static gU16 getPrefixGif(gifimgdecode *decode, gU16 code) { + gU16 i; for(i=0; code > decode->code_clear && i <= GIF_CODE_MAX; i++, code = decode->prefix[code]) { if (code > GIF_CODE_MAX) @@ -201,12 +201,12 @@ static uint16_t getPrefixGif(gifimgdecode *decode, uint16_t code) { * * Note: The resulting pixels are stored in decode->buf */ -static uint16_t getBytesGif(gdispImage *img) { +static gU16 getBytesGif(gdispImage *img) { gdispImagePrivate_GIF * priv; gifimgdecode * decode; - uint16_t cnt; - uint16_t code, prefix; - uint8_t bdata; + gU16 cnt; + gU16 code, prefix; + gU8 bdata; priv = (gdispImagePrivate_GIF *)img->priv; decode = priv->decode; @@ -337,8 +337,8 @@ static uint16_t getBytesGif(gdispImage *img) { static gdispImageError initFrameGif(gdispImage *img) { gdispImagePrivate_GIF * priv; gifimgcache * cache; - uint8_t blocktype; - uint8_t blocksz; + gU8 blocktype; + gU8 blocksz; priv = (gdispImagePrivate_GIF *)img->priv; @@ -351,8 +351,8 @@ static gdispImageError initFrameGif(gdispImage *img) { priv->dispose.height = priv->frame.height; // Check for a cached version of this image - for(cache=priv->cache; cache && cache->frame.posstart <= (size_t)gfileGetPos(img->f); cache=cache->next) { - if (cache->frame.posstart == (size_t)gfileGetPos(img->f)) { + for(cache=priv->cache; cache && cache->frame.posstart <= gfileGetPos(img->f); cache=cache->next) { + if (cache->frame.posstart == gfileGetPos(img->f)) { priv->frame = cache->frame; priv->curcache = cache; return GDISP_IMAGE_ERR_OK; @@ -380,9 +380,9 @@ static gdispImageError initFrameGif(gdispImage *img) { priv->frame.y = gdispImageGetAlignedLE16(priv->buf, 2); priv->frame.width = gdispImageGetAlignedLE16(priv->buf, 4); priv->frame.height = gdispImageGetAlignedLE16(priv->buf, 6); - if (((uint8_t *)priv->buf)[8] & 0x80) // Local color table? - priv->frame.palsize = 2 << (((uint8_t *)priv->buf)[8] & 0x07); - if (((uint8_t *)priv->buf)[8] & 0x40) // Interlaced? + if (((gU8 *)priv->buf)[8] & 0x80) // Local color table? + priv->frame.palsize = 2 << (((gU8 *)priv->buf)[8] & 0x07); + if (((gU8 *)priv->buf)[8] & 0x40) // Interlaced? priv->frame.flags |= GIFL_INTERLACE; // We are ready to go for the actual palette read and image decode @@ -406,26 +406,26 @@ static gdispImageError initFrameGif(gdispImage *img) { if (gfileRead(img->f, priv->buf, 6) != 6) return GDISP_IMAGE_ERR_BADDATA; // Check we have read a 4 byte data block and a data block terminator (0) - if (((uint8_t *)priv->buf)[0] != 4 || ((uint8_t *)priv->buf)[5] != 0) + if (((gU8 *)priv->buf)[0] != 4 || ((gU8 *)priv->buf)[5] != 0) return GDISP_IMAGE_ERR_BADDATA; // Process the flags - switch(((uint8_t *)priv->buf)[1] & 0x1C) { + switch(((gU8 *)priv->buf)[1] & 0x1C) { case 0x00: case 0x04: break; // Dispose = do nothing case 0x08: priv->frame.flags |= GIFL_DISPOSECLEAR; break; // Dispose = clear case 0x0C: case 0x10: priv->frame.flags |= GIFL_DISPOSEREST; break; // Dispose = restore. Value 0x10 is a hack for bad encoders default: return GDISP_IMAGE_ERR_UNSUPPORTED; } - if (((uint8_t *)priv->buf)[1] & 0x01) { + if (((gU8 *)priv->buf)[1] & 0x01) { priv->frame.flags |= GIFL_TRANSPARENT; img->flags |= GDISP_IMAGE_FLG_TRANSPARENT; // We set this but never clear it } - if (((uint8_t *)priv->buf)[1] & 0x02) // Wait for user input? + if (((gU8 *)priv->buf)[1] & 0x02) // Wait for user input? img->flags |= GDISP_IMAGE_FLG_MULTIPAGE; else img->flags &= ~GDISP_IMAGE_FLG_MULTIPAGE; // Process frame delay and the transparent color (if any) priv->frame.delay = gdispImageGetAlignedLE16(priv->buf, 2); - priv->frame.paltrans = ((uint8_t *)priv->buf)[4]; + priv->frame.paltrans = ((gU8 *)priv->buf)[4]; break; case 0xFF: // EXTENSION - Application @@ -436,14 +436,14 @@ static gdispImageError initFrameGif(gdispImage *img) { if (gfileRead(img->f, priv->buf, 16) != 16) return GDISP_IMAGE_ERR_BADDATA; // Check we have read a 11 byte data block - if (((uint8_t *)priv->buf)[0] != 11 && ((uint8_t *)priv->buf)[12] != 3) + if (((gU8 *)priv->buf)[0] != 11 && ((gU8 *)priv->buf)[12] != 3) return GDISP_IMAGE_ERR_BADDATA; // Check the vendor - if (((uint8_t *)priv->buf)[1] == 'N' && ((uint8_t *)priv->buf)[2] == 'E' && ((uint8_t *)priv->buf)[3] == 'T' - && ((uint8_t *)priv->buf)[4] == 'S' && ((uint8_t *)priv->buf)[5] == 'C' && ((uint8_t *)priv->buf)[6] == 'A' - && ((uint8_t *)priv->buf)[7] == 'P' && ((uint8_t *)priv->buf)[8] == 'E' && ((uint8_t *)priv->buf)[9] == '2' - && ((uint8_t *)priv->buf)[10] == '.' && ((uint8_t *)priv->buf)[11] == '0') { - if (((uint8_t *)priv->buf)[13] == 1) { + if (((gU8 *)priv->buf)[1] == 'N' && ((gU8 *)priv->buf)[2] == 'E' && ((gU8 *)priv->buf)[3] == 'T' + && ((gU8 *)priv->buf)[4] == 'S' && ((gU8 *)priv->buf)[5] == 'C' && ((gU8 *)priv->buf)[6] == 'A' + && ((gU8 *)priv->buf)[7] == 'P' && ((gU8 *)priv->buf)[8] == 'E' && ((gU8 *)priv->buf)[9] == '2' + && ((gU8 *)priv->buf)[10] == '.' && ((gU8 *)priv->buf)[11] == '0') { + if (((gU8 *)priv->buf)[13] == 1) { priv->loops = gdispImageGetAlignedLE16(priv->buf, 14); priv->flags |= GIF_LOOP; if (!priv->loops) @@ -516,8 +516,8 @@ void gdispImageClose_GIF(gdispImage *img) { gdispImageError gdispImageOpen_GIF(gdispImage *img) { gdispImagePrivate_GIF *priv; - uint8_t hdr[6]; - uint16_t aword; + gU8 hdr[6]; + gU16 aword; /* Read the file identifier */ if (gfileRead(img->f, hdr, 6) != 6) @@ -555,9 +555,9 @@ gdispImageError gdispImageOpen_GIF(gdispImage *img) { img->width = gdispImageGetAlignedLE16(priv->buf, 0); // Get the height img->height = gdispImageGetAlignedLE16(priv->buf, 2); - if (((uint8_t *)priv->buf)[4] & 0x80) { + if (((gU8 *)priv->buf)[4] & 0x80) { // Global color table - priv->palsize = 2 << (((uint8_t *)priv->buf)[4] & 0x07); + priv->palsize = 2 << (((gU8 *)priv->buf)[4] & 0x07); // Allocate the global palette if (!(priv->palette = (gColor *)gdispImageAlloc(img, priv->palsize*sizeof(gColor)))) goto nomemcleanup; @@ -565,10 +565,10 @@ gdispImageError gdispImageOpen_GIF(gdispImage *img) { for(aword = 0; aword < priv->palsize; aword++) { if (gfileRead(img->f, &priv->buf, 3) != 3) goto baddatacleanup; - priv->palette[aword] = RGB2COLOR(((uint8_t *)priv->buf)[0], ((uint8_t *)priv->buf)[1], ((uint8_t *)priv->buf)[2]); + priv->palette[aword] = RGB2COLOR(((gU8 *)priv->buf)[0], ((gU8 *)priv->buf)[1], ((gU8 *)priv->buf)[2]); } } - priv->bgcolor = ((uint8_t *)priv->buf)[5]; + priv->bgcolor = ((gU8 *)priv->buf)[5]; // Save the fram0pos priv->frame0pos = gfileGetPos(img->f); @@ -599,10 +599,10 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) { gdispImagePrivate_GIF * priv; gifimgcache * cache; gifimgdecode * decode; - uint8_t * p; - uint8_t * q; + gU8 * p; + gU8 * q; gCoord mx, my; - uint16_t cnt; + gU16 cnt; /* If we are already cached - just return OK */ priv = (gdispImagePrivate_GIF *)img->priv; @@ -616,7 +616,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) { /* Initialise the cache */ decode = 0; cache->frame = priv->frame; - cache->imagebits = (uint8_t *)(cache+1) + cache->frame.palsize*sizeof(gColor); + cache->imagebits = (gU8 *)(cache+1) + cache->frame.palsize*sizeof(gColor); cache->next = 0; /* Start the decode */ @@ -769,10 +769,10 @@ baddatacleanup: gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gdispImagePrivate_GIF * priv; gifimgdecode * decode; - uint8_t * q = 0; + gU8 * q = 0; gCoord mx, my, fx, fy; - uint16_t cnt, gcnt; - uint8_t col; + gU16 cnt, gcnt; + gU8 col; priv = (gdispImagePrivate_GIF *)img->priv; @@ -1109,7 +1109,7 @@ baddatacleanup: gDelay gdispImageNext_GIF(gdispImage *img) { gdispImagePrivate_GIF * priv; gDelay delay; - uint8_t blocksz; + gU8 blocksz; priv = (gdispImagePrivate_GIF *)img->priv; diff --git a/src/gdisp/gdisp_image_jpg.c b/src/gdisp/gdisp_image_jpg.c index 3191d51a..716020fa 100644 --- a/src/gdisp/gdisp_image_jpg.c +++ b/src/gdisp/gdisp_image_jpg.c @@ -33,21 +33,21 @@ typedef struct { /* Decompressor object structure */ typedef struct JDEC { unsigned dctr; /* Number of bytes available in the input buffer */ - uint8_t* dptr; /* Current data read ptr */ - uint8_t* inbuf; /* Bit stream input buffer */ - uint8_t dmsk; /* Current bit in the current read byte */ - uint8_t scale; /* Output scaling ratio */ - uint8_t msx, msy; /* MCU size in unit of block (width, height) */ - uint8_t qtid[3]; /* Quantization table ID of each component */ - int16_t dcv[3]; /* Previous DC element of each component */ - uint16_t nrst; /* Restart inverval */ + gU8* dptr; /* Current data read ptr */ + gU8* inbuf; /* Bit stream input buffer */ + gU8 dmsk; /* Current bit in the current read byte */ + gU8 scale; /* Output scaling ratio */ + gU8 msx, msy; /* MCU size in unit of block (width, height) */ + gU8 qtid[3]; /* Quantization table ID of each component */ + gI16 dcv[3]; /* Previous DC element of each component */ + gU16 nrst; /* Restart inverval */ unsigned width, height; /* Size of the input image (pixel) */ - uint8_t* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ - uint16_t* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ - uint8_t* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ - int32_t* qttbl[4]; /* Dequaitizer tables [id] */ + gU8* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ + gU16* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ + gU8* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ + gI32* qttbl[4]; /* Dequaitizer tables [id] */ void* workbuf; /* Working buffer for IDCT and RGB output */ - uint8_t* mcubuf; /* Working buffer for the MCU */ + gU8* mcubuf; /* Working buffer for the MCU */ void* pool; /* Pointer to available memory pool */ unsigned sz_pool; /* Size of momory pool (bytes available) */ gdispImage* img; /* Pointer to I/O device identifiler for the session */ @@ -55,7 +55,7 @@ typedef struct JDEC { /* TJpgDec API functions */ gdispImageError jd_prepare(JDEC*, void*, gdispImage*); -gdispImageError jd_decomp(JDEC*, unsigned(*)(gdispImage*,void*,JRECT*), uint8_t); +gdispImageError jd_decomp(JDEC*, unsigned(*)(gdispImage*,void*,JRECT*), gU8); /*---------------------------------------------------------------------------*/ typedef struct gdispImagePrivate_JPG { @@ -64,7 +64,7 @@ typedef struct gdispImagePrivate_JPG { gdispImageError gdispImageOpen_JPG(gdispImage *img){ gdispImagePrivate_JPG *priv; - uint8_t hdr[4]; + gU8 hdr[4]; unsigned len; /* Read the file identifier */ @@ -132,7 +132,7 @@ void gdispImageClose_JPG(gdispImage *img){ static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT *rect) { gdispImagePrivate_JPG *priv; - uint8_t *in; + gU8 *in; gPixel *out; gCoord x, y; @@ -233,7 +233,7 @@ gDelay gdispImageNext_JPG(gdispImage *img) { #define ZIG(n) Zig[n] static -const uint8_t Zig[64] = { /* Zigzag-order to raster-order conversion table */ +const gU8 Zig[64] = { /* Zigzag-order to raster-order conversion table */ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, @@ -250,15 +250,15 @@ const uint8_t Zig[64] = { /* Zigzag-order to raster-order conversion table */ #define IPSF(n) Ipsf[n] static -const uint16_t Ipsf[64] = { /* See also aa_idct.png */ - (uint16_t)(1.00000*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.17588*8192), (uint16_t)(1.00000*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.27590*8192), - (uint16_t)(1.38704*8192), (uint16_t)(1.92388*8192), (uint16_t)(1.81226*8192), (uint16_t)(1.63099*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.08979*8192), (uint16_t)(0.75066*8192), (uint16_t)(0.38268*8192), - (uint16_t)(1.30656*8192), (uint16_t)(1.81226*8192), (uint16_t)(1.70711*8192), (uint16_t)(1.53636*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.02656*8192), (uint16_t)(0.70711*8192), (uint16_t)(0.36048*8192), - (uint16_t)(1.17588*8192), (uint16_t)(1.63099*8192), (uint16_t)(1.53636*8192), (uint16_t)(1.38268*8192), (uint16_t)(1.17588*8192), (uint16_t)(0.92388*8192), (uint16_t)(0.63638*8192), (uint16_t)(0.32442*8192), - (uint16_t)(1.00000*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.17588*8192), (uint16_t)(1.00000*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.27590*8192), - (uint16_t)(0.78570*8192), (uint16_t)(1.08979*8192), (uint16_t)(1.02656*8192), (uint16_t)(0.92388*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.61732*8192), (uint16_t)(0.42522*8192), (uint16_t)(0.21677*8192), - (uint16_t)(0.54120*8192), (uint16_t)(0.75066*8192), (uint16_t)(0.70711*8192), (uint16_t)(0.63638*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.42522*8192), (uint16_t)(0.29290*8192), (uint16_t)(0.14932*8192), - (uint16_t)(0.27590*8192), (uint16_t)(0.38268*8192), (uint16_t)(0.36048*8192), (uint16_t)(0.32442*8192), (uint16_t)(0.27590*8192), (uint16_t)(0.21678*8192), (uint16_t)(0.14932*8192), (uint16_t)(0.07612*8192) +const gU16 Ipsf[64] = { /* See also aa_idct.png */ + (gU16)(1.00000*8192), (gU16)(1.38704*8192), (gU16)(1.30656*8192), (gU16)(1.17588*8192), (gU16)(1.00000*8192), (gU16)(0.78570*8192), (gU16)(0.54120*8192), (gU16)(0.27590*8192), + (gU16)(1.38704*8192), (gU16)(1.92388*8192), (gU16)(1.81226*8192), (gU16)(1.63099*8192), (gU16)(1.38704*8192), (gU16)(1.08979*8192), (gU16)(0.75066*8192), (gU16)(0.38268*8192), + (gU16)(1.30656*8192), (gU16)(1.81226*8192), (gU16)(1.70711*8192), (gU16)(1.53636*8192), (gU16)(1.30656*8192), (gU16)(1.02656*8192), (gU16)(0.70711*8192), (gU16)(0.36048*8192), + (gU16)(1.17588*8192), (gU16)(1.63099*8192), (gU16)(1.53636*8192), (gU16)(1.38268*8192), (gU16)(1.17588*8192), (gU16)(0.92388*8192), (gU16)(0.63638*8192), (gU16)(0.32442*8192), + (gU16)(1.00000*8192), (gU16)(1.38704*8192), (gU16)(1.30656*8192), (gU16)(1.17588*8192), (gU16)(1.00000*8192), (gU16)(0.78570*8192), (gU16)(0.54120*8192), (gU16)(0.27590*8192), + (gU16)(0.78570*8192), (gU16)(1.08979*8192), (gU16)(1.02656*8192), (gU16)(0.92388*8192), (gU16)(0.78570*8192), (gU16)(0.61732*8192), (gU16)(0.42522*8192), (gU16)(0.21677*8192), + (gU16)(0.54120*8192), (gU16)(0.75066*8192), (gU16)(0.70711*8192), (gU16)(0.63638*8192), (gU16)(0.54120*8192), (gU16)(0.42522*8192), (gU16)(0.29290*8192), (gU16)(0.14932*8192), + (gU16)(0.27590*8192), (gU16)(0.38268*8192), (gU16)(0.36048*8192), (gU16)(0.32442*8192), (gU16)(0.27590*8192), (gU16)(0.21678*8192), (gU16)(0.14932*8192), (gU16)(0.07612*8192) }; @@ -272,7 +272,7 @@ const uint16_t Ipsf[64] = { /* See also aa_idct.png */ #define BYTECLIP(v) Clip8[(unsigned)(v) & 0x3FF] static -const uint8_t Clip8[1024] = { +const gU8 Clip8[1024] = { /* 0..255 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, @@ -314,14 +314,14 @@ const uint8_t Clip8[1024] = { #else /* JD_TBLCLIP */ inline -uint8_t BYTECLIP ( +gU8 BYTECLIP ( int val ) { if (val < 0) val = 0; if (val > 255) val = 255; - return (uint8_t)val; + return (gU8)val; } #endif @@ -362,13 +362,13 @@ void* alloc_pool ( /* Pointer to allocated memory block (NULL:no memory availabl static unsigned create_qt_tbl ( /* 0:OK, !0:Failed */ JDEC* jd, /* Pointer to the decompressor object */ - const uint8_t* data, /* Pointer to the quantizer tables */ + const gU8* data, /* Pointer to the quantizer tables */ unsigned ndata /* Size of input data */ ) { unsigned i; - uint8_t d, z; - int32_t *pb; + gU8 d, z; + gI32 *pb; while (ndata) { /* Process all tables in the segment */ @@ -377,12 +377,12 @@ unsigned create_qt_tbl ( /* 0:OK, !0:Failed */ d = *data++; /* Get table property */ if (d & 0xF0) return GDISP_IMAGE_ERR_BADDATA; /* Err: not 8-bit resolution */ i = d & 3; /* Get table ID */ - pb = alloc_pool(jd, 64 * sizeof (int32_t));/* Allocate a memory block for the table */ + pb = alloc_pool(jd, 64 * sizeof (gI32));/* Allocate a memory block for the table */ if (!pb) return GDISP_IMAGE_ERR_NOMEMORY; /* Err: not enough memory */ jd->qttbl[i] = pb; /* Register the table */ for (i = 0; i < 64; i++) { /* Load the table */ z = ZIG(i); /* Zigzag-order to raster-order conversion */ - pb[z] = (int32_t)((uint32_t)*data++ * IPSF(z)); /* Apply scale factor of Arai algorithm to the de-quantizers */ + pb[z] = (gI32)((gU32)*data++ * IPSF(z)); /* Apply scale factor of Arai algorithm to the de-quantizers */ } } @@ -399,13 +399,13 @@ unsigned create_qt_tbl ( /* 0:OK, !0:Failed */ static unsigned create_huffman_tbl ( /* 0:OK, !0:Failed */ JDEC* jd, /* Pointer to the decompressor object */ - const uint8_t* data, /* Pointer to the packed huffman tables */ + const gU8* data, /* Pointer to the packed huffman tables */ unsigned ndata /* Size of input data */ ) { unsigned i, j, b, np, cls, num; - uint8_t d, *pb, *pd; - uint16_t hc, *ph; + gU8 d, *pb, *pd; + gU16 hc, *ph; while (ndata) { /* Process all tables in the segment */ @@ -422,7 +422,7 @@ unsigned create_huffman_tbl ( /* 0:OK, !0:Failed */ np += b; /* Get sum of code words for each code */ } - ph = alloc_pool(jd, np * sizeof (uint16_t));/* Allocate a memory block for the code word table */ + ph = alloc_pool(jd, np * sizeof (gU16));/* Allocate a memory block for the code word table */ if (!ph) return GDISP_IMAGE_ERR_NOMEMORY; /* Err: not enough memory */ jd->huffcode[num][cls] = ph; hc = 0; @@ -460,7 +460,7 @@ int bitext ( /* >=0: extracted data, <0: error code */ unsigned nbit /* Number of bits to extract (1 to 11) */ ) { - uint8_t msk, s, *dp; + gU8 msk, s, *dp; unsigned dc, v, f; @@ -508,12 +508,12 @@ int bitext ( /* >=0: extracted data, <0: error code */ static int huffext ( /* >=0: decoded data, <0: error code */ JDEC* jd, /* Pointer to the decompressor object */ - const uint8_t* hbits, /* Pointer to the bit distribution table */ - const uint16_t* hcode, /* Pointer to the code word table */ - const uint8_t* hdata /* Pointer to the data table */ + const gU8* hbits, /* Pointer to the bit distribution table */ + const gU16* hcode, /* Pointer to the code word table */ + const gU8* hdata /* Pointer to the data table */ ) { - uint8_t msk, s, *dp; + gU8 msk, s, *dp; unsigned dc, v, f, bl, nd; @@ -569,13 +569,13 @@ int huffext ( /* >=0: decoded data, <0: error code */ static void block_idct ( - int32_t* src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ - uint8_t* dst /* Pointer to the destination to store the block as byte array */ + gI32* src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ + gU8* dst /* Pointer to the destination to store the block as byte array */ ) { - const int32_t M13 = (int32_t)(1.41421*4096), M2 = (int32_t)(1.08239*4096), M4 = (int32_t)(2.61313*4096), M5 = (int32_t)(1.84776*4096); - int32_t v0, v1, v2, v3, v4, v5, v6, v7; - int32_t t10, t11, t12, t13; + const gI32 M13 = (gI32)(1.41421*4096), M2 = (gI32)(1.08239*4096), M4 = (gI32)(2.61313*4096), M5 = (gI32)(1.84776*4096); + gI32 v0, v1, v2, v3, v4, v5, v6, v7; + gI32 t10, t11, t12, t13; unsigned i; /* Process columns */ @@ -685,13 +685,13 @@ gdispImageError mcu_load ( JDEC* jd /* Pointer to the decompressor object */ ) { - int32_t *tmp = (int32_t*)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ + gI32 *tmp = (gI32*)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ unsigned blk, nby, nbc, i, z, id, cmp; int b, d, e; - uint8_t *bp; - const uint8_t *hb, *hd; - const uint16_t *hc; - const int32_t *dqf; + gU8 *bp; + const gU8 *hb, *hd; + const gU16 *hc; + const gI32 *dqf; nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ @@ -715,7 +715,7 @@ gdispImageError mcu_load ( b = 1 << (b - 1); /* MSB position */ if (!(e & b)) e -= (b << 1) - 1; /* Restore sign if needed */ d += e; /* Get current value */ - jd->dcv[cmp] = (int16_t)d; /* Save current DC value for next block */ + jd->dcv[cmp] = (gI16)d; /* Save current DC value for next block */ } dqf = jd->qttbl[jd->qtid[cmp]]; /* De-quantizer table ID for this component */ tmp[0] = d * dqf[0] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ @@ -774,7 +774,7 @@ gdispImageError mcu_output ( const int CVACC = (sizeof (int) > 2) ? 1024 : 128; unsigned ix, iy, mx, my, rx, ry; int yy, cb, cr; - uint8_t *py, *pc, *rgb24; + gU8 *py, *pc, *rgb24; JRECT rect; @@ -793,7 +793,7 @@ gdispImageError mcu_output ( if (!JD_USE_SCALE || jd->scale != 3) { /* Not for 1/8 scaling */ /* Build an RGB MCU from discrete comopnents */ - rgb24 = (uint8_t*)jd->workbuf; + rgb24 = (gU8*)jd->workbuf; for (iy = 0; iy < my; iy++) { pc = jd->mcubuf; py = pc + iy * 8; @@ -824,16 +824,16 @@ gdispImageError mcu_output ( /* Descale the MCU rectangular if needed */ if (JD_USE_SCALE && jd->scale) { unsigned x, y, r, g, b, s, w, a; - uint8_t *op; + gU8 *op; /* Get averaged RGB value of each square correcponds to a pixel */ s = jd->scale * 2; /* Bumber of shifts for averaging */ w = 1 << jd->scale; /* Width of square */ a = (mx - w) * 3; /* Bytes to skip for next line in the square */ - op = (uint8_t*)jd->workbuf; + op = (gU8*)jd->workbuf; for (iy = 0; iy < my; iy += w) { for (ix = 0; ix < mx; ix += w) { - rgb24 = (uint8_t*)jd->workbuf + (iy * mx + ix) * 3; + rgb24 = (gU8*)jd->workbuf + (iy * mx + ix) * 3; r = g = b = 0; for (y = 0; y < w; y++) { /* Accumulate RGB value in the square */ for (x = 0; x < w; x++) { @@ -843,9 +843,9 @@ gdispImageError mcu_output ( } rgb24 += a; } /* Put the averaged RGB value as a pixel */ - *op++ = (uint8_t)(r >> s); - *op++ = (uint8_t)(g >> s); - *op++ = (uint8_t)(b >> s); + *op++ = (gU8)(r >> s); + *op++ = (gU8)(g >> s); + *op++ = (gU8)(b >> s); } } } @@ -853,7 +853,7 @@ gdispImageError mcu_output ( } else { /* For only 1/8 scaling (left-top pixel in each block are the DC value of the block) */ /* Build a 1/8 descaled RGB MCU from discrete comopnents */ - rgb24 = (uint8_t*)jd->workbuf; + rgb24 = (gU8*)jd->workbuf; pc = jd->mcubuf + mx * my; cb = pc[0] - 128; /* Get Cb/Cr component and restore right level */ cr = pc[64] - 128; @@ -875,10 +875,10 @@ gdispImageError mcu_output ( /* Squeeze up pixel table if a part of MCU is to be truncated */ mx >>= jd->scale; if (rx < mx) { - uint8_t *s, *d; + gU8 *s, *d; unsigned x, y; - s = d = (uint8_t*)jd->workbuf; + s = d = (gU8*)jd->workbuf; for (y = 0; y < ry; y++) { for (x = 0; x < rx; x++) { /* Copy effective pixels */ *d++ = *s++; @@ -892,8 +892,8 @@ gdispImageError mcu_output ( #if 0 /* Convert RGB888 to RGB565 if needed */ if (JD_FORMAT == 1) { - uint8_t *s = (uint8_t*)jd->workbuf; - uint16_t w, *d = (uint16_t*)s; + gU8 *s = (gU8*)jd->workbuf; + gU16 w, *d = (gU16*)s; unsigned n = rx * ry; do { @@ -919,12 +919,12 @@ gdispImageError mcu_output ( static gdispImageError restart ( JDEC* jd, /* Pointer to the decompressor object */ - uint16_t rstn /* Expected restert sequense number */ + gU16 rstn /* Expected restert sequense number */ ) { unsigned i, dc; - uint16_t d; - uint8_t *dp; + gU16 d; + gU8 *dp; /* Discard padding bits and get two bytes from the input stream */ @@ -966,9 +966,9 @@ gdispImageError jd_prepare ( gdispImage* img /* I/O device identifier for the session */ ) { - uint8_t *seg, b; - uint16_t marker; - uint32_t ofs; + gU8 *seg, b; + gU16 marker; + gU32 ofs; unsigned n, i, j, len; gdispImageError rc; @@ -1125,11 +1125,11 @@ gdispImageError jd_prepare ( gdispImageError jd_decomp ( JDEC* jd, /* Initialized decompression object */ unsigned (*outfunc)(gdispImage*, void*, JRECT*), /* RGB output function */ - uint8_t scale /* Output de-scaling factor (0 to 3) */ + gU8 scale /* Output de-scaling factor (0 to 3) */ ) { unsigned x, y, mx, my; - uint16_t rst, rsc; + gU16 rst, rsc; gdispImageError rc; diff --git a/src/gdisp/gdisp_image_native.c b/src/gdisp/gdisp_image_native.c index a7f9363f..4735d71f 100644 --- a/src/gdisp/gdisp_image_native.c +++ b/src/gdisp/gdisp_image_native.c @@ -23,8 +23,8 @@ /** * Helper Routines Needed */ -void *gdispImageAlloc(gdispImage *img, size_t sz); -void gdispImageFree(gdispImage *img, void *ptr, size_t sz); +void *gdispImageAlloc(gdispImage *img, gMemSize sz); +void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz); typedef struct gdispImagePrivate_NATIVE { gPixel *frame0cache; @@ -44,7 +44,7 @@ void gdispImageClose_NATIVE(gdispImage *img) { } gdispImageError gdispImageOpen_NATIVE(gdispImage *img) { - uint8_t hdr[HEADER_SIZE_NATIVE]; + gU8 hdr[HEADER_SIZE_NATIVE]; /* Read the 8 byte header */ if (gfileRead(img->f, hdr, 8) != 8) @@ -58,8 +58,8 @@ gdispImageError gdispImageOpen_NATIVE(gdispImage *img) { /* We know we are a native format image */ img->flags = 0; - img->width = (((uint16_t)hdr[2])<<8) | (hdr[3]); - img->height = (((uint16_t)hdr[4])<<8) | (hdr[5]); + img->width = (((gU16)hdr[2])<<8) | (hdr[3]); + img->height = (((gU16)hdr[4])<<8) | (hdr[5]); if (img->width < 1 || img->height < 1) return GDISP_IMAGE_ERR_BADDATA; if (!(img->priv = gdispImageAlloc(img, sizeof(gdispImagePrivate_NATIVE)))) @@ -71,7 +71,7 @@ gdispImageError gdispImageOpen_NATIVE(gdispImage *img) { } gdispImageError gdispImageCache_NATIVE(gdispImage *img) { - size_t len; + gMemSize len; gdispImagePrivate_NATIVE * priv; /* If we are already cached - just return OK */ @@ -95,7 +95,8 @@ gdispImageError gdispImageCache_NATIVE(gdispImage *img) { gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) { gCoord mx, mcx; - size_t pos, len; + gFileSize pos; + gMemSize len; gdispImagePrivate_NATIVE * priv; priv = (gdispImagePrivate_NATIVE *)img->priv; diff --git a/src/gdisp/gdisp_image_png.c b/src/gdisp/gdisp_image_png.c index ed353ce5..4cb3ca07 100644 --- a/src/gdisp/gdisp_image_png.c +++ b/src/gdisp/gdisp_image_png.c @@ -19,21 +19,21 @@ struct PNG_decode; // PNG info (comes from the PNG header) typedef struct PNG_info { - uint8_t flags; // Flags (global) + gU8 flags; // Flags (global) #define PNG_FLG_HEADERDONE 0x01 // The header has been processed #define PNG_FLG_TRANSPARENT 0x02 // Has transparency #define PNG_FLG_INTERLACE 0x04 // Is Interlaced #define PNG_FLG_BACKGROUND 0x08 // Has a specified background color - uint8_t bitdepth; // 1, 2, 4, 8, 16 - uint8_t mode; // The PNG color-mode + gU8 bitdepth; // 1, 2, 4, 8, 16 + gU8 mode; // The PNG color-mode #define PNG_COLORMODE_GRAY 0x00 // Grayscale #define PNG_COLORMODE_RGB 0x02 // RGB #define PNG_COLORMODE_PALETTE 0x03 // Pallete #define PNG_COLORMODE_GRAYALPHA 0x04 // Grayscale with Alpha #define PNG_COLORMODE_RGBA 0x06 // RGBA - uint8_t bpp; // Bits per pixel + gU8 bpp; // Bits per pixel - uint8_t *cache; // The image cache + gU8 *cache; // The image cache unsigned cachesz; // The image cache size void (*out)(struct PNG_decode *); // The scan line output function @@ -42,13 +42,13 @@ typedef struct PNG_info { gColor bg; // The background color #endif #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY - uint16_t trans_r; // Red/grayscale component of the transparent color (PNG_COLORMODE_GRAY and PNG_COLORMODE_RGB only) - uint16_t trans_g; // Green component of the transparent color (PNG_COLORMODE_RGB only) - uint16_t trans_b; // Blue component of the transparent color (PNG_COLORMODE_RGB only) + gU16 trans_r; // Red/grayscale component of the transparent color (PNG_COLORMODE_GRAY and PNG_COLORMODE_RGB only) + gU16 trans_g; // Green component of the transparent color (PNG_COLORMODE_RGB only) + gU16 trans_b; // Blue component of the transparent color (PNG_COLORMODE_RGB only) #endif #if GDISP_NEED_IMAGE_PNG_PALETTE_124 || GDISP_NEED_IMAGE_PNG_PALETTE_8 - uint16_t palsize; // palette size in number of colors - uint8_t *palette; // palette in RGBA RGBA... order (4 bytes per entry - PNG_COLORMODE_PALETTE only) + gU16 palsize; // palette size in number of colors + gU8 *palette; // palette in RGBA RGBA... order (4 bytes per entry - PNG_COLORMODE_PALETTE only) #endif } PNG_info; @@ -56,10 +56,10 @@ typedef struct PNG_info { typedef struct PNG_input { GFILE * f; // The gfile to retrieve data from unsigned buflen; // The number of bytes left in the buffer - uint8_t *pbuf; // The pointer to the next byte - uint32_t chunklen; // The number of bytes left in the current PNG chunk - uint32_t chunknext; // The file position of the next PNG chunk - uint8_t buf[GDISP_IMAGE_PNG_FILE_BUFFER_SIZE]; // Must be a minimum of 8 bytes to hold a chunk header + gU8 *pbuf; // The pointer to the next byte + gU32 chunklen; // The number of bytes left in the current PNG chunk + gU32 chunknext; // The file position of the next PNG chunk + gU8 buf[GDISP_IMAGE_PNG_FILE_BUFFER_SIZE]; // Must be a minimum of 8 bytes to hold a chunk header } PNG_input; // Handle the display output and windowing @@ -77,20 +77,20 @@ typedef struct PNG_output { typedef struct PNG_filter { unsigned scanbytes; unsigned bytewidth; - uint8_t *line; - uint8_t *prev; + gU8 *line; + gU8 *prev; } PNG_filter; // Handle the PNG inflate decompression typedef struct PNG_zTree { - uint16_t table[16]; // Table of code length counts - uint16_t trans[288]; // Code to symbol translation table + gU16 table[16]; // Table of code length counts + gU16 trans[288]; // Code to symbol translation table } PNG_zTree; typedef struct PNG_zinflate { - uint8_t data; // The current input stream data byte - uint8_t bits; // The number of bits left in the data byte - uint8_t flags; // Decompression flags + gU8 data; // The current input stream data byte + gU8 bits; // The number of bits left in the data byte + gU8 flags; // Decompression flags #define PNG_ZFLG_EOF 0x01 // No more input data #define PNG_ZFLG_FINAL 0x02 // This is the final block #define PNG_ZFLG_RESUME_MASK 0x0C // The mask of bits for the resume state @@ -104,8 +104,8 @@ typedef struct PNG_zinflate { PNG_zTree ltree; // The dynamic length tree PNG_zTree dtree; // The dynamic distance tree - uint8_t tmp[288+32]; // Temporary space for decoding dynamic trees and other temporary uses - uint8_t buf[GDISP_IMAGE_PNG_Z_BUFFER_SIZE]; // The decoding buffer and sliding window + gU8 tmp[288+32]; // Temporary space for decoding dynamic trees and other temporary uses + gU8 buf[GDISP_IMAGE_PNG_Z_BUFFER_SIZE]; // The decoding buffer and sliding window } PNG_zinflate; // Put all the decoding structures together. @@ -139,7 +139,7 @@ static void PNG_iInit(PNG_decode *d) { // Load the next byte of image data from the PNG file static gBool PNG_iLoadData(PNG_decode *d) { - uint32_t sz; + gU32 sz; // Is there data still left in the buffer? if (d->i.buflen) @@ -188,7 +188,7 @@ gotchunk: } // Get the last loaded byte of image data from the PNG file -static uint8_t PNG_iGetByte(PNG_decode *d) { +static gU8 PNG_iGetByte(PNG_decode *d) { d->i.buflen--; return *d->i.pbuf++; } @@ -338,9 +338,9 @@ static unsigned PNG_zGetBits(PNG_decode *d, unsigned num) { } // Build an inflate dynamic tree using a string of byte lengths -static void PNG_zBuildTree(PNG_zTree *t, const uint8_t *lengths, unsigned num) { +static void PNG_zBuildTree(PNG_zTree *t, const gU8 *lengths, unsigned num) { unsigned i, sum; - uint16_t offs[16]; + gU16 offs[16]; for (i = 0; i < 16; ++i) t->table[i] = 0; @@ -360,7 +360,7 @@ static void PNG_zBuildTree(PNG_zTree *t, const uint8_t *lengths, unsigned num) { } // Get an inflate decode symbol -static uint16_t PNG_zGetSymbol(PNG_decode *d, PNG_zTree *t) { +static gU16 PNG_zGetSymbol(PNG_decode *d, PNG_zTree *t) { int sum, cur; unsigned len; @@ -401,11 +401,11 @@ static void PNG_zBuildFixedTrees(PNG_decode *d) { // Build inflate dynamic length and distance trees static gBool PNG_zDecodeTrees(PNG_decode *d) { - static const uint8_t IndexLookup[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + static const gU8 IndexLookup[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; unsigned hlit, hdist, hclen; unsigned i, num; - uint16_t symbol; - uint8_t val; + gU16 symbol; + gU8 val; hlit = PNG_zGetBits(d, 5) + 257; // 257 - 286 hdist = PNG_zGetBits(d, 5) + 1; // 1 - 32 @@ -501,7 +501,7 @@ static gBool PNG_zUncompressedBlock(PNG_decode *d) { length = gdispImageGetAlignedLE16(d->z.tmp, 0); // Check length - if ((uint16_t)length != (uint16_t)~gdispImageGetAlignedLE16(d->z.tmp, 2)) { + if ((gU16)length != (gU16)~gdispImageGetAlignedLE16(d->z.tmp, 2)) { d->z.flags |= PNG_ZFLG_EOF; return gFalse; } @@ -512,12 +512,12 @@ static gBool PNG_zUncompressedBlock(PNG_decode *d) { // Inflate a compressed inflate block into the output static gBool PNG_zInflateBlock(PNG_decode *d) { - static const uint8_t lbits[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 6 }; - static const uint16_t lbase[30] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 323 }; - static const uint8_t dbits[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; - static const uint16_t dbase[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; + static const gU8 lbits[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 6 }; + static const gU16 lbase[30] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 323 }; + static const gU8 dbits[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; + static const gU16 dbase[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; unsigned length, dist, offset; - uint16_t symbol; + gU16 symbol; while(1) { symbol = PNG_zGetSymbol(d, &d->z.ltree); // EOF? @@ -532,7 +532,7 @@ static gBool PNG_zInflateBlock(PNG_decode *d) { if (symbol < 256) { // The symbol is the data - d->z.buf[d->z.bufend++] = (uint8_t)symbol; + d->z.buf[d->z.bufend++] = (gU8)symbol; WRAP_ZBUF(d->z.bufend); if (d->z.bufend == d->z.bufpos) { // Buffer full? d->z.flags = (d->z.flags & ~PNG_ZFLG_RESUME_MASK) | PNG_ZFLG_RESUME_INFLATE; @@ -643,8 +643,8 @@ static gBool PNG_zResumeOffset(PNG_decode *d, unsigned length, unsigned offset) } // Get a fully decompressed byte from the inflate data stream -static uint8_t PNG_zGetByte(PNG_decode *d) { - uint8_t data; +static gU8 PNG_zGetByte(PNG_decode *d) { + gU8 data; // Do we have any data in the buffers while (d->z.bufpos == d->z.bufend) { @@ -688,7 +688,7 @@ static uint8_t PNG_zGetByte(PNG_decode *d) { *---------------------------------------------------------------*/ // Initialise the scan-line engine -static void PNG_fInit(PNG_filter *f, uint8_t *buf, unsigned bytewidth, unsigned scanbytes) { +static void PNG_fInit(PNG_filter *f, gU8 *buf, unsigned bytewidth, unsigned scanbytes) { f->scanbytes = scanbytes; f->bytewidth = bytewidth; f->line = buf; @@ -707,21 +707,21 @@ static void PNG_fNext(PNG_filter *f) { } // Predictor function for filter0 mode 4 -static uint8_t PNG_fCalcPath(uint16_t a, uint16_t b, uint16_t c) { - uint16_t pa = b > c ? (b - c) : (c - b); - uint16_t pb = a > c ? (a - c) : (c - a); - uint16_t pc = a + b > c + c ? (a + b - c - c) : (c + c - a - b); +static gU8 PNG_fCalcPath(gU16 a, gU16 b, gU16 c) { + gU16 pa = b > c ? (b - c) : (c - b); + gU16 pb = a > c ? (a - c) : (c - a); + gU16 pc = a + b > c + c ? (a + b - c - c) : (c + c - a - b); if (pc < pa && pc < pb) - return (uint8_t)c; + return (gU8)c; if (pb < pa) - return (uint8_t)b; - return (uint8_t)a; + return (gU8)b; + return (gU8)a; } // Scan-line filter type 0 static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 - uint8_t ft; + gU8 ft; unsigned i; // Get the filter type and check for validity (eg not EOF) @@ -781,15 +781,15 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 static void PNG_OutGRAY124(PNG_decode *d) { unsigned i; PNG_info *pinfo; - uint8_t px; - uint8_t bits; + gU8 px; + gU8 bits; pinfo = d->pinfo; for(i = 0; i < d->f.scanbytes; i++) { for(bits = 8; bits; bits -= pinfo->bitdepth) { px = (d->f.line[i] >> (bits - pinfo->bitdepth)) & ((1U << pinfo->bitdepth)-1); #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY - if ((pinfo->flags & PNG_FLG_TRANSPARENT) && (uint16_t)px == pinfo->trans_r) { + if ((pinfo->flags & PNG_FLG_TRANSPARENT) && (gU16)px == pinfo->trans_r) { #if GDISP_NEED_IMAGE_PNG_BACKGROUND if ((pinfo->flags & PNG_FLG_BACKGROUND)) { PNG_oColor(&d->o, pinfo->bg); @@ -810,7 +810,7 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 #if GDISP_NEED_IMAGE_PNG_GRAYSCALE_8 static void PNG_OutGRAY8(PNG_decode *d) { unsigned i; - uint8_t px; + gU8 px; #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY PNG_info *pinfo = d->pinfo; #endif @@ -818,7 +818,7 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 for(i = 0; i < d->f.scanbytes; i++) { px = d->f.line[i]; #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY - if ((pinfo->flags & PNG_FLG_TRANSPARENT) && (uint16_t)px == pinfo->trans_r) { + if ((pinfo->flags & PNG_FLG_TRANSPARENT) && (gU16)px == pinfo->trans_r) { #if GDISP_NEED_IMAGE_PNG_BACKGROUND if ((pinfo->flags & PNG_FLG_BACKGROUND)) { PNG_oColor(&d->o, pinfo->bg); @@ -836,7 +836,7 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 #if GDISP_NEED_IMAGE_PNG_GRAYSCALE_16 static void PNG_OutGRAY16(PNG_decode *d) { unsigned i; - uint8_t px; + gU8 px; #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY PNG_info *pinfo = d->pinfo; #endif @@ -869,9 +869,9 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 for(i = 0; i < d->f.scanbytes; i+=3) { #if GDISP_NEED_IMAGE_PNG_TRANSPARENCY if ((pinfo->flags & PNG_FLG_TRANSPARENT) - && (uint16_t)d->f.line[i+0] == pinfo->trans_r - && (uint16_t)d->f.line[i+1] == pinfo->trans_g - && (uint16_t)d->f.line[i+2] == pinfo->trans_b) { + && (gU16)d->f.line[i+0] == pinfo->trans_r + && (gU16)d->f.line[i+1] == pinfo->trans_g + && (gU16)d->f.line[i+2] == pinfo->trans_b) { #if GDISP_NEED_IMAGE_PNG_BACKGROUND if ((pinfo->flags & PNG_FLG_BACKGROUND)) { PNG_oColor(&d->o, pinfo->bg); @@ -918,14 +918,14 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 unsigned i; PNG_info *pinfo; unsigned idx; - uint8_t bits; + gU8 bits; pinfo = d->pinfo; for(i = 0; i < d->f.scanbytes; i++) { for(bits = 8; bits; bits -= pinfo->bitdepth) { idx = (d->f.line[i] >> (bits - pinfo->bitdepth)) & ((1U << pinfo->bitdepth)-1); - if ((uint16_t)idx >= pinfo->palsize) { + if ((gU16)idx >= pinfo->palsize) { PNG_oColor(&d->o, RGB2COLOR(0, 0, 0)); continue; } @@ -967,7 +967,7 @@ static gBool PNG_unfilter_type0(PNG_decode *d) { // PNG filter method 0 for(i = 0; i < d->f.scanbytes; i++) { idx = (unsigned)d->f.line[i]; - if ((uint16_t)idx >= pinfo->palsize) { + if ((gU16)idx >= pinfo->palsize) { PNG_oColor(&d->o, RGB2COLOR(0, 0, 0)); continue; } @@ -1143,9 +1143,9 @@ void gdispImageClose_PNG(gdispImage *img) { gdispImageError gdispImageOpen_PNG(gdispImage *img) { PNG_info *pinfo; - uint32_t pos; - uint32_t len; - uint8_t buf[13]; + gU32 pos; + gU32 len; + gU8 buf[13]; /* Read the file identifier */ if (gfileRead(img->f, buf, 8) != 8) @@ -1199,9 +1199,9 @@ gdispImageError gdispImageOpen_PNG(gdispImage *img) { img->width = gdispImageGetAlignedBE16(buf, 2); img->height = gdispImageGetAlignedBE16(buf, 6); - pinfo->bitdepth = gdispImageGetVar(uint8_t, buf, 8); - pinfo->mode = gdispImageGetVar(uint8_t, buf, 9); - if (gdispImageGetVar(uint8_t, buf, 12)) { + pinfo->bitdepth = gdispImageGetVar(gU8, buf, 8); + pinfo->mode = gdispImageGetVar(gU8, buf, 9); + if (gdispImageGetVar(gU8, buf, 12)) { pinfo->flags |= PNG_FLG_INTERLACE; #if !GDISP_NEED_IMAGE_PNG_INTERLACED goto exit_unsupported; @@ -1209,11 +1209,11 @@ gdispImageError gdispImageOpen_PNG(gdispImage *img) { } // Check width and height, filter, compression and interlacing - if (gdispImageGetVar(uint16_t, buf, 0) != 0 || img->width <= 0 // width - || gdispImageGetVar(uint16_t, buf, 4) != 0 || img->height <= 0 // height - || gdispImageGetVar(uint8_t, buf, 10) != 0 // compression - || gdispImageGetVar(uint8_t, buf, 11) != 0 // filter - || gdispImageGetVar(uint8_t, buf, 12) > 1 // interlace + if (gdispImageGetVar(gU16, buf, 0) != 0 || img->width <= 0 // width + || gdispImageGetVar(gU16, buf, 4) != 0 || img->height <= 0 // height + || gdispImageGetVar(gU8, buf, 10) != 0 // compression + || gdispImageGetVar(gU8, buf, 11) != 0 // filter + || gdispImageGetVar(gU8, buf, 12) > 1 // interlace ) goto exit_unsupported; @@ -1343,8 +1343,8 @@ gdispImageError gdispImageOpen_PNG(gdispImage *img) { // Read the palette { - uint16_t idx; - uint8_t *p; + gU16 idx; + gU8 *p; for(idx=pinfo->palsize, p=pinfo->palette; idx; p += 4, idx--) { if (gfileRead(img->f, p, 3) != 3) @@ -1373,8 +1373,8 @@ gdispImageError gdispImageOpen_PNG(gdispImage *img) { // Adjust the palette { - uint16_t idx; - uint8_t *p; + gU16 idx; + gU8 *p; for(idx=len, p=pinfo->palette+3; idx; p += 4, idx--) { if (gfileRead(img->f, p, 1) != 1) @@ -1427,7 +1427,7 @@ gdispImageError gdispImageOpen_PNG(gdispImage *img) { #if GDISP_NEED_IMAGE_PNG_PALETTE_124 || GDISP_NEED_IMAGE_PNG_PALETTE_8 case PNG_COLORMODE_PALETTE: - if (!pinfo->palette || len < 1 || gfileRead(img->f, buf, 1) != 1 || (uint16_t)buf[0] >= pinfo->palsize) + if (!pinfo->palette || len < 1 || gfileRead(img->f, buf, 1) != 1 || (gU16)buf[0] >= pinfo->palsize) goto exit_baddata; pinfo->bg = RGB2COLOR(pinfo->palette[((unsigned)buf[0])*4+0], pinfo->palette[((unsigned)buf[0])*4+1], @@ -1526,7 +1526,7 @@ gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoo #endif { // Non-interlaced decoding - PNG_fInit(&d->f, (uint8_t *)(d+1), (pinfo->bpp + 7) / 8, (img->width * pinfo->bpp + 7) / 8); + PNG_fInit(&d->f, (gU8 *)(d+1), (pinfo->bpp + 7) / 8, (img->width * pinfo->bpp + 7) / 8); for(y = 0; y < sy+cy; PNG_fNext(&d->f), y++) { if (!PNG_unfilter_type0(d)) goto exit_baddata; @@ -1550,8 +1550,8 @@ gdispImageError gdispImageCache_PNG(gdispImage *img) { PNG_info *pinfo; unsigned chunknext; unsigned chunklen; - uint8_t *pcache; - uint8_t buf[8]; + gU8 *pcache; + gU8 buf[8]; // If we are already cached - just return OK pinfo = (PNG_info *)img->priv; diff --git a/src/gdisp/gdisp_image_support.h b/src/gdisp/gdisp_image_support.h index d64eef5b..5a114fc6 100644 --- a/src/gdisp/gdisp_image_support.h +++ b/src/gdisp/gdisp_image_support.h @@ -18,50 +18,50 @@ #define _GDISP_IMAGE_SUPPORT_H /* Base endian handling routines */ -#define gdispImageGetVar(type, p, idx) (*(type *)(((uint8_t *)(p))+(idx))) -#define gdispImageGetByte(type, p, idx, shift) (((type)gdispImageGetVar(uint8_t, p, idx))<<(shift)) -#define gdispImageSwap16(w) ((((uint16_t)(w))>>8)|(((uint16_t)(w))<<8)) -#define gdispImageSwap32(dw) ((((uint32_t)(dw))>>24)|((((uint32_t)(dw))&0x00FF0000)>>8)\ - |((((uint32_t)(dw))&0x0000FF00)<<8)|(((uint32_t)(dw))<<24)) -#define gdispImageSwapWords32(dw) ((((uint32_t)(dw))>>16)|(((uint32_t)(dw))<<16)) -#define gdispImageSwapBytes32(dw) (((((uint32_t)(dw))&0xFF000000)>>8)|((((uint32_t)(dw))&0x00FF0000)<<8)\ - |((((uint32_t)(dw))&0x0000FF00)>>8)|(((uint32_t)(dw))<<8)) +#define gdispImageGetVar(type, p, idx) (*(type *)(((gU8 *)(p))+(idx))) +#define gdispImageGetByte(type, p, idx, shift) (((type)gdispImageGetVar(gU8, p, idx))<<(shift)) +#define gdispImageSwap16(w) ((((gU16)(w))>>8)|(((gU16)(w))<<8)) +#define gdispImageSwap32(dw) ((((gU32)(dw))>>24)|((((gU32)(dw))&0x00FF0000)>>8)\ + |((((gU32)(dw))&0x0000FF00)<<8)|(((gU32)(dw))<<24)) +#define gdispImageSwapWords32(dw) ((((gU32)(dw))>>16)|(((gU32)(dw))<<16)) +#define gdispImageSwapBytes32(dw) (((((gU32)(dw))&0xFF000000)>>8)|((((gU32)(dw))&0x00FF0000)<<8)\ + |((((gU32)(dw))&0x0000FF00)>>8)|(((gU32)(dw))<<8)) /* - * Get a uint16_t/uint32_t from memory in the required endianness. + * Get a gU16/gU32 from memory in the required endianness. * There is no alignment requirement. */ #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_LITTLE && GFX_CPU_NO_ALIGNMENT_FAULTS - #define gdispImageGetLE16(p, idx) gdispImageGetVar(uint16_t, (p), (idx)) - #define gdispImageGetLE32(p, idx) gdispImageGetVar(uint32_t, (p), (idx)) + #define gdispImageGetLE16(p, idx) gdispImageGetVar(gU16, (p), (idx)) + #define gdispImageGetLE32(p, idx) gdispImageGetVar(gU32, (p), (idx)) #else - #define gdispImageGetLE16(p, idx) ( gdispImageGetByte(uint16_t, (p), (idx) , 0) | gdispImageGetByte(uint16_t, (p), (idx)+1, 8)) - #define gdispImageGetLE32(p, idx) ( gdispImageGetByte(uint32_t, (p), (idx) , 0) | gdispImageGetByte(uint32_t, (p), (idx)+1, 8)\ - |gdispImageGetByte(uint32_t, (p), (idx)+2, 16) | gdispImageGetByte(uint32_t, (p), (idx)+3, 24)) + #define gdispImageGetLE16(p, idx) ( gdispImageGetByte(gU16, (p), (idx) , 0) | gdispImageGetByte(gU16, (p), (idx)+1, 8)) + #define gdispImageGetLE32(p, idx) ( gdispImageGetByte(gU32, (p), (idx) , 0) | gdispImageGetByte(gU32, (p), (idx)+1, 8)\ + |gdispImageGetByte(gU32, (p), (idx)+2, 16) | gdispImageGetByte(gU32, (p), (idx)+3, 24)) #endif #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_BIG && GFX_CPU_NO_ALIGNMENT_FAULTS - #define gdispImageGetBE16(p, idx) gdispImageGetVar(uint16_t, (p), (idx)) - #define gdispImageGetBE32(p, idx) gdispImageGetVar(uint32_t, (p), (idx)) + #define gdispImageGetBE16(p, idx) gdispImageGetVar(gU16, (p), (idx)) + #define gdispImageGetBE32(p, idx) gdispImageGetVar(gU32, (p), (idx)) #else - #define gdispImageGetBE16(p, idx) ( gdispImageGetByte(uint16_t, (p), (idx) , 8) | gdispImageGetByte(uint16_t, (p), (idx)+1, 0)) - #define gdispImageGetBE32(p, idx) ( gdispImageGetByte(uint32_t, (p), (idx) , 24) | gdispImageGetByte(uint32_t, (p), (idx)+1, 16)\ - |gdispImageGetByte(uint32_t, (p), (idx)+2, 8) | gdispImageGetByte(uint32_t, (p), (idx)+3, 0)) + #define gdispImageGetBE16(p, idx) ( gdispImageGetByte(gU16, (p), (idx) , 8) | gdispImageGetByte(gU16, (p), (idx)+1, 0)) + #define gdispImageGetBE32(p, idx) ( gdispImageGetByte(gU32, (p), (idx) , 24) | gdispImageGetByte(gU32, (p), (idx)+1, 16)\ + |gdispImageGetByte(gU32, (p), (idx)+2, 8) | gdispImageGetByte(gU32, (p), (idx)+3, 0)) #endif /* - * Get a uint16_t/uint32_t from memory in the required endianness. + * Get a gU16/gU32 from memory in the required endianness. * These are optimised routines but the memory must be word/dword aligned. */ #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_LITTLE - #define gdispImageGetAlignedLE16(p, idx) gdispImageGetVar(uint16_t, (p), (idx)) + #define gdispImageGetAlignedLE16(p, idx) gdispImageGetVar(gU16, (p), (idx)) #define gdispImageGetAlignedBE16(p, idx) gdispImageGetBE16(p, (idx)) - #define gdispImageGetAlignedLE32(p, idx) gdispImageGetVar(uint32_t, (p), (idx)) + #define gdispImageGetAlignedLE32(p, idx) gdispImageGetVar(gU32, (p), (idx)) #define gdispImageGetAlignedBE32(p, idx) gdispImageGetBE32(p, (idx)) #elif GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_BIG #define gdispImageGetAlignedLE16(p, idx) gdispImageGetLE16(p, (idx)) - #define gdispImageGetAlignedBE16(p, idx) gdispImageGetVar(uint16_t, (p), (idx)) + #define gdispImageGetAlignedBE16(p, idx) gdispImageGetVar(gU16, (p), (idx)) #define gdispImageGetAlignedLE32(p, idx) gdispImageGetLE32(p, (idx)) - #define gdispImageGetAlignedBE32(p, idx) gdispImageGetVar(uint32_t, (p), (idx)) + #define gdispImageGetAlignedBE32(p, idx) gdispImageGetVar(gU32, (p), (idx)) #else #define gdispImageGetAlignedLE16(p, idx) gdispImageGetLE16(p, (idx)) #define gdispImageGetAlignedBE16(p, idx) gdispImageGetBE16(p, (idx)) @@ -109,10 +109,10 @@ #define gdispImageMakeLE32(dw) { dw = gdispImageH32toLE32(dw); } #define gdispImageMakeBE32(dw) { dw = gdispImageH32toBE32(dw); } #else - uint16_t gdispImageH16toLE16(uint16_t w); - uint16_t gdispImageH16toBE16(uint16_t w); - uint32_t gdispImageH32toLE32(uint32_t dw); - uint32_t gdispImageH32toBE32(uint32_t dw); + gU16 gdispImageH16toLE16(gU16 w); + gU16 gdispImageH16toBE16(gU16 w); + gU32 gdispImageH32toLE32(gU32 dw); + gU32 gdispImageH32toBE32(gU32 dw); #define gdispImageMakeLE16(w) { w = gdispImageH16toLE16(w); } #define gdispImageMakeBE16(w) { w = gdispImageH16toBE16(w); } #define gdispImageMakeLE32(dw) { dw = gdispImageH32toLE32(dw); } @@ -120,11 +120,11 @@ #endif -void *gdispImageAlloc(gdispImage *img, size_t sz); -void gdispImageFree(gdispImage *img, void *ptr, size_t sz); +void *gdispImageAlloc(gdispImage *img, gMemSize sz); +void gdispImageFree(gdispImage *img, void *ptr, gMemSize sz); #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_UNKNOWN - extern const uint8_t gdispImageEndianArray[4]; + extern const gU8 gdispImageEndianArray[4]; #endif #endif /* _GDISP_IMAGE_SUPPORT_H */ diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c index 339e5cd2..c6a1e21e 100644 --- a/src/gdisp/gdisp_pixmap.c +++ b/src/gdisp/gdisp_pixmap.c @@ -44,7 +44,7 @@ typedef struct pixmap { #if GDISP_NEED_PIXMAP_IMAGE - uint8_t imghdr[8]; // This field must come just before the data member. + gU8 imghdr[8]; // This field must come just before the data member. #endif gColor pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard. } pixmap; @@ -67,12 +67,12 @@ GDisplay *gdispPixmapCreate(gCoord width, gCoord height) { #if GDISP_NEED_PIXMAP_IMAGE p->imghdr[0] = 'N'; p->imghdr[1] = 'I'; - p->imghdr[2] = (uint8_t)(width >> 8); - p->imghdr[3] = (uint8_t)width; - p->imghdr[4] = (uint8_t)(height >> 8); - p->imghdr[5] = (uint8_t)height; - p->imghdr[6] = (uint8_t)(GDISP_PIXELFORMAT >> 8); - p->imghdr[7] = (uint8_t)(GDISP_PIXELFORMAT); + p->imghdr[2] = (gU8)(width >> 8); + p->imghdr[3] = (gU8)width; + p->imghdr[4] = (gU8)(height >> 8); + p->imghdr[5] = (gU8)height; + p->imghdr[6] = (gU8)(GDISP_PIXELFORMAT >> 8); + p->imghdr[7] = (gU8)(GDISP_PIXELFORMAT); #endif // Save the width and height so the driver can retrieve it. diff --git a/src/gdisp/mcufont/mf_bwfont.c b/src/gdisp/mcufont/mf_bwfont.c index a17a1673..b2b17a21 100644 --- a/src/gdisp/mcufont/mf_bwfont.c +++ b/src/gdisp/mcufont/mf_bwfont.c @@ -13,7 +13,7 @@ /* Find the character range and index that contains a given glyph.. */ static const struct mf_bwfont_char_range_s *find_char_range( - const struct mf_bwfont_s *font, uint16_t character, uint16_t *index_ret) + const struct mf_bwfont_s *font, gU16 character, gU16 *index_ret) { unsigned i, index; const struct mf_bwfont_char_range_s *range; @@ -31,7 +31,7 @@ static const struct mf_bwfont_char_range_s *find_char_range( return 0; } -static uint8_t get_width(const struct mf_bwfont_char_range_s *r, uint16_t index) +static gU8 get_width(const struct mf_bwfont_char_range_s *r, gU16 index) { if (r->width) { @@ -43,15 +43,15 @@ static uint8_t get_width(const struct mf_bwfont_char_range_s *r, uint16_t index) } } -static uint8_t render_char(const struct mf_bwfont_char_range_s *r, - int16_t x0, int16_t y0, uint16_t index, +static gU8 render_char(const struct mf_bwfont_char_range_s *r, + gI16 x0, gI16 y0, gU16 index, mf_pixel_callback_t callback, void *state) { - const uint8_t *data, *p; - uint8_t stride, runlen; - uint8_t x, y, height, num_cols; - uint8_t bit, byte, mask; + const gU8 *data, *p; + gU8 stride, runlen; + gU8 x, y, height, num_cols; + gU8 bit, byte, mask; bool oldstate, newstate; if (r->width) @@ -112,15 +112,15 @@ static uint8_t render_char(const struct mf_bwfont_char_range_s *r, return get_width(r, index); } -uint8_t mf_bwfont_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +gU8 mf_bwfont_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state) { const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font; const struct mf_bwfont_char_range_s *range; - uint16_t index; + gU16 index; range = find_char_range(bwfont, character, &index); if (!range) @@ -129,12 +129,12 @@ uint8_t mf_bwfont_render_character(const struct mf_font_s *font, return render_char(range, x0, y0, index, callback, state); } -uint8_t mf_bwfont_character_width(const struct mf_font_s *font, - uint16_t character) +gU8 mf_bwfont_character_width(const struct mf_font_s *font, + gU16 character) { const struct mf_bwfont_s *bwfont = (const struct mf_bwfont_s*)font; const struct mf_bwfont_char_range_s *range; - uint16_t index; + gU16 index; range = find_char_range(bwfont, character, &index); if (!range) diff --git a/src/gdisp/mcufont/mf_bwfont.h b/src/gdisp/mcufont/mf_bwfont.h index 537ba22e..e8de21a7 100644 --- a/src/gdisp/mcufont/mf_bwfont.h +++ b/src/gdisp/mcufont/mf_bwfont.h @@ -21,37 +21,37 @@ struct mf_bwfont_char_range_s { /* The number of the first character in this range. */ - uint16_t first_char; + gU16 first_char; /* The total count of characters in this range. */ - uint16_t char_count; + gU16 char_count; /* The left and top skips of the characters in this range. * This is the number of empty rows at left and at top. */ - uint8_t offset_x; - uint8_t offset_y; + gU8 offset_x; + gU8 offset_y; /* Column height for glyphs in this range, in bytes and pixels. */ - uint8_t height_bytes; - uint8_t height_pixels; + gU8 height_bytes; + gU8 height_pixels; /* Positive value if the width of all glyphs in this range is the * same, or zero if it is not. */ - uint8_t width; + gU8 width; /* Lookup table for the character widths. NULL if width is specified. */ - const uint8_t *glyph_widths; + const gU8 *glyph_widths; /* Lookup table for the character offsets. Multiply by height_bytes * to get the byte offset. Also allows lookup of the number of columns. * NULL if width is specified. */ - const uint16_t *glyph_offsets; + const gU16 *glyph_offsets; /* Table for the glyph data. * The data for each glyph is column-by-column, with N bytes per each * column. The LSB of the first byte is the top left pixel. */ - const uint8_t *glyph_data; + const gU8 *glyph_data; }; /* Structure for the font */ @@ -60,10 +60,10 @@ struct mf_bwfont_s struct mf_font_s font; /* Version of the font format. */ - const uint8_t version; + const gU8 version; /* Number of character ranges. */ - const uint16_t char_range_count; + const gU16 char_range_count; /* Array of the character ranges */ const struct mf_bwfont_char_range_s *char_ranges; @@ -71,14 +71,14 @@ struct mf_bwfont_s #ifdef MF_BWFONT_INTERNALS /* Internal functions, don't use these directly. */ -MF_EXTERN uint8_t mf_bwfont_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +MF_EXTERN gU8 mf_bwfont_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state); -MF_EXTERN uint8_t mf_bwfont_character_width(const struct mf_font_s *font, - uint16_t character); +MF_EXTERN gU8 mf_bwfont_character_width(const struct mf_font_s *font, + gU16 character); #endif #endif diff --git a/src/gdisp/mcufont/mf_encoding.c b/src/gdisp/mcufont/mf_encoding.c index afa16b18..ba9fc7c0 100644 --- a/src/gdisp/mcufont/mf_encoding.c +++ b/src/gdisp/mcufont/mf_encoding.c @@ -13,9 +13,9 @@ mf_char mf_getchar(mf_str *str) { - uint8_t c; - uint8_t tmp, seqlen; - uint16_t result; + gU8 c; + gU8 tmp, seqlen; + gU16 result; c = **str; if (!c) diff --git a/src/gdisp/mcufont/mf_encoding.h b/src/gdisp/mcufont/mf_encoding.h index 18ffb892..7c49f02a 100644 --- a/src/gdisp/mcufont/mf_encoding.h +++ b/src/gdisp/mcufont/mf_encoding.h @@ -20,9 +20,9 @@ /* Type used to represent characters internally. */ #if MF_ENCODING == MF_ENCODING_ASCII typedef char mf_char; - #define MFCHAR2UINT16(c) ((uint16_t)(uint8_t)(c)) + #define MFCHAR2UINT16(c) ((gU16)(gU8)(c)) #else - typedef uint16_t mf_char; + typedef gU16 mf_char; #define MFCHAR2UINT16(c) (c) #endif @@ -32,7 +32,7 @@ typedef const char * mf_str; #elif MF_ENCODING == MF_ENCODING_UTF8 typedef const char * mf_str; #elif MF_ENCODING == MF_ENCODING_UTF16 -typedef const uint16_t * mf_str; +typedef const gU16 * mf_str; #elif MF_ENCODING == MF_ENCODING_WCHAR #include typedef const wchar_t * mf_str; diff --git a/src/gdisp/mcufont/mf_font.c b/src/gdisp/mcufont/mf_font.c index 9a313f8c..09182b56 100644 --- a/src/gdisp/mcufont/mf_font.c +++ b/src/gdisp/mcufont/mf_font.c @@ -26,13 +26,13 @@ #include MF_FONT_FILE_NAME /* Include fonts end here */ -uint8_t mf_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, +gU8 mf_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, mf_char character, mf_pixel_callback_t callback, void *state) { - uint8_t width; + gU8 width; width = font->render_character(font, x0, y0, MFCHAR2UINT16(character), callback, state); if (!width) @@ -44,10 +44,10 @@ uint8_t mf_render_character(const struct mf_font_s *font, return width; } -uint8_t mf_character_width(const struct mf_font_s *font, +gU8 mf_character_width(const struct mf_font_s *font, mf_char character) { - uint8_t width; + gU8 width; width = font->character_width(font, MFCHAR2UINT16(character)); if (!width) diff --git a/src/gdisp/mcufont/mf_font.h b/src/gdisp/mcufont/mf_font.h index 1812d576..b69cc782 100644 --- a/src/gdisp/mcufont/mf_font.h +++ b/src/gdisp/mcufont/mf_font.h @@ -22,8 +22,8 @@ * alpha: The "opaqueness" of the pixels, 0 for background, 255 for text. * state: Free variable that was passed to render_character(). */ -typedef void (*mf_pixel_callback_t) (int16_t x, int16_t y, uint8_t count, - uint8_t alpha, void *state); +typedef void (*mf_pixel_callback_t) (gI16 x, gI16 y, gU8 count, + gU8 alpha, void *state); /* General information about a font. */ struct mf_font_s @@ -35,35 +35,35 @@ struct mf_font_s const char *short_name; /* Width and height of the character bounding box. */ - uint8_t width; - uint8_t height; + gU8 width; + gU8 height; /* Minimum and maximum tracking width of characters. */ - uint8_t min_x_advance; - uint8_t max_x_advance; + gU8 min_x_advance; + gU8 max_x_advance; /* Location of the text baseline relative to character. */ - int8_t baseline_x; - uint8_t baseline_y; + gI8 baseline_x; + gU8 baseline_y; /* Line height of the font (vertical advance). */ - uint8_t line_height; + gU8 line_height; /* Flags identifying various aspects of the font. */ - uint8_t flags; + gU8 flags; /* Fallback character to use for missing glyphs. */ - uint16_t fallback_character; + gU16 fallback_character; /* Function to get character width. Should return 0 if character is * not found. */ - uint8_t (*character_width)(const struct mf_font_s *font, uint16_t character); + gU8 (*character_width)(const struct mf_font_s *font, gU16 character); /* Function to render a character. Returns the character width or 0 if * character is not found. */ - uint8_t (*render_character)(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, + gU8 (*render_character)(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state); }; @@ -90,8 +90,8 @@ struct mf_font_list_s * * Returns width of the character. */ -MF_EXTERN uint8_t mf_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, +MF_EXTERN gU8 mf_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, mf_char character, mf_pixel_callback_t callback, void *state); @@ -105,7 +105,7 @@ MF_EXTERN uint8_t mf_render_character(const struct mf_font_s *font, * * Returns width of the character in pixels. */ -MF_EXTERN uint8_t mf_character_width(const struct mf_font_s *font, +MF_EXTERN gU8 mf_character_width(const struct mf_font_s *font, mf_char character); /* Find a font based on name. The name can be either short name or full name. diff --git a/src/gdisp/mcufont/mf_justify.c b/src/gdisp/mcufont/mf_justify.c index 5314ab45..58f87cc3 100644 --- a/src/gdisp/mcufont/mf_justify.c +++ b/src/gdisp/mcufont/mf_justify.c @@ -12,10 +12,10 @@ #if MF_USE_TABS /* Round the X coordinate up to the nearest tab stop. */ -static int16_t mf_round_to_tab(const struct mf_font_s *font, - int16_t x0, int16_t x) +static gI16 mf_round_to_tab(const struct mf_font_s *font, + gI16 x0, gI16 x) { - int16_t tabw, dx; + gI16 tabw, dx; tabw = mf_character_width(font, 'm') * MF_TABSIZE; @@ -30,10 +30,10 @@ static int16_t mf_round_to_tab(const struct mf_font_s *font, } /* Round the X coordinate down to the nearest tab stop. */ -static int16_t mf_round_to_prev_tab(const struct mf_font_s *font, - int16_t x0, int16_t x) +static gI16 mf_round_to_prev_tab(const struct mf_font_s *font, + gI16 x0, gI16 x) { - int16_t tabw, dx; + gI16 tabw, dx; tabw = mf_character_width(font, 'm') * MF_TABSIZE; @@ -48,11 +48,11 @@ static int16_t mf_round_to_prev_tab(const struct mf_font_s *font, } #endif -int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text, - uint16_t count, bool kern) +gI16 mf_get_string_width(const struct mf_font_s *font, mf_str text, + gU16 count, bool kern) { - int16_t result = 0; - uint16_t c1 = 0, c2; + gI16 result = 0; + gU16 c1 = 0, c2; if (!count) count = 0xFFFF; @@ -83,9 +83,9 @@ int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text, } /* Return the length of the string without trailing spaces. */ -static uint16_t strip_spaces(mf_str text, uint16_t count, mf_char *last_char) +static gU16 strip_spaces(mf_str text, gU16 count, mf_char *last_char) { - uint16_t i = 0, result = 0; + gU16 i = 0, result = 0; mf_char tmp = 0; if (!count) @@ -115,12 +115,12 @@ static uint16_t strip_spaces(mf_str text, uint16_t count, mf_char *last_char) /* Render left-aligned string, left edge at x0. */ static void render_left(const struct mf_font_s *font, - int16_t x0, int16_t y0, - mf_str text, uint16_t count, + gI16 x0, gI16 y0, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { - int16_t x; + gI16 x; mf_char c1 = 0, c2; x = x0 - font->baseline_x; @@ -150,13 +150,13 @@ static void render_left(const struct mf_font_s *font, #if !MF_USE_ALIGN void mf_render_aligned(const struct mf_font_s *font, - int16_t x0, int16_t y0, + gI16 x0, gI16 y0, enum mf_align_t align, - mf_str text, uint16_t count, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { - int16_t string_width; + gI16 string_width; count = strip_spaces(text, count, 0); render_left(font, x0, y0, text, count, callback, state); } @@ -165,13 +165,13 @@ void mf_render_aligned(const struct mf_font_s *font, /* Render right-aligned string, right edge at x0. */ static void render_right(const struct mf_font_s *font, - int16_t x0, int16_t y0, - mf_str text, uint16_t count, + gI16 x0, gI16 y0, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { - int16_t x; - uint16_t i; + gI16 x; + gU16 i; mf_char c1, c2 = 0; mf_str tmp; @@ -211,13 +211,13 @@ static void render_right(const struct mf_font_s *font, } void mf_render_aligned(const struct mf_font_s *font, - int16_t x0, int16_t y0, + gI16 x0, gI16 y0, enum mf_align_t align, - mf_str text, uint16_t count, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { - int16_t string_width; + gI16 string_width; count = strip_spaces(text, count, 0); if (align == MF_ALIGN_LEFT) @@ -242,8 +242,8 @@ void mf_render_aligned(const struct mf_font_s *font, #if !MF_USE_JUSTIFY void mf_render_justified(const struct mf_font_s *font, - int16_t x0, int16_t y0, int16_t width, - mf_str text, uint16_t count, + gI16 x0, gI16 y0, gI16 width, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { @@ -255,15 +255,15 @@ void mf_render_justified(const struct mf_font_s *font, /* Returns true if the character is a justification point, i.e. expands * when the text is being justified. */ -static bool is_justify_space(uint16_t c) +static bool is_justify_space(gU16 c) { return c == ' ' || c == 0xA0; } /* Count the number of space characters in string */ -static uint16_t count_spaces(mf_str text, uint16_t count) +static gU16 count_spaces(mf_str text, gU16 count) { - uint16_t spaces = 0; + gU16 spaces = 0; while (count-- && *text) { if (is_justify_space(mf_getchar(&text))) @@ -273,13 +273,13 @@ static uint16_t count_spaces(mf_str text, uint16_t count) } void mf_render_justified(const struct mf_font_s *font, - int16_t x0, int16_t y0, int16_t width, - mf_str text, uint16_t count, + gI16 x0, gI16 y0, gI16 width, + mf_str text, gU16 count, mf_character_callback_t callback, void *state) { - int16_t string_width, adjustment; - uint16_t num_spaces; + gI16 string_width, adjustment; + gU16 num_spaces; mf_char last_char; count = strip_spaces(text, count, &last_char); @@ -296,7 +296,7 @@ void mf_render_justified(const struct mf_font_s *font, num_spaces = count_spaces(text, count); { - int16_t x, tmp; + gI16 x, tmp; mf_char c1 = 0, c2; x = x0 - font->baseline_x; diff --git a/src/gdisp/mcufont/mf_justify.h b/src/gdisp/mcufont/mf_justify.h index 3c7622fc..4e4eda9e 100644 --- a/src/gdisp/mcufont/mf_justify.h +++ b/src/gdisp/mcufont/mf_justify.h @@ -29,7 +29,7 @@ enum mf_align_t * state: Free state variable for use by the callback. * Returns the width of the character. */ -typedef uint8_t (*mf_character_callback_t) (int16_t x0, int16_t y0, +typedef gU8 (*mf_character_callback_t) (gI16 x0, gI16 y0, mf_char character, void *state); /* Get width of a string in pixels. @@ -39,8 +39,8 @@ typedef uint8_t (*mf_character_callback_t) (int16_t x0, int16_t y0, * count: Number of characters on the line or 0 to read until end of string. * kern: True to consider kerning (slower). */ -MF_EXTERN int16_t mf_get_string_width(const struct mf_font_s *font, - mf_str text, uint16_t count, bool kern); +MF_EXTERN gI16 mf_get_string_width(const struct mf_font_s *font, + mf_str text, gU16 count, bool kern); /* Render a single line of aligned text. * @@ -54,9 +54,9 @@ MF_EXTERN int16_t mf_get_string_width(const struct mf_font_s *font, * state: Free variable for use in the callback. */ MF_EXTERN void mf_render_aligned(const struct mf_font_s *font, - int16_t x0, int16_t y0, + gI16 x0, gI16 y0, enum mf_align_t align, - mf_str text, uint16_t count, + mf_str text, gU16 count, mf_character_callback_t callback, void *state); @@ -72,8 +72,8 @@ MF_EXTERN void mf_render_aligned(const struct mf_font_s *font, * state: Free variable for use in the callback. */ MF_EXTERN void mf_render_justified(const struct mf_font_s *font, - int16_t x0, int16_t y0, int16_t width, - mf_str text, uint16_t count, + gI16 x0, gI16 y0, gI16 width, + mf_str text, gU16 count, mf_character_callback_t callback, void *state); diff --git a/src/gdisp/mcufont/mf_kerning.c b/src/gdisp/mcufont/mf_kerning.c index 5a5aa65b..1e29b6e2 100644 --- a/src/gdisp/mcufont/mf_kerning.c +++ b/src/gdisp/mcufont/mf_kerning.c @@ -16,12 +16,12 @@ /* Structure for keeping track of the edge of the glyph as it is rendered. */ struct kerning_state_s { - uint8_t edgepos[MF_KERNING_ZONES]; - uint8_t zoneheight; + gU8 edgepos[MF_KERNING_ZONES]; + gU8 zoneheight; }; /* Pixel callback for analyzing the left edge of a glyph. */ -static void fit_leftedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha, +static void fit_leftedge(gI16 x, gI16 y, gU8 count, gU8 alpha, void *state) { struct kerning_state_s *s = state; @@ -29,21 +29,21 @@ static void fit_leftedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha, if (alpha > 7) { - uint8_t zone = y / s->zoneheight; + gU8 zone = y / s->zoneheight; if (x < s->edgepos[zone]) s->edgepos[zone] = x; } } /* Pixel callback for analyzing the right edge of a glyph. */ -static void fit_rightedge(int16_t x, int16_t y, uint8_t count, uint8_t alpha, +static void fit_rightedge(gI16 x, gI16 y, gU8 count, gU8 alpha, void *state) { struct kerning_state_s *s = state; if (alpha > 7) { - uint8_t zone = y / s->zoneheight; + gU8 zone = y / s->zoneheight; x += count - 1; if (x > s->edgepos[zone]) s->edgepos[zone] = x; @@ -65,16 +65,16 @@ static bool do_kerning(mf_char c) return true; } -//static int16_t min16(int16_t a, int16_t b) { return (a < b) ? a : b; } -static int16_t max16(int16_t a, int16_t b) { return (a > b) ? a : b; } -static int16_t avg16(int16_t a, int16_t b) { return (a + b) / 2; } +//static gI16 min16(gI16 a, gI16 b) { return (a < b) ? a : b; } +static gI16 max16(gI16 a, gI16 b) { return (a > b) ? a : b; } +static gI16 avg16(gI16 a, gI16 b) { return (a + b) / 2; } -int8_t mf_compute_kerning(const struct mf_font_s *font, +gI8 mf_compute_kerning(const struct mf_font_s *font, mf_char c1, mf_char c2) { struct kerning_state_s leftedge, rightedge; - uint8_t w1, w2, i, min_space; - int16_t normal_space, adjust, max_adjust; + gU8 w1, w2, i, min_space; + gI16 normal_space, adjust, max_adjust; if (font->flags & MF_FONT_FLAG_MONOSPACE) return 0; /* No kerning for monospace fonts */ @@ -102,7 +102,7 @@ int8_t mf_compute_kerning(const struct mf_font_s *font, min_space = 255; for (i = 0; i < MF_KERNING_ZONES; i++) { - uint8_t space; + gU8 space; if (leftedge.edgepos[i] == 255 || rightedge.edgepos[i] == 0) continue; /* Outside glyph area. */ diff --git a/src/gdisp/mcufont/mf_kerning.h b/src/gdisp/mcufont/mf_kerning.h index 844d99c3..c6c2dcc7 100644 --- a/src/gdisp/mcufont/mf_kerning.h +++ b/src/gdisp/mcufont/mf_kerning.h @@ -25,7 +25,7 @@ * Returns the offset to add to the x position for c2. */ #if MF_USE_KERNING -MF_EXTERN int8_t mf_compute_kerning(const struct mf_font_s *font, +MF_EXTERN gI8 mf_compute_kerning(const struct mf_font_s *font, mf_char c1, mf_char c2); #else #define mf_compute_kerning(font, c1, c2) 0 diff --git a/src/gdisp/mcufont/mf_rlefont.c b/src/gdisp/mcufont/mf_rlefont.c index db217425..1da265c3 100644 --- a/src/gdisp/mcufont/mf_rlefont.c +++ b/src/gdisp/mcufont/mf_rlefont.c @@ -35,8 +35,8 @@ * through the character ranges. If the character is not found, return * pointer to the default glyph. */ -static const uint8_t *find_glyph(const struct mf_rlefont_s *font, - uint16_t character) +static const gU8 *find_glyph(const struct mf_rlefont_s *font, + gU16 character) { unsigned i, index; const struct mf_rlefont_char_range_s *range; @@ -58,21 +58,21 @@ static const uint8_t *find_glyph(const struct mf_rlefont_s *font, * and also the bounds of the character. */ struct renderstate_r { - int16_t x_begin; - int16_t x_end; - int16_t x; - int16_t y; - int16_t y_end; + gI16 x_begin; + gI16 x_end; + gI16 x; + gI16 y; + gI16 y_end; mf_pixel_callback_t callback; void *state; }; /* Call the callback to write one pixel to screen, and advance to next * pixel position. */ -static void write_pixels(struct renderstate_r *rstate, uint16_t count, - uint8_t alpha) +static void write_pixels(struct renderstate_r *rstate, gU16 count, + gU8 alpha) { - uint8_t rowlen; + gU8 rowlen; /* Write row-by-row if the run spans multiple rows. */ while (rstate->x + count >= rstate->x_end) @@ -93,7 +93,7 @@ static void write_pixels(struct renderstate_r *rstate, uint16_t count, } /* Skip the given number of pixels (0 alpha) */ -static void skip_pixels(struct renderstate_r *rstate, uint16_t count) +static void skip_pixels(struct renderstate_r *rstate, gU16 count) { rstate->x += count; while (rstate->x >= rstate->x_end) @@ -106,15 +106,15 @@ static void skip_pixels(struct renderstate_r *rstate, uint16_t count) /* Decode and write out a RLE-encoded dictionary entry. */ static void write_rle_dictentry(const struct mf_rlefont_s *font, struct renderstate_r *rstate, - uint8_t index) + gU8 index) { - uint16_t offset = font->dictionary_offsets[index]; - uint16_t length = font->dictionary_offsets[index + 1] - offset; - uint16_t i; + gU16 offset = font->dictionary_offsets[index]; + gU16 length = font->dictionary_offsets[index + 1] - offset; + gU16 i; for (i = 0; i < length; i++) { - uint8_t code = font->dictionary_data[offset + i]; + gU8 code = font->dictionary_data[offset + i]; if ((code & RLE_CODEMASK) == RLE_ZEROS) { skip_pixels(rstate, code & RLE_VALMASK); @@ -129,7 +129,7 @@ static void write_rle_dictentry(const struct mf_rlefont_s *font, } else if ((code & RLE_CODEMASK) == RLE_SHADE) { - uint8_t count, alpha; + gU8 count, alpha; count = ((code & RLE_VALMASK) >> 4) + 1; alpha = ((code & RLE_VALMASK) & 0xF) * 0x11; write_pixels(rstate, count, alpha); @@ -138,7 +138,7 @@ static void write_rle_dictentry(const struct mf_rlefont_s *font, } /* Get bit count for the "fill entries" */ -static uint8_t fillentry_bitcount(uint8_t index) +static gU8 fillentry_bitcount(gU8 index) { if (index >= DICT_START2BIT) return 2; @@ -157,11 +157,11 @@ static uint8_t fillentry_bitcount(uint8_t index) /* Decode and write out a direct binary codeword */ static void write_bin_codeword(const struct mf_rlefont_s *font, struct renderstate_r *rstate, - uint8_t code) + gU8 code) { - uint8_t bitcount = fillentry_bitcount(code); - uint8_t byte = code - DICT_START7BIT; - uint8_t runlen = 0; + gU8 bitcount = fillentry_bitcount(code); + gU8 byte = code - DICT_START7BIT; + gU8 runlen = 0; (void) font; while (bitcount--) @@ -191,7 +191,7 @@ static void write_bin_codeword(const struct mf_rlefont_s *font, /* Decode and write out a reference codeword */ static void write_ref_codeword(const struct mf_rlefont_s *font, struct renderstate_r *rstate, - uint8_t code) + gU8 code) { if (code <= 15) { @@ -219,15 +219,15 @@ static void write_ref_codeword(const struct mf_rlefont_s *font, /* Decode and write out a reference encoded dictionary entry. */ static void write_ref_dictentry(const struct mf_rlefont_s *font, struct renderstate_r *rstate, - uint8_t index) + gU8 index) { - uint16_t offset = font->dictionary_offsets[index]; - uint16_t length = font->dictionary_offsets[index + 1] - offset; - uint16_t i; + gU16 offset = font->dictionary_offsets[index]; + gU16 length = font->dictionary_offsets[index + 1] - offset; + gU16 i; for (i = 0; i < length; i++) { - uint8_t code = font->dictionary_data[offset + i]; + gU8 code = font->dictionary_data[offset + i]; write_ref_codeword(font, rstate, code); } } @@ -235,7 +235,7 @@ static void write_ref_dictentry(const struct mf_rlefont_s *font, /* Decode and write out an arbitrary glyph codeword */ static void write_glyph_codeword(const struct mf_rlefont_s *font, struct renderstate_r *rstate, - uint8_t code) + gU8 code) { if (code >= DICT_START + font->rle_entry_count && code < DICT_START + font->dict_entry_count) @@ -249,14 +249,14 @@ static void write_glyph_codeword(const struct mf_rlefont_s *font, } -uint8_t mf_rlefont_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +gU8 mf_rlefont_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state) { - const uint8_t *p; - uint8_t width; + const gU8 *p; + gU8 width; struct renderstate_r rstate; rstate.x_begin = x0; @@ -280,10 +280,10 @@ uint8_t mf_rlefont_render_character(const struct mf_font_s *font, return width; } -uint8_t mf_rlefont_character_width(const struct mf_font_s *font, - uint16_t character) +gU8 mf_rlefont_character_width(const struct mf_font_s *font, + gU16 character) { - const uint8_t *p; + const gU8 *p; p = find_glyph((struct mf_rlefont_s*)font, character); if (!p) return 0; diff --git a/src/gdisp/mcufont/mf_rlefont.h b/src/gdisp/mcufont/mf_rlefont.h index 8978f2a3..be21fe88 100644 --- a/src/gdisp/mcufont/mf_rlefont.h +++ b/src/gdisp/mcufont/mf_rlefont.h @@ -23,16 +23,16 @@ struct mf_rlefont_char_range_s { /* The number of the first character in this range. */ - uint16_t first_char; + gU16 first_char; /* The total count of characters in this range. */ - uint16_t char_count; + gU16 char_count; /* Lookup table with the start indices into glyph_data. */ - const uint16_t *glyph_offsets; + const gU16 *glyph_offsets; /* The encoded glyph data for glyphs in this range. */ - const uint8_t *glyph_data; + const gU8 *glyph_data; }; /* Structure for a single encoded font. */ @@ -41,26 +41,26 @@ struct mf_rlefont_s struct mf_font_s font; /* Version of the font definition used. */ - const uint8_t version; + const gU8 version; /* Big array of the data for all the dictionary entries. */ - const uint8_t *dictionary_data; + const gU8 *dictionary_data; /* Lookup table with the start indices into dictionary_data. * Contains N+1 entries, so that the length of the entry can * be determined by subtracting from the next offset. */ - const uint16_t *dictionary_offsets; + const gU16 *dictionary_offsets; /* Number of dictionary entries using the RLE encoding. * Entries starting at this index use the dictionary encoding. */ - const uint8_t rle_entry_count; + const gU8 rle_entry_count; /* Total number of dictionary entries. * Entries after this are nonexistent. */ - const uint8_t dict_entry_count; + const gU8 dict_entry_count; /* Number of discontinuous character ranges */ - const uint16_t char_range_count; + const gU16 char_range_count; /* Array of the character ranges */ const struct mf_rlefont_char_range_s *char_ranges; @@ -68,14 +68,14 @@ struct mf_rlefont_s #ifdef MF_RLEFONT_INTERNALS /* Internal functions, don't use these directly. */ -MF_EXTERN uint8_t mf_rlefont_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +MF_EXTERN gU8 mf_rlefont_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state); -MF_EXTERN uint8_t mf_rlefont_character_width(const struct mf_font_s *font, - uint16_t character); +MF_EXTERN gU8 mf_rlefont_character_width(const struct mf_font_s *font, + gU16 character); #endif #endif diff --git a/src/gdisp/mcufont/mf_scaledfont.c b/src/gdisp/mcufont/mf_scaledfont.c index b3c70a7f..9e0903cc 100644 --- a/src/gdisp/mcufont/mf_scaledfont.c +++ b/src/gdisp/mcufont/mf_scaledfont.c @@ -13,17 +13,17 @@ struct scaled_renderstate { mf_pixel_callback_t orig_callback; void *orig_state; - uint8_t x_scale; - uint8_t y_scale; - int16_t x0; - int16_t y0; + gU8 x_scale; + gU8 y_scale; + gI16 x0; + gI16 y0; }; -static void scaled_pixel_callback(int16_t x, int16_t y, uint8_t count, - uint8_t alpha, void *state) +static void scaled_pixel_callback(gI16 x, gI16 y, gU8 count, + gU8 alpha, void *state) { struct scaled_renderstate *rstate = state; - uint8_t dy; + gU8 dy; count *= rstate->x_scale; x = rstate->x0 + x * rstate->x_scale; @@ -35,26 +35,26 @@ static void scaled_pixel_callback(int16_t x, int16_t y, uint8_t count, } } -uint8_t mf_scaled_character_width(const struct mf_font_s *font, - uint16_t character) +gU8 mf_scaled_character_width(const struct mf_font_s *font, + gU16 character) { struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font; - uint8_t basewidth; + gU8 basewidth; basewidth = sfont->basefont->character_width(sfont->basefont, character); return sfont->x_scale * basewidth; } -uint8_t mf_scaled_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +gU8 mf_scaled_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state) { struct mf_scaledfont_s *sfont = (struct mf_scaledfont_s*)font; struct scaled_renderstate rstate; - uint8_t basewidth; + gU8 basewidth; rstate.orig_callback = callback; rstate.orig_state = state; @@ -71,7 +71,7 @@ uint8_t mf_scaled_render_character(const struct mf_font_s *font, void mf_scale_font(struct mf_scaledfont_s *newfont, const struct mf_font_s *basefont, - uint8_t x_scale, uint8_t y_scale) + gU8 x_scale, gU8 y_scale) { newfont->font = *basefont; newfont->basefont = basefont; diff --git a/src/gdisp/mcufont/mf_scaledfont.h b/src/gdisp/mcufont/mf_scaledfont.h index c82c2093..da9f47aa 100644 --- a/src/gdisp/mcufont/mf_scaledfont.h +++ b/src/gdisp/mcufont/mf_scaledfont.h @@ -19,24 +19,24 @@ struct mf_scaledfont_s struct mf_font_s font; const struct mf_font_s *basefont; - uint8_t x_scale; - uint8_t y_scale; + gU8 x_scale; + gU8 y_scale; }; MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont, const struct mf_font_s *basefont, - uint8_t x_scale, uint8_t y_scale); + gU8 x_scale, gU8 y_scale); #ifdef MF_SCALEDFONT_INTERNALS /* Internal functions, don't use these directly. */ -MF_EXTERN uint8_t mf_scaled_render_character(const struct mf_font_s *font, - int16_t x0, int16_t y0, - uint16_t character, +MF_EXTERN gU8 mf_scaled_render_character(const struct mf_font_s *font, + gI16 x0, gI16 y0, + gU16 character, mf_pixel_callback_t callback, void *state); -MF_EXTERN uint8_t mf_scaled_character_width(const struct mf_font_s *font, - uint16_t character); +MF_EXTERN gU8 mf_scaled_character_width(const struct mf_font_s *font, + gU16 character); #endif #endif diff --git a/src/gdisp/mcufont/mf_wordwrap.c b/src/gdisp/mcufont/mf_wordwrap.c index 06101b32..0b303ace 100644 --- a/src/gdisp/mcufont/mf_wordwrap.c +++ b/src/gdisp/mcufont/mf_wordwrap.c @@ -10,7 +10,7 @@ #ifndef MF_NO_COMPILE /* Returns true if the line can be broken at this character. */ -static bool is_wrap_space(uint16_t c) +static bool is_wrap_space(gU16 c) { return c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '-'; } @@ -20,9 +20,9 @@ static bool is_wrap_space(uint16_t c) /* Represents a single word and the whitespace after it. */ struct wordlen_s { - int16_t word; /* Length of the word in pixels. */ - int16_t space; /* Length of the whitespace in pixels. */ - uint16_t chars; /* Number of characters in word + space, combined. */ + gI16 word; /* Length of the word in pixels. */ + gI16 space; /* Length of the whitespace in pixels. */ + gU16 chars; /* Number of characters in word + space, combined. */ }; /* Take the next word from the string and compute its width. @@ -76,8 +76,8 @@ static bool get_wordlen(const struct mf_font_s *font, mf_str *text, struct linelen_s { mf_str start; /* Start of the text for line. */ - uint16_t chars; /* Total number of characters on the line. */ - int16_t width; /* Total length of all words + whitespace on the line in pixels. */ + gU16 chars; /* Total number of characters on the line. */ + gI16 width; /* Total length of all words + whitespace on the line in pixels. */ bool linebreak; /* True if line ends in a linebreak */ struct wordlen_s last_word; /* Last word on the line. */ struct wordlen_s last_word_2; /* Second to last word on the line. */ @@ -85,7 +85,7 @@ struct linelen_s /* Append word onto the line if it fits. If it would overflow, don't add and * return false. */ -static bool append_word(const struct mf_font_s *font, int16_t width, +static bool append_word(const struct mf_font_s *font, gI16 width, struct linelen_s *current, mf_str *text) { mf_str tmp = *text; @@ -111,12 +111,12 @@ static bool append_word(const struct mf_font_s *font, int16_t width, } /* Append a character to the line if it fits. */ -static bool append_char(const struct mf_font_s *font, int16_t width, +static bool append_char(const struct mf_font_s *font, gI16 width, struct linelen_s *current, mf_str *text) { mf_str tmp = *text; mf_char c; - uint16_t w; + gU16 w; c = mf_getchar(&tmp); w = mf_character_width(font, c); @@ -134,16 +134,16 @@ static bool append_char(const struct mf_font_s *font, int16_t width, } } -static int32_t sq16(int16_t x) { return (int32_t)x * x; } +static gI32 sq16(gI16 x) { return (gI32)x * x; } /* Try to balance the lines by potentially moving one word from the previous * line to the the current one. */ static void tune_lines(struct linelen_s *current, struct linelen_s *previous, - int16_t max_width) + gI16 max_width) { - int16_t curw1, prevw1; - int16_t curw2, prevw2; - int32_t delta1, delta2; + gI16 curw1, prevw1; + gI16 curw2, prevw2; + gI32 delta1, delta2; /* If the lines are rendered as is */ curw1 = current->width - current->last_word.space; @@ -160,7 +160,7 @@ static void tune_lines(struct linelen_s *current, struct linelen_s *previous, if (delta1 > delta2 && curw2 <= max_width) { /* Do the change. */ - uint16_t chars; + gU16 chars; chars = previous->last_word.chars; previous->chars -= chars; @@ -173,13 +173,13 @@ static void tune_lines(struct linelen_s *current, struct linelen_s *previous, } } -void mf_wordwrap(const struct mf_font_s *font, int16_t width, +void mf_wordwrap(const struct mf_font_s *font, gI16 width, mf_str text, mf_line_callback_t callback, void *state) { struct linelen_s current = { 0 }; struct linelen_s previous = { 0 }; bool full; - uint32_t giveUp = 2048; /* Do while-loop a maximum of x times */ + gU32 giveUp = 2048; /* Do while-loop a maximum of x times */ current.start = text; @@ -236,16 +236,16 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width, #else -void mf_wordwrap(const struct mf_font_s *font, int16_t width, +void mf_wordwrap(const struct mf_font_s *font, gI16 width, mf_str text, mf_line_callback_t callback, void *state) { mf_str linestart; /* Current line width and character count */ - int16_t lw_cur = 0, cc_cur = 0; + gI16 lw_cur = 0, cc_cur = 0; /* Previous wrap point */ - int16_t cc_prev; + gI16 cc_prev; mf_str ls_prev; linestart = text; @@ -258,7 +258,7 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width, while (*text) { mf_char c; - int16_t new_width; + gI16 new_width; mf_str tmp; tmp = text; diff --git a/src/gdisp/mcufont/mf_wordwrap.h b/src/gdisp/mcufont/mf_wordwrap.h index a1a051fa..91ac8cad 100644 --- a/src/gdisp/mcufont/mf_wordwrap.h +++ b/src/gdisp/mcufont/mf_wordwrap.h @@ -23,7 +23,7 @@ * * Returns: true to continue, false to stop after this line. */ -typedef bool (*mf_line_callback_t) (mf_str line, uint16_t count, +typedef bool (*mf_line_callback_t) (mf_str line, gU16 count, void *state); /* Word wrap a piece of text. Calls the callback function for each line. @@ -33,7 +33,7 @@ typedef bool (*mf_line_callback_t) (mf_str line, uint16_t count, * text: Pointer to the start of the text to process. * state: Free variable for caller to use (can be NULL). */ -MF_EXTERN void mf_wordwrap(const struct mf_font_s *font, int16_t width, +MF_EXTERN void mf_wordwrap(const struct mf_font_s *font, gI16 width, mf_str text, mf_line_callback_t callback, void *state); #endif diff --git a/src/gdriver/gdriver.c b/src/gdriver/gdriver.c index b9cd05a9..95a1e03e 100644 --- a/src/gdriver/gdriver.c +++ b/src/gdriver/gdriver.c @@ -95,7 +95,7 @@ void gdriverUnRegister(GDriver *driver) { gfxFree(driver); } -GDriver *gdriverGetInstance(uint16_t type, unsigned instance) { +GDriver *gdriverGetInstance(gU16 type, unsigned instance) { GDriver *pd; unsigned sinstance; @@ -111,7 +111,7 @@ GDriver *gdriverGetInstance(uint16_t type, unsigned instance) { return 0; } -unsigned gdriverInstanceCount(uint16_t type) { +unsigned gdriverInstanceCount(gU16 type) { GDriver *pd; unsigned sinstance; @@ -124,7 +124,7 @@ unsigned gdriverInstanceCount(uint16_t type) { return sinstance; } -GDriver *gdriverGetNext(uint16_t type, GDriver *driver) { +GDriver *gdriverGetNext(gU16 type, GDriver *driver) { driver = driver ? driver->driverchain : dhead; while(driver && driver->vmt->type != type) diff --git a/src/gdriver/gdriver.h b/src/gdriver/gdriver.h index 540e604e..2b3ef7da 100644 --- a/src/gdriver/gdriver.h +++ b/src/gdriver/gdriver.h @@ -64,9 +64,9 @@ typedef struct GDriver { * @brief All driver VMT's start with this structure. */ typedef struct GDriverVMT { - uint16_t type; // @< What type of driver this is - uint16_t flags; // @< Flags for the driver. Meaning is specific to each driver type. - uint32_t objsize; // @< How big the runtime driver structure is + gU16 type; // @< What type of driver this is + gU16 flags; // @< Flags for the driver. Meaning is specific to each driver type. + gU32 objsize; // @< How big the runtime driver structure is gBool (*init)(GDriver *driver, void *param, unsigned driverinstance, unsigned systeminstance); // @< Initialise the driver. Returns gTrue if OK. // driverinstance is the instance 0..n of this driver. // systeminstance is the instance 0..n of this type of device. @@ -120,7 +120,7 @@ extern "C" { * @param[in] type The type of driver to find * @param[in] instance The instance (0..n) to find */ - GDriver *gdriverGetInstance(uint16_t type, unsigned instance); + GDriver *gdriverGetInstance(gU16 type, unsigned instance); /** * @brief Get the count of instances of a type of device @@ -130,7 +130,7 @@ extern "C" { * * @param[in] type The type of driver to find */ - unsigned gdriverInstanceCount(uint16_t type); + unsigned gdriverInstanceCount(gU16 type); /** * @brief Get the instance number for a device @@ -147,7 +147,7 @@ extern "C" { * @param[in] type The type of driver to find * @param[in] driver The last driver returned or NULL to start again */ - GDriver *gdriverGetNext(uint16_t type, GDriver *driver); + GDriver *gdriverGetNext(gU16 type, GDriver *driver); #ifdef __cplusplus } diff --git a/src/gevent/gevent.c b/src/gevent/gevent.c index c092394b..472fb25c 100644 --- a/src/gevent/gevent.c +++ b/src/gevent/gevent.c @@ -68,7 +68,7 @@ void geventListenerInit(GListener *pl) { pl->flags = 0; } -gBool geventAttachSource(GListener *pl, GSourceHandle gsh, uint32_t flags) { +gBool geventAttachSource(GListener *pl, GSourceHandle gsh, gU32 flags) { GSourceListener *psl, *pslfree; // Safety first diff --git a/src/gevent/gevent.h b/src/gevent/gevent.h index dd5b86a4..4e8dacec 100644 --- a/src/gevent/gevent.h +++ b/src/gevent/gevent.h @@ -30,7 +30,7 @@ /* Type definitions */ /*===========================================================================*/ -typedef uint16_t GEventType; +typedef gU16 GEventType; #define GEVENT_NULL 0x0000 // Null Event - Do nothing #define GEVENT_EXIT 0x0001 // The listener is being forced to exit (someone is destroying the listener) @@ -56,7 +56,7 @@ typedef void (*GEventCallbackFn)(void *param, GEvent *pe); // The Listener Object typedef struct GListener { gfxSem waitqueue; // Private: Semaphore for the listener to wait on. - uint16_t flags; // Private: Flags for operation + gU16 flags; // Private: Flags for operation GEventCallbackFn callback; // Private: Call back Function void *param; // Private: Parameter for the callback function. GEvent event; // Public: The event object into which the event information is stored. @@ -69,8 +69,8 @@ typedef struct GSource_t GSource, *GSourceHandle; typedef struct GSourceListener_t { GListener *pListener; // The listener GSource *pSource; // The source - uint32_t listenflags; // The flags the listener passed when the source was assigned to it. - uint32_t srcflags; // For the source's exclusive use. Initialised as 0 for a new listener source assignment. + gU32 listenflags; // The flags the listener passed when the source was assigned to it. + gU32 srcflags; // For the source's exclusive use. Initialised as 0 for a new listener source assignment. } GSourceListener; /*===========================================================================*/ @@ -126,7 +126,7 @@ void geventListenerInit(GListener *pl); * * @return gTrue if succeeded, gFalse otherwise */ -gBool geventAttachSource(GListener *pl, GSourceHandle gsh, uint32_t flags); +gBool geventAttachSource(GListener *pl, GSourceHandle gsh, gU32 flags); /** * @brief Detach a source from a listener diff --git a/src/gfile/gfile.c b/src/gfile/gfile.c index d01c416d..720ab815 100644 --- a/src/gfile/gfile.c +++ b/src/gfile/gfile.c @@ -175,9 +175,9 @@ gBool gfileDelete(const char *fname) { return gFalse; } -long int gfileGetFilesize(const char *fname) { +gFileSize gfileGetFilesize(const char *fname) { const GFILEVMT * const *p; - long int res; + gFileSize res; #if GFILE_ALLOW_DEVICESPECIFIC if (fname[0] && fname[1] == '|') { @@ -185,7 +185,7 @@ long int gfileGetFilesize(const char *fname) { if (p[0]->prefix == fname[0]) return p[0]->filesize ? p[0]->filesize(fname+2) : -1; } - return -1; + return (gFileSize)-1; } #endif @@ -286,8 +286,8 @@ void gfileClose(GFILE *f) { f->flags = 0; } -size_t gfileRead(GFILE *f, void *buf, size_t len) { - size_t res; +gMemSize gfileRead(GFILE *f, void *buf, gMemSize len) { + gMemSize res; if (!f || (f->flags & (GFILEFLG_OPEN|GFILEFLG_READ)) != (GFILEFLG_OPEN|GFILEFLG_READ)) return 0; @@ -299,8 +299,8 @@ size_t gfileRead(GFILE *f, void *buf, size_t len) { return res; } -size_t gfileWrite(GFILE *f, const void *buf, size_t len) { - size_t res; +gMemSize gfileWrite(GFILE *f, const void *buf, gMemSize len) { + gMemSize res; if (!f || (f->flags & (GFILEFLG_OPEN|GFILEFLG_WRITE)) != (GFILEFLG_OPEN|GFILEFLG_WRITE)) return 0; @@ -312,13 +312,13 @@ size_t gfileWrite(GFILE *f, const void *buf, size_t len) { return res; } -long int gfileGetPos(GFILE *f) { +gFileSize gfileGetPos(GFILE *f) { if (!f || !(f->flags & GFILEFLG_OPEN)) return 0; return f->pos; } -gBool gfileSetPos(GFILE *f, long int pos) { +gBool gfileSetPos(GFILE *f, gFileSize pos) { if (!f || !(f->flags & GFILEFLG_OPEN)) return gFalse; if (!f->vmt->setpos || !f->vmt->setpos(f, pos)) @@ -327,7 +327,7 @@ gBool gfileSetPos(GFILE *f, long int pos) { return gTrue; } -long int gfileGetSize(GFILE *f) { +gFileSize gfileGetSize(GFILE *f) { if (!f || !(f->flags & GFILEFLG_OPEN)) return 0; if (!f->vmt->getsize) diff --git a/src/gfile/gfile.h b/src/gfile/gfile.h index 4ad3b302..5940a55b 100644 --- a/src/gfile/gfile.h +++ b/src/gfile/gfile.h @@ -70,11 +70,11 @@ gBool gfileDelete(const char *fname); * * @param[in] fname The file name * - * @return File size on success, -1 on error + * @return File size on success, (gFileSize)-1 on error * * @api */ -long int gfileGetFilesize(const char *fname); +gFileSize gfileGetFilesize(const char *fname); /** * @brief Rename file @@ -145,7 +145,7 @@ void gfileClose(GFILE *f); * * @api */ -size_t gfileRead(GFILE *f, void *buf, size_t len); +gMemSize gfileRead(GFILE *f, void *buf, gMemSize len); /** * @brief Write to file @@ -160,7 +160,7 @@ size_t gfileRead(GFILE *f, void *buf, size_t len); * * @api */ -size_t gfileWrite(GFILE *f, const void *buf, size_t len); +gMemSize gfileWrite(GFILE *f, const void *buf, gMemSize len); /** * @brief Get the current position of the read/write cursor @@ -171,7 +171,7 @@ size_t gfileWrite(GFILE *f, const void *buf, size_t len); * * @api */ -long int gfileGetPos(GFILE *f); +gFileSize gfileGetPos(GFILE *f); /** * @brief Set the position of the read/write cursor @@ -183,7 +183,7 @@ long int gfileGetPos(GFILE *f); * * @api */ -gBool gfileSetPos(GFILE *f, long int pos); +gBool gfileSetPos(GFILE *f, gFileSize pos); /** * @brief Get the size of file @@ -195,7 +195,7 @@ gBool gfileSetPos(GFILE *f, long int pos); * * @api */ -long int gfileGetSize(GFILE *f); +gFileSize gfileGetSize(GFILE *f); /** * @brief Check for EOF @@ -399,7 +399,7 @@ gBool gfileSync(GFILE *f); // Needed routines and definitions size_t gstdioRead(void * ptr, size_t size, size_t count, GFILE *f); size_t gstdioWrite(const void * ptr, size_t size, size_t count, GFILE *f); - int gstdioGetpos(GFILE *f, long int *pos); + int gstdioGetpos(GFILE *f, long *pos); int gstdioSeek(GFILE *f, size_t offset, int origin); #define SEEK_SET 0 #define SEEK_CUR 1 @@ -424,7 +424,7 @@ gBool gfileSync(GFILE *f); #define rename(o,n) (!gfileRename(o,n)) #define fflush(f) (0) #define ftell(f) gfileGetPos(f) - #define fpos_t long int + #define fpos_t gFileSize #define fgetpos(f,pos) gstdioGetpos(f,pos) #define fsetpos(f, pos) (!gfileSetPos(f, *pos)) #define rewind(f) gfileSetPos(f, 0); diff --git a/src/gfile/gfile_fatfs_diskio_chibios.c b/src/gfile/gfile_fatfs_diskio_chibios.c index 13c7403d..9b13ff5b 100644 --- a/src/gfile/gfile_fatfs_diskio_chibios.c +++ b/src/gfile/gfile_fatfs_diskio_chibios.c @@ -271,7 +271,7 @@ DRESULT disk_ioctl ( } #else DWORD get_fattime(void) { - return ((uint32_t)0 | (1 << 16)) | (1 << 21); /* wrong but valid time */ + return ((gU32)0 | (1 << 16)) | (1 << 21); /* wrong but valid time */ } #endif diff --git a/src/gfile/gfile_fatfs_wrapper.c b/src/gfile/gfile_fatfs_wrapper.c index 3099f508..4d846be6 100644 --- a/src/gfile/gfile_fatfs_wrapper.c +++ b/src/gfile/gfile_fatfs_wrapper.c @@ -68,7 +68,7 @@ /*------------------------------------------------------------------------*/ void *ff_memalloc(UINT size) { - return gfxAlloc( (size_t)size ); + return gfxAlloc( (gMemSize)size ); } /*------------------------------------------------------------------------*/ diff --git a/src/gfile/gfile_fs.h b/src/gfile/gfile_fs.h index a19c5fba..4675352d 100644 --- a/src/gfile/gfile_fs.h +++ b/src/gfile/gfile_fs.h @@ -16,7 +16,7 @@ struct GFILE { const struct GFILEVMT * vmt; - uint16_t flags; + gU16 flags; #define GFILEFLG_OPEN 0x0001 // File is open #define GFILEFLG_READ 0x0002 // Read the file #define GFILEFLG_WRITE 0x0004 // Write the file @@ -29,7 +29,7 @@ struct GFILE { #define GFILEFLG_MUSTNOTEXIST 0x0200 // On open file must not exist #define GFILEFLG_TRUNC 0x0400 // On open truncate the file void * obj; - long int pos; + gFileSize pos; }; struct gfileList { @@ -38,7 +38,7 @@ struct gfileList { }; typedef struct GFILEVMT { - uint8_t flags; + gU8 flags; #define GFSFLG_WRITEABLE 0x0001 #define GFSFLG_CASESENSITIVE 0x0002 #define GFSFLG_SEEKABLE 0x0004 @@ -48,14 +48,14 @@ typedef struct GFILEVMT { char prefix; gBool (*del) (const char *fname); gBool (*exists) (const char *fname); - long int (*filesize) (const char *fname); + gFileSize (*filesize) (const char *fname); gBool (*ren) (const char *oldname, const char *newname); gBool (*open) (GFILE *f, const char *fname); void (*close) (GFILE *f); int (*read) (GFILE *f, void *buf, int size); int (*write) (GFILE *f, const void *buf, int size); - gBool (*setpos) (GFILE *f, long int pos); - long int (*getsize) (GFILE *f); + gBool (*setpos) (GFILE *f, gFileSize pos); + gFileSize (*getsize) (GFILE *f); gBool (*eof) (GFILE *f); gBool (*mount) (const char *drive); gBool (*unmount) (const char *drive); diff --git a/src/gfile/gfile_fs_chibios.c b/src/gfile/gfile_fs_chibios.c index 65d259e9..d239bdd5 100644 --- a/src/gfile/gfile_fs_chibios.c +++ b/src/gfile/gfile_fs_chibios.c @@ -18,8 +18,8 @@ static void ChibiOSBFSClose(GFILE *f); static int ChibiOSBFSRead(GFILE *f, void *buf, int size); static int ChibiOSBFSWrite(GFILE *f, const void *buf, int size); -static gBool ChibiOSBFSSetpos(GFILE *f, long int pos); -static long int ChibiOSBFSGetsize(GFILE *f); +static gBool ChibiOSBFSSetpos(GFILE *f, gFileSize pos); +static gFileSize ChibiOSBFSGetsize(GFILE *f); static gBool ChibiOSBFSEof(GFILE *f); static const GFILEVMT FsCHIBIOSVMT = { @@ -52,11 +52,11 @@ static int ChibiOSBFSRead(GFILE *f, void *buf, int size) { static int ChibiOSBFSWrite(GFILE *f, const void *buf, int size) { return fileStreamWrite(((FileStream *)f->obj), (uint8_t *)buf, size); } -static gBool ChibiOSBFSSetpos(GFILE *f, long int pos) { +static gBool ChibiOSBFSSetpos(GFILE *f, gFileSize pos) { fileStreamSeek(((FileStream *)f->obj), pos); return gTrue; } -static long int ChibiOSBFSGetsize(GFILE *f) { return fileStreamGetSize(((FileStream *)f->obj)); } +static gFileSize ChibiOSBFSGetsize(GFILE *f) { return (gFileSize)fileStreamGetSize(((FileStream *)f->obj)); } static gBool ChibiOSBFSEof(GFILE *f) { return f->pos >= fileStreamGetSize(((FileStream *)f->obj)); } GFILE * gfileOpenChibiOSFileStream(void *FileStreamPtr, const char *mode) { diff --git a/src/gfile/gfile_fs_fatfs.c b/src/gfile/gfile_fs_fatfs.c index d787ba09..4aae8c9f 100644 --- a/src/gfile/gfile_fs_fatfs.c +++ b/src/gfile/gfile_fs_fatfs.c @@ -22,14 +22,14 @@ static gBool fatfsDel(const char* fname); static gBool fatfsExists(const char* fname); -static long int fatfsFileSize(const char* fname); +static gFileSize fatfsFileSize(const char* fname); static gBool fatfsRename(const char* oldname, const char* newname); static gBool fatfsOpen(GFILE* f, const char* fname); static void fatfsClose(GFILE* f); static int fatfsRead(GFILE* f, void* buf, int size); static int fatfsWrite(GFILE* f, const void* buf, int size); -static gBool fatfsSetPos(GFILE* f, long int pos); -static long int fatfsGetSize(GFILE* f); +static gBool fatfsSetPos(GFILE* f, gFileSize pos); +static gFileSize fatfsGetSize(GFILE* f); static gBool fatfsEOF(GFILE* f); static gBool fatfsMount(const char* drive); static gBool fatfsUnmount(const char* drive); @@ -118,7 +118,7 @@ static gBool fatfsExists(const char* fname) return gTrue; } -static long int fatfsFileSize(const char* fname) +static gFileSize fatfsFileSize(const char* fname) { FRESULT ferr; FILINFO fno; @@ -127,7 +127,7 @@ static long int fatfsFileSize(const char* fname) if (ferr != FR_OK) return 0; - return (long int)fno.fsize; + return (gFileSize)fno.fsize; } static gBool fatfsRename(const char* oldname, const char* newname) @@ -201,7 +201,7 @@ static int fatfsWrite(GFILE* f, const void* buf, int size) return wr; } -static gBool fatfsSetPos(GFILE* f, long int pos) +static gBool fatfsSetPos(GFILE* f, gFileSize pos) { FRESULT ferr; @@ -212,9 +212,9 @@ static gBool fatfsSetPos(GFILE* f, long int pos) return gTrue; } -static long int fatfsGetSize(GFILE* f) +static gFileSize fatfsGetSize(GFILE* f) { - return (long int)f_size( (FIL*)f->obj ); + return (gFileSize)f_size( (FIL*)f->obj ); } static gBool fatfsEOF(GFILE* f) diff --git a/src/gfile/gfile_fs_mem.c b/src/gfile/gfile_fs_mem.c index d87b8622..7aa0ce82 100644 --- a/src/gfile/gfile_fs_mem.c +++ b/src/gfile/gfile_fs_mem.c @@ -19,7 +19,7 @@ static int MEMRead(GFILE *f, void *buf, int size); static int MEMWrite(GFILE *f, const void *buf, int size); -static gBool MEMSetpos(GFILE *f, long int pos); +static gBool MEMSetpos(GFILE *f, gFileSize pos); static const GFILEVMT FsMemVMT = { GFSFLG_SEEKABLE|GFSFLG_WRITEABLE, // flags @@ -41,7 +41,7 @@ static int MEMWrite(GFILE *f, const void *buf, int size) { memcpy(((char *)f->obj)+f->pos, buf, size); return size; } -static gBool MEMSetpos(GFILE *f, long int pos) { +static gBool MEMSetpos(GFILE *f, gFileSize pos) { (void) f; (void) pos; return gTrue; diff --git a/src/gfile/gfile_fs_native.c b/src/gfile/gfile_fs_native.c index 8c12443b..39ebc960 100644 --- a/src/gfile/gfile_fs_native.c +++ b/src/gfile/gfile_fs_native.c @@ -24,14 +24,14 @@ static gBool NativeDel(const char *fname); static gBool NativeExists(const char *fname); -static long int NativeFilesize(const char *fname); +static gFileSize NativeFilesize(const char *fname); static gBool NativeRen(const char *oldname, const char *newname); static gBool NativeOpen(GFILE *f, const char *fname); static void NativeClose(GFILE *f); static int NativeRead(GFILE *f, void *buf, int size); static int NativeWrite(GFILE *f, const void *buf, int size); -static gBool NativeSetpos(GFILE *f, long int pos); -static long int NativeGetsize(GFILE *f); +static gBool NativeSetpos(GFILE *f, gFileSize pos); +static gFileSize NativeGetsize(GFILE *f); static gBool NativeEof(GFILE *f); #if GFILE_NEED_FILELISTS static gfileList *NativeFlOpen(const char *path, gBool dirs); @@ -78,7 +78,7 @@ void _gfileNativeAssignStdio(void) { gfileStdErr = &NativeStdErr; } -static void Native_flags2mode(char *buf, uint16_t flags) { +static void Native_flags2mode(char *buf, gU16 flags) { if (flags & GFILEFLG_MUSTEXIST) *buf = 'r'; else if (flags & GFILEFLG_APPEND) @@ -99,19 +99,19 @@ static gBool NativeDel(const char *fname) { return remove(fname) ? gFalse static void NativeClose(GFILE *f) { fclose((FILE *)f->obj); } static int NativeRead(GFILE *f, void *buf, int size) { return fread(buf, 1, size, (FILE *)f->obj); } static int NativeWrite(GFILE *f, const void *buf, int size) { return fwrite(buf, 1, size, (FILE *)f->obj); } -static gBool NativeSetpos(GFILE *f, long int pos) { return fseek((FILE *)f->obj, pos, SEEK_SET) ? gFalse : gTrue; } +static gBool NativeSetpos(GFILE *f, gFileSize pos) { return fseek((FILE *)f->obj, pos, SEEK_SET) ? gFalse : gTrue; } static gBool NativeEof(GFILE *f) { return feof((FILE *)f->obj) ? gTrue : gFalse; } static gBool NativeRen(const char *oldname, const char *newname) { return rename(oldname, newname) ? gFalse : gTrue; } static gBool NativeExists(const char *fname) { // We define access this way so we don't have to include which may - // (and does under windows) contain conflicting definitions for types such as uint16_t. + // (and does under windows) contain conflicting definitions for types such as gU16. extern int access(const char *pathname, int mode); return access(fname, 0) ? gFalse : gTrue; } -static long int NativeFilesize(const char *fname) { +static gFileSize NativeFilesize(const char *fname) { struct stat st; - if (stat(fname, &st)) return -1; - return st.st_size; + if (stat(fname, &st)) return (gFileSize)-1; + return (gFileSize)st.st_size; } static gBool NativeOpen(GFILE *f, const char *fname) { FILE *fd; @@ -123,10 +123,10 @@ static gBool NativeOpen(GFILE *f, const char *fname) { f->obj = (void *)fd; return gTrue; } -static long int NativeGetsize(GFILE *f) { +static gFileSize NativeGetsize(GFILE *f) { struct stat st; - if (fstat(fileno((FILE *)f->obj), &st)) return -1; - return st.st_size; + if (fstat(fileno((FILE *)f->obj), &st)) return (gFileSize)-1; + return (gFileSize)st.st_size; } #if GFILE_NEED_FILELISTS diff --git a/src/gfile/gfile_fs_petitfs.c b/src/gfile/gfile_fs_petitfs.c index a322a3b1..4fa51b31 100644 --- a/src/gfile/gfile_fs_petitfs.c +++ b/src/gfile/gfile_fs_petitfs.c @@ -19,7 +19,7 @@ static gBool petitfsExists(const char* fname); static gBool petitfsOpen(GFILE* f, const char* fname); static int petitfsRead(GFILE* f, void* buf, int size); -static gBool petitfsSetPos(GFILE* f, long int pos); +static gBool petitfsSetPos(GFILE* f, gFileSize pos); #if GFILE_NEED_FILELISTS && _FS_MINIMIZE <= 1 static gfileList *petitfsFlOpen(const char *path, gBool dirs); static const char *petitfsFlRead(gfileList *pfl); @@ -103,7 +103,7 @@ static int petitfsRead(GFILE* f, void* buf, int size) return br; } -static gBool petitfsSetPos(GFILE* f, long int pos) +static gBool petitfsSetPos(GFILE* f, gFileSize pos) { (void) f; return pf_lseek((DWORD)pos) == FR_OK; diff --git a/src/gfile/gfile_fs_rom.c b/src/gfile/gfile_fs_rom.c index 315f046e..56181086 100644 --- a/src/gfile/gfile_fs_rom.c +++ b/src/gfile/gfile_fs_rom.c @@ -24,11 +24,11 @@ #define ROMFS_CMP_UNCOMPRESSED 0 typedef struct ROMFS_DIRENTRY { - uint16_t ver; // Directory Entry Version - uint16_t cmp; // Compression format + gU16 ver; // Directory Entry Version + gU16 cmp; // Compression format const struct ROMFS_DIRENTRY * next; // The next entry const char * name; // The file name - long int size; // The file size + gFileSize size; // The file size const char * file; // The file data } ROMFS_DIRENTRY; @@ -43,12 +43,12 @@ typedef struct ROMFileList { static gBool ROMExists(const char *fname); -static long int ROMFilesize(const char *fname); +static gFileSize ROMFilesize(const char *fname); static gBool ROMOpen(GFILE *f, const char *fname); static void ROMClose(GFILE *f); static int ROMRead(GFILE *f, void *buf, int size); -static gBool ROMSetpos(GFILE *f, long int pos); -static long int ROMGetsize(GFILE *f); +static gBool ROMSetpos(GFILE *f, gFileSize pos); +static gFileSize ROMGetsize(GFILE *f); static gBool ROMEof(GFILE *f); #if GFILE_NEED_FILELISTS static gfileList *ROMFlOpen(const char *path, gBool dirs); @@ -84,11 +84,11 @@ static gBool ROMExists(const char *fname) return ROMFindFile(fname) != 0; } -static long int ROMFilesize(const char *fname) +static gFileSize ROMFilesize(const char *fname) { const ROMFS_DIRENTRY *p; - if (!(p = ROMFindFile(fname))) return -1; + if (!(p = ROMFindFile(fname))) return (gFileSize)-1; return p->size; } @@ -118,12 +118,12 @@ static int ROMRead(GFILE *f, void *buf, int size) return size; } -static gBool ROMSetpos(GFILE *f, long int pos) +static gBool ROMSetpos(GFILE *f, gFileSize pos) { return pos <= ((const ROMFS_DIRENTRY *)f->obj)->size; } -static long int ROMGetsize(GFILE *f) +static gFileSize ROMGetsize(GFILE *f) { return ((const ROMFS_DIRENTRY *)f->obj)->size; } diff --git a/src/gfile/gfile_stdio.c b/src/gfile/gfile_stdio.c index 1a045458..9cfc6b75 100644 --- a/src/gfile/gfile_stdio.c +++ b/src/gfile/gfile_stdio.c @@ -39,9 +39,9 @@ int gstdioSeek(GFILE *f, size_t offset, int origin) { return gfileSetPos(f, offset) ? 0 : -1; } -int gstdioGetpos(GFILE *f, long int *pos) { +int gstdioGetpos(GFILE *f, gFileSize *pos) { if (!(f->flags & GFILEFLG_OPEN)) - return -1; + return (gFileSize)-1; *pos = f->pos; return 0; } diff --git a/src/gfx_types.h b/src/gfx_types.h index 5bddffab..97e140a0 100644 --- a/src/gfx_types.h +++ b/src/gfx_types.h @@ -75,12 +75,19 @@ #define GFX_TYPE_64 GFXON /*#elif defined(__GNUC__) || defined(__GNUG__) - typedef __INT8_TYPE__ int8_t; - typedef __UINT8_TYPE__ uint8_t; - typedef __INT16_TYPE__ int16_t; - typedef __UINT16_TYPE__ uint16_t; - typedef __INT32_TYPE__ int32_t; - typedef __UINT32_TYPE__ uint32_t; + typedef __INT8_TYPE__ gI8; + typedef __UINT8_TYPE__ gU8; + typedef __INT16_TYPE__ gI16; + typedef __UINT16_TYPE__ gU16; + typedef __INT32_TYPE__ gI32; + typedef __UINT32_TYPE__ gU32; + #define GI8_C(v) v + #define GU8_C(v) v ## U + #define GI16_C(v) v + #define GU16_C(v) v ## U + #define GI32_C(v) v + #define GU32_C(v) v ## U + #define GFX_TYPE_64 GFXOFF */ #else #include @@ -139,8 +146,15 @@ #endif #endif +typedef void * gAny; typedef void * gPtr; typedef ptrdiff_t gPtrDiff; +#if GFX_MEM_LT64K + typedef gU16 gMemSize; +#else + typedef gU32 gMemSize; +#endif +typedef gI32 gFileSize; typedef gI8 gBool; #define gTrue (-1) #define gFalse (0) diff --git a/src/ginput/ginput_dial.c b/src/ginput/ginput_dial.c index 7763f209..375e10b1 100644 --- a/src/ginput/ginput_dial.c +++ b/src/ginput/ginput_dial.c @@ -21,13 +21,13 @@ static GTIMER_DECL(DialTimer); static struct DialStatus_t { - uint16_t sensitivity; - uint16_t lastvalue; - uint16_t max; + gU16 sensitivity; + gU16 lastvalue; + gU16 max; } DialStatus[GINPUT_DIAL_NUM_PORTS]; // The reading callback function -static void DialCallback(uint16_t instance, uint16_t rawvalue) { +static void DialCallback(gU16 instance, gU16 rawvalue) { struct DialStatus_t *pds; GSourceListener *psl; GEventDial *pe; @@ -37,7 +37,7 @@ static void DialCallback(uint16_t instance, uint16_t rawvalue) { /* Range scale - if needed */ if (pds->max != GINPUT_DIAL_MAX_VALUE) - rawvalue = (uint16_t)((uint32_t)rawvalue * pds->max / GINPUT_DIAL_MAX_VALUE); + rawvalue = (gU16)((gU32)rawvalue * pds->max / GINPUT_DIAL_MAX_VALUE); /* Forget about changes below our sensitivity threshold */ if (rawvalue >= pds->lastvalue) { @@ -62,7 +62,7 @@ static void DialCallback(uint16_t instance, uint16_t rawvalue) { } } -GSourceHandle ginputGetDial(uint16_t instance) { +GSourceHandle ginputGetDial(gU16 instance) { struct DialStatus_t *pds; if (instance >= GINPUT_DIAL_NUM_PORTS) @@ -87,21 +87,21 @@ GSourceHandle ginputGetDial(uint16_t instance) { return (GSourceHandle)(DialStatus+instance); } -void ginputResetDialRange(uint16_t instance) { +void ginputResetDialRange(gU16 instance) { if (instance >= GINPUT_DIAL_NUM_PORTS) return; ginputSetDialRange(instance, GINPUT_DIAL_MAX_VALUE); } -uint16_t ginputGetDialRange(uint16_t instance) { +gU16 ginputGetDialRange(gU16 instance) { if (instance >= GINPUT_DIAL_NUM_PORTS) return 0; return DialStatus[instance].max; } -void ginputSetDialRange(uint16_t instance, uint16_t max) { +void ginputSetDialRange(gU16 instance, gU16 max) { struct DialStatus_t *pds; if (instance >= GINPUT_DIAL_NUM_PORTS) @@ -111,8 +111,8 @@ void ginputSetDialRange(uint16_t instance, uint16_t max) { // Rescale the last value and the sensitivity if (max != pds->max) { - pds->lastvalue = (uint16_t)((uint32_t)pds->lastvalue * max / pds->max); - pds->sensitivity = (uint16_t)((uint32_t)pds->sensitivity * max / pds->max); + pds->lastvalue = (gU16)((gU32)pds->lastvalue * max / pds->max); + pds->sensitivity = (gU16)((gU32)pds->sensitivity * max / pds->max); pds->max = max; } } @@ -124,7 +124,7 @@ void ginputSetDialRange(uint16_t instance, uint16_t max) { * @param[in] instance The ID of the dial input instance * @param[in] diff The amount of level changes */ -void ginputSetDialSensitivity(uint16_t instance, uint16_t diff) { +void ginputSetDialSensitivity(gU16 instance, gU16 diff) { if (instance >= GINPUT_DIAL_NUM_PORTS) return; @@ -139,7 +139,7 @@ void ginputSetDialSensitivity(uint16_t instance, uint16_t diff) { * * @return Returns gFalse on an error (eg invalid instance) */ -gBool ginputGetDialStatus(uint16_t instance, GEventDial *pdial) { +gBool ginputGetDialStatus(gU16 instance, GEventDial *pdial) { if (instance >= GINPUT_DIAL_NUM_PORTS) return gFalse; pdial->type = GEVENT_DIAL; diff --git a/src/ginput/ginput_dial.h b/src/ginput/ginput_dial.h index faf246c3..93c59e3c 100644 --- a/src/ginput/ginput_dial.h +++ b/src/ginput/ginput_dial.h @@ -35,9 +35,9 @@ typedef struct GEventDial_t { GEventType type; // The type of this event (GEVENT_DIAL) - uint16_t instance; // The dial instance - uint16_t value; // The dial value - uint16_t maxvalue; // The maximum dial value + gU16 instance; // The dial instance + gU16 value; // The dial value + gU16 maxvalue; // The maximum dial value } GEventDial; /*===========================================================================*/ @@ -51,14 +51,14 @@ typedef struct GEventDial_t { * * @return The soure handle of the created dial instance */ -GSourceHandle ginputGetDial(uint16_t instance); +GSourceHandle ginputGetDial(gU16 instance); /** * @brief Reset the value back to the hardware default * * @param[in] instance The ID of the dial input instance */ -void ginputResetDialRange(uint16_t instance); +void ginputResetDialRange(gU16 instance); /** * @brief Get the maximum value @@ -68,7 +68,7 @@ void ginputResetDialRange(uint16_t instance); * * @return The maximum value */ -uint16_t ginputGetDialRange(uint16_t instance); +gU16 ginputGetDialRange(gU16 instance); /** * @brief Set the maximum value @@ -77,7 +77,7 @@ uint16_t ginputGetDialRange(uint16_t instance); * @param[in] instance The ID of the dial input instance * @param[in] max The maximum value to be set */ -void ginputSetDialRange(uint16_t instance, uint16_t max); +void ginputSetDialRange(gU16 instance, gU16 max); /** * @brief Set the level change required before a dial even is generated (threshold) @@ -86,7 +86,7 @@ void ginputSetDialRange(uint16_t instance, uint16_t max); * @param[in] instance The ID of the dial input instance * @param[in] diff The amount of level changes */ -void ginputSetDialSensitivity(uint16_t instance, uint16_t diff); +void ginputSetDialSensitivity(gU16 instance, gU16 diff); /** * @brief Get the current dial status @@ -96,7 +96,7 @@ void ginputSetDialSensitivity(uint16_t instance, uint16_t diff); * * @return Returns gFalse on an error (eg invalid instance) */ -gBool ginputGetDialStatus(uint16_t instance, GEventDial *pdial); +gBool ginputGetDialStatus(gU16 instance, GEventDial *pdial); #endif /* GINPUT_NEED_DIAL */ diff --git a/src/ginput/ginput_driver_dial.h b/src/ginput/ginput_driver_dial.h index 86d90c60..ca41e7d7 100644 --- a/src/ginput/ginput_driver_dial.h +++ b/src/ginput/ginput_driver_dial.h @@ -21,7 +21,7 @@ #include "ginput_lld_dial_config.h" -typedef void (*DialCallbackFn)(uint16_t instance, uint16_t rawvalue); +typedef void (*DialCallbackFn)(gU16 instance, gU16 rawvalue); /*===========================================================================*/ /* External declarations. */ diff --git a/src/ginput/ginput_driver_keyboard.h b/src/ginput/ginput_driver_keyboard.h index 0d107274..84c73b9b 100644 --- a/src/ginput/ginput_driver_keyboard.h +++ b/src/ginput/ginput_driver_keyboard.h @@ -24,15 +24,15 @@ typedef struct GKeyboard { GDriver d; // The driver overheads and vmt - uint16_t cntc; // The byte count in c - uint16_t cntsc; // The byte count in sc + gU16 cntc; // The byte count in c + gU16 cntsc; // The byte count in sc char c[8]; // The utf8 code for the current key char sc[8]; // The scancode for the current key - uint32_t keystate; // The keyboard state. - uint16_t flags; + gU32 keystate; // The keyboard state. + gU16 flags; #define GKEYBOARD_FLG_NEEDREAD 0x0001 - uint16_t laystate; // The layout state. - const uint8_t * pLayout; // The current keyboard layout + gU16 laystate; // The layout state. + const gU8 * pLayout; // The current keyboard layout // Other driver specific fields may follow. } GKeyboard; @@ -40,10 +40,10 @@ typedef struct GKeyboardVMT { GDriverVMT d; // Device flags are part of the general vmt #define GKEYBOARD_VFLG_NOPOLL 0x0001 // Do not poll this device - it is purely interrupt driven #define GKEYBOARD_VFLG_DYNAMICONLY 0x8000 // This keyboard driver should not be statically initialized eg Win32 - const uint8_t * defLayout; // The default keyboard layout + const gU8 * defLayout; // The default keyboard layout gBool (*init)(GKeyboard *m, unsigned driverinstance); // Required void (*deinit)(GKeyboard *m); // Optional - int (*getdata)(GKeyboard *k, uint8_t *pch, int sz); // Required. Get zero or more scancode bytes. Returns the number of scancode bytes returns + int (*getdata)(GKeyboard *k, gU8 *pch, int sz); // Required. Get zero or more scancode bytes. Returns the number of scancode bytes returns void (*putdata)(GKeyboard *k, char ch); // Optional. Send a single byte to the keyboard. } GKeyboardVMT; diff --git a/src/ginput/ginput_driver_mouse.h b/src/ginput/ginput_driver_mouse.h index 7a0eb7fc..48d0bc60 100644 --- a/src/ginput/ginput_driver_mouse.h +++ b/src/ginput/ginput_driver_mouse.h @@ -24,7 +24,7 @@ typedef struct GMouseReading { gCoord x, y, z; - uint16_t buttons; + gU16 buttons; } GMouseReading; #if !GINPUT_TOUCH_NOCALIBRATE @@ -41,7 +41,7 @@ typedef struct GMouseReading { typedef struct GMouse { GDriver d; // The driver overheads and vmt GMouseReading r; // The current position and state - uint16_t flags; // Flags + gU16 flags; // Flags #define GMOUSE_FLG_CLICK_TIMER 0x0001 // Currently timing a click #define GMOUSE_FLG_INDELTA 0x0002 // Currently in a up/down transition test #define GMOUSE_FLG_CLIP 0x0004 // Clip reading to the display @@ -88,8 +88,8 @@ typedef struct GMouseVMT { gBool (*init)(GMouse *m, unsigned driverinstance); // Required void (*deinit)(GMouse *m); // Optional gBool (*get)(GMouse *m, GMouseReading *prd); // Required - void (*calsave)(GMouse *m, const void *buf, size_t sz); // Optional - gBool (*calload)(GMouse *m, void *buf, size_t sz); // Optional + void (*calsave)(GMouse *m, const void *buf, gMemSize sz); // Optional + gBool (*calload)(GMouse *m, void *buf, gMemSize sz); // Optional } GMouseVMT; #define gmvmt(m) ((const GMouseVMT const *)((m)->d.vmt)) diff --git a/src/ginput/ginput_keyboard.c b/src/ginput/ginput_keyboard.c index e99be138..2ab84a11 100644 --- a/src/ginput/ginput_keyboard.c +++ b/src/ginput/ginput_keyboard.c @@ -90,7 +90,7 @@ static void SendKeyboardEvent(GKeyboard *k) { #define FLAG_INIT 0x02 #if GKEYBOARD_LAYOUT_OFF - static void microengine(GKeyboard *k, uint8_t code, uint8_t flags) { + static void microengine(GKeyboard *k, gU8 code, gU8 flags) { if (flags) return; @@ -101,10 +101,10 @@ static void SendKeyboardEvent(GKeyboard *k) { k->cntc = k->cntsc = 0; } #else - static void microengine(GKeyboard *k, uint8_t code, uint8_t flags) { - const uint8_t *pc; - const uint8_t *nrec; - uint8_t ver, diff, p1, p2; + static void microengine(GKeyboard *k, gU8 code, gU8 flags) { + const gU8 *pc; + const gU8 *nrec; + gU8 ver, diff, p1, p2; #if MICROCODE_DEBUG unsigned cnt; #endif @@ -446,7 +446,7 @@ static void SendKeyboardEvent(GKeyboard *k) { static void KeyboardPoll(void *param) { GKeyboard * k; - uint8_t scancodes[8]; + gU8 scancodes[8]; int sz, i; (void) param; diff --git a/src/ginput/ginput_keyboard.h b/src/ginput/ginput_keyboard.h index 275bc7f5..78878f37 100644 --- a/src/ginput/ginput_keyboard.h +++ b/src/ginput/ginput_keyboard.h @@ -30,7 +30,7 @@ typedef struct GEventKeyboard_t { GEventType type; // The type of this event (GEVENT_KEYBOARD) - uint16_t bytecount; // The number of bytes in c[]. Note this will only ever represent 0 or 1 characters. This is set to 0 for state transitions. + gU16 bytecount; // The number of bytes in c[]. Note this will only ever represent 0 or 1 characters. This is set to 0 for state transitions. char c[8]; // The utf8 code for the key or a special key code // Normal characters with special meaning. They are a maximum of 1 byte in length. #define GKEY_NULL 0 @@ -104,7 +104,7 @@ typedef struct GEventKeyboard_t { #define GKEY_LAYOUT_FIRST 0xC0 // Special characters the layout can return start here. #define GKEY_DRIVER_FIRST 0xE0 // Special characters the driver can return start here. - uint32_t keystate; // The keyboard state. + gU32 keystate; // The keyboard state. #define GKEYSTATE_KEYUP_BIT 0 #define GKEYSTATE_REPEAT_BIT 1 #define GKEYSTATE_SPECIAL_BIT 2 diff --git a/src/ginput/ginput_keyboard_microcode.c b/src/ginput/ginput_keyboard_microcode.c index 7f916437..ea907373 100644 --- a/src/ginput/ginput_keyboard_microcode.c +++ b/src/ginput/ginput_keyboard_microcode.c @@ -20,7 +20,7 @@ #error "Keyboard Layout SCANCODE2_US is not fully implemented yet" - uint8_t KeyboardLayout_ScancodeSet2_US[] = { + gU8 KeyboardLayout_ScancodeSet2_US[] = { KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1, KMC_RECORDSTART, 0x03, // Handle E0 codes (ignore for now assuming a single character) diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index 72818735..ac434f6e 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -245,15 +245,15 @@ static void GetMouseReading(GMouse *m) { #if !GINPUT_TOUCH_NOTOUCH { const GMouseJitter *pj; - uint32_t diff; + gU32 diff; // Are we in pen or finger mode pj = (m->flags & GMOUSE_FLG_FINGERMODE) ? &gmvmt(m)->finger_jitter : &gmvmt(m)->pen_jitter; // Is this just movement jitter if (pj->move > 0) { - diff = (uint32_t)(r.x - m->r.x) * (uint32_t)(r.x - m->r.x) + (uint32_t)(r.y - m->r.y) * (uint32_t)(r.y - m->r.y); - if (diff < (uint32_t)pj->move * (uint32_t)pj->move) { + diff = (gU32)(r.x - m->r.x) * (gU32)(r.x - m->r.x) + (gU32)(r.y - m->r.y) * (gU32)(r.y - m->r.y); + if (diff < (gU32)pj->move * (gU32)pj->move) { r.x = m->r.x; r.y = m->r.y; } @@ -261,8 +261,8 @@ static void GetMouseReading(GMouse *m) { // Check if the click has moved outside the click area and if so cancel the click if (pj->click > 0 && (m->flags & GMOUSE_FLG_CLICK_TIMER)) { - diff = (uint32_t)(r.x - m->clickpos.x) * (uint32_t)(r.x - m->clickpos.x) + (uint32_t)(r.y - m->clickpos.y) * (uint32_t)(r.y - m->clickpos.y); - if (diff > (uint32_t)pj->click * (uint32_t)pj->click) + diff = (gU32)(r.x - m->clickpos.x) * (gU32)(r.x - m->clickpos.x) + (gU32)(r.y - m->clickpos.y) * (gU32)(r.y - m->clickpos.y); + if (diff > (gU32)pj->click * (gU32)pj->click) m->flags &= ~GMOUSE_FLG_CLICK_TIMER; } } @@ -270,7 +270,7 @@ static void GetMouseReading(GMouse *m) { // Step 5 - Click, context-click and other meta event detection { - uint16_t upbtns, dnbtns; + gU16 upbtns, dnbtns; // Calculate button transitions dnbtns = r.buttons & ~m->r.buttons; @@ -461,11 +461,11 @@ static void MousePoll(void *param) { + c2 * ((float)points[0].x * (float)points[1].y - (float)points[1].x * (float)points[0].y)) / dx; } - static uint32_t CalibrateMouse(GMouse *m) { + static gU32 CalibrateMouse(GMouse *m) { gCoord w, h; gPoint cross[4]; // The locations of the test points on the display gPoint points[4]; // The x, y readings obtained from the mouse for each test point - uint32_t err; + gU32 err; #if GDISP_NEED_TEXT gFont font1, font2; #endif @@ -516,7 +516,7 @@ static void MousePoll(void *param) { // Loop through the calibration points for(i = 0; i < maxpoints; i++) { - int32_t px, py; + gI32 px, py; unsigned j; // Draw the current calibration point @@ -597,7 +597,7 @@ static void MousePoll(void *param) { // Is this accurate enough? err = (points[3].x - cross[3].x) * (points[3].x - cross[3].x) + (points[3].y - cross[3].y) * (points[3].y - cross[3].y); - if (err > (uint32_t)pj->calibrate * (uint32_t)pj->calibrate) { + if (err > (gU32)pj->calibrate * (gU32)pj->calibrate) { #if GDISP_NEED_TEXT // No - Display error and return gdispGFillStringBox(m->display, @@ -803,7 +803,7 @@ gBool ginputGetMouseStatus(unsigned instance, GEventMouse *pe) { #endif #if !GINPUT_TOUCH_NOCALIBRATE_GUI - uint32_t ginputCalibrateMouse(unsigned instance) { + gU32 ginputCalibrateMouse(unsigned instance) { GMouse *m; // Find the instance diff --git a/src/ginput/ginput_mouse.h b/src/ginput/ginput_mouse.h index 65c9243b..2e8f2f77 100644 --- a/src/ginput/ginput_mouse.h +++ b/src/ginput/ginput_mouse.h @@ -36,7 +36,7 @@ typedef struct GEventMouse_t { gCoord x, y, z; // The position of the mouse. // - For touch devices, Z is the current pressure if supported (values are device specific) // - For mice, Z is the 3rd dimension if supported (values are device specific) - uint16_t buttons; // A bit is set if the button is down or a meta event has occurred. + gU16 buttons; // A bit is set if the button is down or a meta event has occurred. #define GINPUT_MOUSE_BTN_MASK 0x000F // The "button is down" mask #define GINPUT_MOUSE_BTN_LEFT 0x0001 // The left mouse button is currently down #define GINPUT_MOUSE_BTN_RIGHT 0x0002 // The right mouse button is currently down @@ -145,7 +145,7 @@ gBool ginputGetMouseStatus(unsigned instance, GEventMouse *pmouse); * @return The calibration error squared if calibration fails, or 0 on success or if the driver dosen't need calibration. * @note An invalid instance will also return 0. */ -uint32_t ginputCalibrateMouse(unsigned instance); +gU32 ginputCalibrateMouse(unsigned instance); /** * @brief Load a set of mouse calibration data @@ -159,7 +159,7 @@ uint32_t ginputCalibrateMouse(unsigned instance); * called if GINPUT_TOUCH_USER_CALIBRATION_LOAD has been set to GFXON in the * users gfxconf.h file. */ -gBool LoadMouseCalibration(unsigned instance, void *data, size_t sz); +gBool LoadMouseCalibration(unsigned instance, void *data, gMemSize sz); /** * @brief Save a set of mouse calibration data @@ -173,7 +173,7 @@ gBool LoadMouseCalibration(unsigned instance, void *data, size_t sz); * called if GINPUT_TOUCH_USER_CALIBRATION_SAVE has been set to GFXON in the * users gfxconf.h file. */ -gBool SaveMouseCalibration(unsigned instance, const void *data, size_t sz); +gBool SaveMouseCalibration(unsigned instance, const void *data, gMemSize sz); #endif /* GINPUT_NEED_MOUSE */ diff --git a/src/ginput/ginput_toggle.c b/src/ginput/ginput_toggle.c index 09681d24..1040a6f8 100644 --- a/src/ginput/ginput_toggle.c +++ b/src/ginput/ginput_toggle.c @@ -24,7 +24,7 @@ static GTIMER_DECL(ToggleTimer); static struct GEventToggleStatus_t { - uint8_t status; + gU8 status; } ToggleStatus[GINPUT_TOGGLE_NUM_PORTS]; // Our polling function @@ -35,7 +35,7 @@ static void TogglePoll(void *param) { GSourceListener *psl; GEventToggle *pe; unsigned i, bits, mask; - uint8_t state; + gU8 state; // Loop while there are bits to get for(ptc = GInputToggleConfigTable, i=0; i < GINPUT_TOGGLE_NUM_PORTS; ptc++) { @@ -92,7 +92,7 @@ static void TogglePoll(void *param) { } /* Hardware Toggle/Switch/Button Functions */ -GSourceHandle ginputGetToggle(uint16_t instance) { +GSourceHandle ginputGetToggle(gU16 instance) { const GToggleConfig *ptc; if (instance >= GINPUT_TOGGLE_NUM_PORTS) @@ -110,7 +110,7 @@ GSourceHandle ginputGetToggle(uint16_t instance) { } // If invert is true, invert the on/off sense for the toggle -void ginputInvertToggle(uint16_t instance, gBool invert) { +void ginputInvertToggle(gU16 instance, gBool invert) { if (instance >= GINPUT_TOGGLE_NUM_PORTS) return; if (invert) { @@ -129,7 +129,7 @@ void ginputInvertToggle(uint16_t instance, gBool invert) { /* Get the current toggle status. * Returns gFalse on error (eg invalid instance) */ -gBool ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle) { +gBool ginputGetToggleStatus(gU16 instance, GEventToggle *ptoggle) { // Win32 threads don't seem to recognise priority and/or pre-emption // so we add a sleep here to prevent 100% polled applications from locking up. gfxSleepMilliseconds(1); diff --git a/src/ginput/ginput_toggle.h b/src/ginput/ginput_toggle.h index d8f76029..94699ced 100644 --- a/src/ginput/ginput_toggle.h +++ b/src/ginput/ginput_toggle.h @@ -47,7 +47,7 @@ typedef struct GEventToggle_t { GEventType type; // The type of this event (GEVENT_TOGGLE) - uint16_t instance; // The toggle instance + gU16 instance; // The toggle instance gBool on; // True if the toggle/button is on } GEventToggle; @@ -66,7 +66,7 @@ typedef struct GEventToggle_t { * * @return The source handle of the created instance */ -GSourceHandle ginputGetToggle(uint16_t instance); +GSourceHandle ginputGetToggle(gU16 instance); /** * @brief Can be used to invert the sense of a toggle @@ -74,7 +74,7 @@ GSourceHandle ginputGetToggle(uint16_t instance); * @param[in] instance The ID of the toggle input instance * @param[in] invert If gTrue, will be inverted */ -void ginputInvertToggle(uint16_t instance, gBool invert); +void ginputInvertToggle(gU16 instance, gBool invert); /** * @brief Get the current toggle status @@ -84,7 +84,7 @@ void ginputInvertToggle(uint16_t instance, gBool invert); * * @return Returns gFalse on an error (eg invalid instance) */ -gBool ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle); +gBool ginputGetToggleStatus(gU16 instance, GEventToggle *ptoggle); #endif /* GINPUT_NEED_TOGGLE */ diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h index 411cbb02..2cfd04bf 100644 --- a/src/gmisc/gmisc.h +++ b/src/gmisc/gmisc.h @@ -57,7 +57,7 @@ typedef enum ArrayDataFormat_e { * @brief The type for a fixed point type. * @details The top 16 bits are the integer component, the bottom 16 bits are the real component. */ -typedef int32_t fixed; +typedef gI32 fixed; /** * @brief Macros to convert to and from a fixed point. @@ -112,20 +112,20 @@ typedef int32_t fixed; * * @api */ - void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, size_t cnt); + void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, gMemSize cnt); #if 0 - void gmiscArrayTranslate(ArrayDataFormat fmt, void *src, void *dst, size_t cnt, int trans); + void gmiscArrayTranslate(ArrayDataFormat fmt, void *src, void *dst, gMemSize cnt, int trans); - void gmiscArrayMultiply(ArrayDataFormat fmt, void *src, void *dst, size_t cnt, int mult); + void gmiscArrayMultiply(ArrayDataFormat fmt, void *src, void *dst, gMemSize cnt, int mult); - void gmiscArrayDivide(ArrayDataFormat fmt, void *src, void *dst, size_t cnt, int mdiv); + void gmiscArrayDivide(ArrayDataFormat fmt, void *src, void *dst, gMemSize cnt, int mdiv); - void gmiscArrayMultDiv(ArrayDataFormat fmt, void *src, void *dst, size_t cnt, int mult, int div); + void gmiscArrayMultDiv(ArrayDataFormat fmt, void *src, void *dst, gMemSize cnt, int mult, int div); - void gmiscArrayAdd(ArrayDataFormat fmt, void *src1, void *src2, void *dst, size_t cnt); + void gmiscArrayAdd(ArrayDataFormat fmt, void *src1, void *src2, void *dst, gMemSize cnt); - void gmiscArrayAddNoOverflow(ArrayDataFormat fmt, void *src1, void *src2, void *dst, size_t cnt); + void gmiscArrayAddNoOverflow(ArrayDataFormat fmt, void *src1, void *src2, void *dst, gMemSize cnt); #endif #endif diff --git a/src/gmisc/gmisc_arrayops.c b/src/gmisc/gmisc_arrayops.c index d159a58d..824ef35c 100644 --- a/src/gmisc/gmisc_arrayops.c +++ b/src/gmisc/gmisc_arrayops.c @@ -9,9 +9,9 @@ #if GFX_USE_GMISC && GMISC_NEED_ARRAYOPS -void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, size_t cnt) { - uint8_t *src8, *dst8; - uint16_t *src16, *dst16; +void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, gMemSize cnt) { + gU8 *src8, *dst8; + gU16 *src16, *dst16; dst8 = dst; dst16 = dst; diff --git a/src/gmisc/gmisc_hittest.c b/src/gmisc/gmisc_hittest.c index b3c21e26..826b3a78 100644 --- a/src/gmisc/gmisc_hittest.c +++ b/src/gmisc/gmisc_hittest.c @@ -66,8 +66,8 @@ static char _pointCrossingSegment(const gPoint *a, const gPoint *b, const gPoint gBool gmiscHittestPoly(const gPoint *pntarray, unsigned cnt, const gPoint *p) { unsigned i = 0; - uint8_t nbrIntersection = 0; - int8_t crossResult; + gU8 nbrIntersection = 0; + gI8 crossResult; // For each pair of points for (i = 0; i < cnt-1; i++) { diff --git a/src/gmisc/gmisc_trig.c b/src/gmisc/gmisc_trig.c index 7d18cf2e..451c408b 100644 --- a/src/gmisc/gmisc_trig.c +++ b/src/gmisc/gmisc_trig.c @@ -144,7 +144,7 @@ } #else float invsqrt(float n) { - int32_t i; + gI32 i; float x2; x2 = n * 0.5F; @@ -156,7 +156,7 @@ ((char *)&i)[2] = ((char *)&n)[1]; ((char *)&i)[3] = ((char *)&n)[0]; #else - i = *(int32_t *)&n; + i = *(gI32 *)&n; #endif // evil floating point bit level hacking diff --git a/src/gos/gos.h b/src/gos/gos.h index d01bc070..a41712ce 100644 --- a/src/gos/gos.h +++ b/src/gos/gos.h @@ -82,7 +82,7 @@ * Many platforms will round the size to ensure correct stack alignment. * Other platforms may entirely ignore the suggested size. */ - #define DECLARE_THREAD_STACK(name, sz) uint8_t name[sz]; + #define DECLARE_THREAD_STACK(name, sz) gU8 name[sz]; /* * @brief Return from a thread @@ -153,7 +153,7 @@ * * @api */ - void *gfxAlloc(size_t sz); + void *gfxAlloc(gMemSize sz); /** * @brief Re-allocate memory @@ -173,7 +173,7 @@ * * @api */ - void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); + void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz); /** * @brief Free memory @@ -420,7 +420,7 @@ * * @api */ - gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); + gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); /** * @brief Wait for a thread to finish. diff --git a/src/gos/gos_arduino.c b/src/gos/gos_arduino.c index 09241a28..30e731f1 100644 --- a/src/gos/gos_arduino.c +++ b/src/gos/gos_arduino.c @@ -53,7 +53,7 @@ void _gosDeinit(void) *********************************************************/ void gfxHalt(const char *msg) { - volatile uint32_t dummy; + volatile gU32 dummy; (void) msg; while(1) @@ -61,7 +61,7 @@ void gfxHalt(const char *msg) { } void gfxExit(void) { - volatile uint32_t dummy; + volatile gU32 dummy; while(1) dummy++; diff --git a/src/gos/gos_chibios.c b/src/gos/gos_chibios.c index d393251a..be7cd935 100644 --- a/src/gos/gos_chibios.c +++ b/src/gos/gos_chibios.c @@ -64,7 +64,7 @@ void _gosDeinit(void) /* ToDo */ } -void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz) +void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz) { void *np; @@ -175,7 +175,7 @@ void gfxSemSignalI(gfxSem *psem) #endif } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { if (!stackarea) { if (!stacksz) stacksz = 256; diff --git a/src/gos/gos_chibios.h b/src/gos/gos_chibios.h index 497c6776..5dfcad07 100644 --- a/src/gos/gos_chibios.h +++ b/src/gos/gos_chibios.h @@ -101,7 +101,7 @@ typedef tprio_t gThreadpriority; #define gfxSystemUnlock() chSysUnlock() #define gfxMutexDestroy(pmutex) (void)pmutex #define gfxMutexEnter(pmutex) chMtxLock(pmutex) -void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); +void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz); void gfxSleepMilliseconds(gDelay ms); void gfxSleepMicroseconds(gDelay ms); void gfxSemInit(gfxSem *psem, gSemcount val, gSemcount limit); @@ -110,7 +110,7 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms); gBool gfxSemWaitI(gfxSem *psem); void gfxSemSignal(gfxSem *psem); void gfxSemSignalI(gfxSem *psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); #define gfxThreadWait(thread) chThdWait(thread) #define gfxThreadMe() chThdSelf() #define gfxThreadClose(thread) (void)thread diff --git a/src/gos/gos_cmsis.c b/src/gos/gos_cmsis.c index 2dcb0d19..4ab652e0 100644 --- a/src/gos/gos_cmsis.c +++ b/src/gos/gos_cmsis.c @@ -88,7 +88,7 @@ void gfxSemSignalI(gfxSem* psem) } } -gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param) +gThread gfxThreadCreate(void* stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param) { osThreadDef_t def; diff --git a/src/gos/gos_cmsis.h b/src/gos/gos_cmsis.h index 17b8c295..3c1c8a73 100644 --- a/src/gos/gos_cmsis.h +++ b/src/gos/gos_cmsis.h @@ -27,9 +27,9 @@ #define gDelayNone 0 #define gDelayForever osWaitForever -typedef uint32_t gDelay; -typedef uint32_t gTicks; -typedef uint16_t gSemcount; +typedef gU32 gDelay; +typedef gU32 gTicks; +typedef gU16 gSemcount; typedef void gThreadreturn; typedef osPriority gThreadpriority; @@ -39,19 +39,19 @@ typedef osPriority gThreadpriority; #define gThreadpriorityHigh osPriorityHigh typedef struct gfxSem { - uint32_t semaphore[2]; + gU32 semaphore[2]; osSemaphoreId id; gSemcount available; } gfxSem; typedef struct gfxMutex { - uint32_t mutex[4]; + gU32 mutex[4]; osMutexId id; } gfxMutex; typedef osThreadId gThread; -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]; // Some compilers don't allow zero sized arrays. Let's waste one byte +#define DECLARE_THREAD_STACK(name, sz) gU8 name[1]; // Some compilers don't allow zero sized arrays. Let's waste one byte #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void* param) #define THREAD_RETURN(retval) @@ -79,7 +79,7 @@ gBool gfxSemWaitI(gfxSem* psem); void gfxSemSignal(gfxSem* psem); void gfxSemSignalI(gfxSem* psem); -gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param); +gThread gfxThreadCreate(void* stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param); #define gfxYield() osThreadYield() #define gfxThreadMe() osThreadGetId() #define gfxThreadClose(thread) {} diff --git a/src/gos/gos_cmsis2.c b/src/gos/gos_cmsis2.c index b1dd1dd6..9bc5e112 100644 --- a/src/gos/gos_cmsis2.c +++ b/src/gos/gos_cmsis2.c @@ -76,7 +76,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms) return gFalse; } -gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param) +gThread gfxThreadCreate(void* stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param) { osThreadAttr_t def; diff --git a/src/gos/gos_cmsis2.h b/src/gos/gos_cmsis2.h index fd702027..e45dd91f 100644 --- a/src/gos/gos_cmsis2.h +++ b/src/gos/gos_cmsis2.h @@ -27,9 +27,9 @@ #define gDelayNone 0 #define gDelayForever osWaitForever -typedef uint32_t gDelay; -typedef uint32_t gTicks; -typedef uint16_t gSemcount; +typedef gU32 gDelay; +typedef gU32 gTicks; +typedef gU16 gSemcount; typedef void gThreadreturn; typedef osPriority_t gThreadpriority; @@ -44,7 +44,7 @@ typedef osMutexId_t gfxMutex; typedef osThreadId_t gThread; -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]; // Some compilers don't allow zero sized arrays. Let's waste one byte +#define DECLARE_THREAD_STACK(name, sz) gU8 name[1]; // Some compilers don't allow zero sized arrays. Let's waste one byte #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void* param) #define THREAD_RETURN(retval) @@ -72,7 +72,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms); #define gfxSemSignal(psem) osSemaphoreRelease(*(psem)) #define gfxSemSignalI(psem) osSemaphoreRelease(*(psem)) -gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param); +gThread gfxThreadCreate(void* stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param); #define gfxYield() osThreadYield() #define gfxThreadMe() osThreadGetId() #define gfxThreadClose(thread) {} diff --git a/src/gos/gos_ecos.c b/src/gos/gos_ecos.c index 1842acda..bbd4f87c 100644 --- a/src/gos/gos_ecos.c +++ b/src/gos/gos_ecos.c @@ -96,7 +96,7 @@ void gfxSemSignalI(gfxSem *psem) cyg_semaphore_post(&psem->sem); } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { gThread th; diff --git a/src/gos/gos_ecos.h b/src/gos/gos_ecos.h index e529e88e..7971be8d 100644 --- a/src/gos/gos_ecos.h +++ b/src/gos/gos_ecos.h @@ -77,7 +77,7 @@ gBool gfxSemWaitI(gfxSem *psem); void gfxSemSignal(gfxSem *psem); void gfxSemSignalI(gfxSem *psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); #define gfxThreadWait(thread) NOTIMPLEMENTED_YET #define gfxThreadMe() cyg_thread_self() #define gfxThreadClose(thread) (void)thread diff --git a/src/gos/gos_freertos.c b/src/gos/gos_freertos.c index fee852c9..7680cd4c 100644 --- a/src/gos/gos_freertos.c +++ b/src/gos/gos_freertos.c @@ -66,7 +66,7 @@ void _gosDeinit(void) #endif } -void* gfxRealloc(void *ptr, size_t oldsz, size_t newsz) +void* gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz) { void *np; @@ -146,7 +146,7 @@ void gfxSemSignalI(gfxSem* psem) xSemaphoreGiveFromISR(*psem,&xHigherPriorityTaskWoken); } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { gThread task; (void) stackarea; diff --git a/src/gos/gos_freertos.h b/src/gos/gos_freertos.h index 1a2e6f99..37711b93 100644 --- a/src/gos/gos_freertos.h +++ b/src/gos/gos_freertos.h @@ -26,9 +26,9 @@ #define gDelayNone 0 #define gDelayForever ((gDelay)-1) -typedef uint32_t gDelay; +typedef gU32 gDelay; typedef portTickType gTicks; -typedef int32_t gSemcount; +typedef gI32 gSemcount; typedef void gThreadreturn; typedef portBASE_TYPE gThreadpriority; @@ -38,7 +38,7 @@ typedef portBASE_TYPE gThreadpriority; #define gThreadpriorityHigh configMAX_PRIORITIES-1 /* FreeRTOS will allocate the stack when creating the thread */ -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1] +#define DECLARE_THREAD_STACK(name, sz) gU8 name[1] #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) #define THREAD_RETURN(retval) @@ -65,7 +65,7 @@ void gfxMutexInit(gfxMutex* s); #define gfxMutexEnter(pmutex) xSemaphoreTake(*(pmutex),portMAX_DELAY) #define gfxMutexExit(pmutex) xSemaphoreGive(*(pmutex)) -void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); +void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz); void gfxSleepMilliseconds(gDelay ms); void gfxSleepMicroseconds(gDelay ms); @@ -75,7 +75,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms); gBool gfxSemWaitI(gfxSem* psem); void gfxSemSignal(gfxSem* psem); void gfxSemSignalI(gfxSem* psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); #define gfxThreadMe() xTaskGetCurrentTaskHandle() #if INCLUDE_eTaskGetState == 1 diff --git a/src/gos/gos_linux.c b/src/gos/gos_linux.c index b5754d86..5a098509 100644 --- a/src/gos/gos_linux.c +++ b/src/gos/gos_linux.c @@ -109,7 +109,7 @@ gTicks gfxSystemTicks(void) { return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { gThread th; (void) stackarea; (void) stacksz; diff --git a/src/gos/gos_linux.h b/src/gos/gos_linux.h index 583c0c0f..4f47cd4d 100644 --- a/src/gos/gos_linux.h +++ b/src/gos/gos_linux.h @@ -28,11 +28,11 @@ typedef void * gThreadreturn; typedef unsigned long gDelay; typedef pthread_t gThread; typedef int gThreadpriority; -typedef uint32_t gSemcount; +typedef gU32 gSemcount; typedef pthread_mutex_t gfxMutex; #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[0]; +#define DECLARE_THREAD_STACK(name, sz) gU8 name[0]; #define THREAD_RETURN(retval) return retval #define gfxExit() exit(0) @@ -85,7 +85,7 @@ void gfxSemInit(gfxSem *psem, gSemcount val, gSemcount limit); void gfxSemDestroy(gfxSem *psem); gBool gfxSemWait(gfxSem *psem, gDelay ms); void gfxSemSignal(gfxSem *psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); gThreadreturn gfxThreadWait(gThread thread); #endif /* GFX_USE_OS_LINUX */ diff --git a/src/gos/gos_nios.c b/src/gos/gos_nios.c index 154be3d0..ba1126ea 100644 --- a/src/gos/gos_nios.c +++ b/src/gos/gos_nios.c @@ -35,7 +35,7 @@ void _gosDeinit(void) void gfxHalt(const char *msg) { - volatile uint32_t dummy; + volatile gU32 dummy; (void)msg; @@ -45,7 +45,7 @@ void gfxHalt(const char *msg) } void gfxExit(void) { - volatile uint32_t dummy; + volatile gU32 dummy; while(1) { dummy++; diff --git a/src/gos/gos_options.h b/src/gos/gos_options.h index e0187e6a..bdb2b139 100644 --- a/src/gos/gos_options.h +++ b/src/gos/gos_options.h @@ -260,6 +260,21 @@ #ifndef GFX_EMULATE_MALLOC #define GFX_EMULATE_MALLOC GFXOFF #endif + /** + * @brief Is the maximum memory allocation less than 64K + * @details Defaults to GFXOFF + * @note Many CPU's cannot allocate memory blocks larger than 64K. Note that this + * is not necessarily mean that a pointer is 16 bit but a 16 bit pointer + * will definitely impose this restriction. An example is the x86 processor + * running in "FAR" mode. Pointers are 32 bit but the maximum size memory block is 64K. + * @note Specifying this only leads to code and memory optimisations. uGFX should still work + * on these processors even if it is not set although obviously an attempted memory + * allocation larger than 64K will fail. + */ + #ifndef GFX_MEM_LT64K + #define GFX_MEM_LT64K GFXOFF + #endif + /** @} */ #endif /* _GOS_OPTIONS_H */ diff --git a/src/gos/gos_osx.c b/src/gos/gos_osx.c index 425e6345..b64d3d40 100644 --- a/src/gos/gos_osx.c +++ b/src/gos/gos_osx.c @@ -92,7 +92,7 @@ gTicks gfxSystemTicks(void) { return ts.tv_sec * 1000UL + ts.tv_nsec / 1000000; } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { gThread th; (void) stackarea; (void) stacksz; diff --git a/src/gos/gos_osx.h b/src/gos/gos_osx.h index 90316f2d..c81f84ae 100644 --- a/src/gos/gos_osx.h +++ b/src/gos/gos_osx.h @@ -19,11 +19,11 @@ typedef void * gThreadreturn; typedef unsigned long gDelay; typedef pthread_t gThread; typedef int gThreadpriority; -typedef uint32_t gSemcount; +typedef gU32 gSemcount; typedef pthread_mutex_t gfxMutex; #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[0]; +#define DECLARE_THREAD_STACK(name, sz) gU8 name[0]; #define THREAD_RETURN(retval) return retval #define gfxExit() exit(0) @@ -69,7 +69,7 @@ void gfxSemInit(gfxSem *psem, gSemcount val, gSemcount limit); void gfxSemDestroy(gfxSem *psem); gBool gfxSemWait(gfxSem *psem, gDelay ms); void gfxSemSignal(gfxSem *psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); gThreadreturn gfxThreadWait(gThread thread); #endif /* GFX_USE_OS_OSX */ diff --git a/src/gos/gos_qt.cpp b/src/gos/gos_qt.cpp index 2e15fc0f..5a9c613a 100644 --- a/src/gos/gos_qt.cpp +++ b/src/gos/gos_qt.cpp @@ -64,7 +64,7 @@ void _gosDeinit(void) void gfxHalt(const char *msg) { - volatile uint32_t dummy; + volatile gU32 dummy; (void)msg; @@ -75,19 +75,19 @@ void gfxHalt(const char *msg) void gfxExit(void) { - volatile uint32_t dummy; + volatile gU32 dummy; while(1) { dummy++; } } -void* gfxAlloc(size_t sz) +void* gfxAlloc(gMemSize sz) { return malloc(sz); } -void* gfxRealloc(void* ptr, size_t oldsz, size_t newsz) +void* gfxRealloc(void* ptr, gMemSize oldsz, gMemSize newsz) { Q_UNUSED(oldsz) return realloc(ptr, newsz); @@ -185,7 +185,7 @@ void gfxSemSignalI(gfxSem *psem) static_cast(*psem)->release(1); } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { Q_UNUSED(stackarea) diff --git a/src/gos/gos_qt.h b/src/gos/gos_qt.h index 69a3c256..5e061228 100644 --- a/src/gos/gos_qt.h +++ b/src/gos/gos_qt.h @@ -11,7 +11,7 @@ #if GFX_USE_OS_QT #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[0] +#define DECLARE_THREAD_STACK(name, sz) gU8 name[0] #define THREAD_RETURN(retval) return retval #define gDelayNone 0 @@ -35,8 +35,8 @@ void _gosDeinit(); void gfxHalt(const char* msg); void gfxExit(void); -void* gfxAlloc(size_t sz); -void* gfxRealloc(void *ptr, size_t oldsz, size_t newsz); +void* gfxAlloc(gMemSize sz); +void* gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz); void gfxFree(void* ptr); void gfxYield(void); void gfxSleepMilliseconds(gDelay ms); @@ -55,7 +55,7 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms); gBool gfxSemWaitI(gfxSem *psem); void gfxSemSignal(gfxSem *psem); void gfxSemSignalI(gfxSem *psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); gThreadreturn gfxThreadWait(gThread thread); gThread gfxThreadMe(void); void gfxThreadClose(gThread thread); diff --git a/src/gos/gos_raw32.c b/src/gos/gos_raw32.c index 5351e7df..71c37865 100644 --- a/src/gos/gos_raw32.c +++ b/src/gos/gos_raw32.c @@ -87,7 +87,7 @@ void gfxHalt(const char *msg) { fprintf(stderr, "%s\n", msg); ExitProcess(1); #else - volatile uint32_t dummy; + volatile gU32 dummy; (void) msg; while(1) @@ -99,7 +99,7 @@ void gfxExit(void) { #if defined(WIN32) ExitProcess(0); #else - volatile uint32_t dummy; + volatile gU32 dummy; while(1) dummy++; diff --git a/src/gos/gos_rawrtos.c b/src/gos/gos_rawrtos.c index 32e19017..2f66bc06 100644 --- a/src/gos/gos_rawrtos.c +++ b/src/gos/gos_rawrtos.c @@ -75,7 +75,7 @@ gBool gfxSemWaitI(gfxSem* psem) return gFalse; } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { RAW_U16 ret; gThread taskobj; diff --git a/src/gos/gos_rawrtos.h b/src/gos/gos_rawrtos.h index ed42c404..51852fb7 100644 --- a/src/gos/gos_rawrtos.h +++ b/src/gos/gos_rawrtos.h @@ -7,10 +7,10 @@ #define gDelayNone (RAW_NO_WAIT) #define gDelayForever (RAW_WAIT_FOREVER) -typedef uint32_t gDelay; +typedef gU32 gDelay; typedef RAW_TICK_TYPE gTicks; -typedef int32_t gSemcount; -typedef uint32_t gThreadreturn; +typedef gI32 gSemcount; +typedef gU32 gThreadreturn; typedef RAW_U8 gThreadpriority; #define MAX_SEMAPHORE_COUNT RAW_SEMAPHORE_COUNT @@ -67,7 +67,7 @@ void gfxSleepMilliseconds(gDelay ms); void gfxSleepMicroseconds(gDelay us); gBool gfxSemWait(gfxSem* psem, gDelay ms); gBool gfxSemWaitI(gfxSem* psem); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); #endif diff --git a/src/gos/gos_win32.c b/src/gos/gos_win32.c index 88936ce8..54797c98 100644 --- a/src/gos/gos_win32.c +++ b/src/gos/gos_win32.c @@ -103,7 +103,7 @@ gSemcount gfxSemCounter(gfxSem *pSem) { } */ -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param) { +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param) { (void) stackarea; HANDLE thd; diff --git a/src/gos/gos_win32.h b/src/gos/gos_win32.h index f9ac10b4..1d74952f 100644 --- a/src/gos/gos_win32.h +++ b/src/gos/gos_win32.h @@ -32,7 +32,7 @@ typedef DWORD gThreadreturn; typedef int gThreadpriority; #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn (WINAPI fnName)(void *param) -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]; +#define DECLARE_THREAD_STACK(name, sz) gU8 name[1]; #define THREAD_RETURN(retval) return retval #define gDelayNone 0 @@ -75,7 +75,7 @@ void gfxSleepMicroseconds(gDelay ms); gBool gfxSemWait(gfxSem *psem, gDelay ms); void gfxSystemLock(void); void gfxSystemUnlock(void); -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param); gThreadreturn gfxThreadWait(gThread thread); #endif /* GFX_USE_OS_WIN32 */ diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c index 1a8f1061..d8f28a3a 100644 --- a/src/gos/gos_x_heap.c +++ b/src/gos/gos_x_heap.c @@ -17,11 +17,11 @@ void _gosHeapInit(void) { } - void *gfxAlloc(size_t sz) { + void *gfxAlloc(gMemSize sz) { return malloc(sz); } - void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz) { + void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz) { (void) oldsz; return realloc(ptr, newsz); } @@ -34,7 +34,7 @@ // Slot structure - user memory follows typedef struct memslot { - size_t sz; // Includes the size of this memslot. + gMemSize sz; // Includes the size of this memslot. } memslot; // Free Slot - immediately follows the memslot structure @@ -54,7 +54,7 @@ gfxAddHeapBlock(heap, GFX_OS_HEAP_SIZE); } - void gfxAddHeapBlock(void *ptr, size_t sz) { + void gfxAddHeapBlock(void *ptr, gMemSize sz) { if (sz < sizeof(memslot)+sizeof(freeslot)) return; @@ -62,7 +62,7 @@ gfxFree(Slot2Ptr((memslot *)ptr)); } - void *gfxAlloc(size_t sz) { + void *gfxAlloc(gMemSize sz) { register memslot *prev, *p, *pnew; if (!sz) return 0; @@ -94,7 +94,7 @@ return 0; } - void *gfxRealloc(void *ptr, size_t oldsz, size_t sz) { + void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize sz) { register memslot *prev, *p, *pfree; (void) oldsz; @@ -187,7 +187,7 @@ #include void* malloc(size_t size) { - return gfxAlloc(size); + return gfxAlloc((gMemSize)size); } void free(void *ptr) { gfxFree(ptr); diff --git a/src/gos/gos_x_heap.h b/src/gos/gos_x_heap.h index 205591ca..26b3e43b 100644 --- a/src/gos/gos_x_heap.h +++ b/src/gos/gos_x_heap.h @@ -25,11 +25,11 @@ * @pre GFX_OS_HEAP_SIZE != 0 and an operating system that uses the * internal ugfx heap allocator rather than its own allocator. */ - void gfxAddHeapBlock(void *ptr, size_t sz); + void gfxAddHeapBlock(void *ptr, gMemSize sz); #endif -void *gfxAlloc(size_t sz); -void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); +void *gfxAlloc(gMemSize sz); +void *gfxRealloc(void *ptr, gMemSize oldsz, gMemSize newsz); void gfxFree(void *ptr); #endif /* GOS_NEED_X_HEAP */ diff --git a/src/gos/gos_x_threads.c b/src/gos/gos_x_threads.c index a07a2feb..f9c57460 100644 --- a/src/gos/gos_x_threads.c +++ b/src/gos/gos_x_threads.c @@ -175,7 +175,7 @@ typedef struct thread { #define FLG_THD_MAIN 0x0002 #define FLG_THD_DEAD 0x0004 #define FLG_THD_WAIT 0x0008 - size_t size; // Size of the thread stack (including this structure) + gMemSize size; // Size of the thread stack (including this structure) gThreadreturn (*fn)(void *param); // Thread function void * param; // Parameter for the thread function void * cxt; // The current thread context. @@ -244,9 +244,9 @@ static thread mainthread; // The main thread context * * AUTO_DETECT_STACKFRAME GFXON/GFXOFF - GFXON to auto-detect stack frame structure * STACK_DIR_UP Macro/gBool - GFXON if the stack grows up instead of down - * MASK1 Macro/uint32_t - The 1st mask of jmp_buf elements that need relocation - * MASK2 Macro/uint32_t - The 2nd mask of jmp_buf elements that need relocation - * STACK_BASE Macro/size_t - The base of the stack frame relative to the local variables + * MASK1 Macro/gU32 - The 1st mask of jmp_buf elements that need relocation + * MASK2 Macro/gU32 - The 2nd mask of jmp_buf elements that need relocation + * STACK_BASE Macro/gMemSize - The base of the stack frame relative to the local variables * _gfxThreadsInit() Macro/Function - Initialise the scheduler * */ @@ -276,9 +276,9 @@ static thread mainthread; // The main thread context } saveloc; static gBool stackdirup; - static uint32_t jmpmask1; - static uint32_t jmpmask2; - static size_t stackbase; + static gU32 jmpmask1; + static gU32 jmpmask2; + static gMemSize stackbase; static saveloc *pframeinfo; // These two functions are not static to prevent the compiler removing them as functions @@ -293,10 +293,10 @@ static thread mainthread; // The main thread context pframeinfo--; } static void _gfxThreadsInit(void) { - uint32_t i; + gU32 i; char ** pout; char ** pin; - size_t diff; + gPtrDiff diff; char * framebase; saveloc tmpsaveloc[2]; @@ -320,7 +320,7 @@ static thread mainthread; // The main thread context framebase = pframeinfo[0].localptr; jmpmask1 = jmpmask2 = 0; for (i = 0; i < sizeof(jmp_buf)/sizeof(char *); i++, pout++, pin++) { - if ((size_t)(*pout - *pin) == diff) { + if ((gPtrDiff)(*pout - *pin) == diff) { if (i < 32) jmpmask1 |= 1 << i; else @@ -345,7 +345,7 @@ static thread mainthread; // The main thread context char ** s; char * nf; int diff; - uint32_t i; + gU32 i; // Copy the stack frame s = 0; @@ -508,7 +508,7 @@ void gfxThreadExit(gThreadreturn ret) { // We never get back here as we didn't re-queue ourselves } -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { thread * t; thread * me; (void) prio; diff --git a/src/gos/gos_x_threads.h b/src/gos/gos_x_threads.h index 5b1b7260..175c1b94 100644 --- a/src/gos/gos_x_threads.h +++ b/src/gos/gos_x_threads.h @@ -24,14 +24,14 @@ #if GOS_NEED_X_THREADS -typedef uint32_t gDelay; -typedef uint32_t gTicks; +typedef gU32 gDelay; +typedef gU32 gTicks; typedef short gSemcount; typedef int gThreadreturn; typedef int gThreadpriority; #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) -#define DECLARE_THREAD_STACK(name, sz) uint8_t name[(sz) & ~3]; +#define DECLARE_THREAD_STACK(name, sz) gU8 name[(sz) & ~3]; #define THREAD_RETURN(retval) return retval #define gDelayNone 0 @@ -46,7 +46,7 @@ typedef struct { gSemcount limit; } gfxSem; -typedef uint32_t gfxMutex; +typedef gU32 gfxMutex; typedef void * gThread; // Required timing functions - supplied by the user or the operating system @@ -77,7 +77,7 @@ void gfxSemSignal(gfxSem *psem); void gfxSemSignalI(gfxSem *psem); // Threads -gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); +gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); #define gfxThreadClose(thread) gThreadreturn gfxThreadWait(gThread thread); gThread gfxThreadMe(void); diff --git a/src/gqueue/gqueue.c b/src/gqueue/gqueue.c index 04aeb6dd..8bd1312f 100644 --- a/src/gqueue/gqueue.c +++ b/src/gqueue/gqueue.c @@ -430,7 +430,7 @@ void _gqueueDeinit(void) #endif #if GQUEUE_NEED_BUFFERS - gBool gfxBufferAlloc(unsigned num, size_t size) { + gBool gfxBufferAlloc(unsigned num, gMemSize size) { GDataBuffer *pd; if (num < 1) diff --git a/src/gqueue/gqueue.h b/src/gqueue/gqueue.h index 179f0822..a62f8775 100644 --- a/src/gqueue/gqueue.h +++ b/src/gqueue/gqueue.h @@ -77,8 +77,8 @@ typedef struct gfxQueueFSync { */ typedef struct GDataBuffer { gfxQueueGSyncItem next; // @< Used for queueing the buffers - size_t size; // @< The size of the buffer area following this structure (in bytes) - size_t len; // @< The length of the data in the buffer area (in bytes) + gMemSize size; // @< The size of the buffer area following this structure (in bytes) + gMemSize len; // @< The length of the data in the buffer area (in bytes) } GDataBuffer; /*===========================================================================*/ @@ -352,7 +352,7 @@ gBool gfxQueueFSyncIsInI(gfxQueueFSync *pqueue, const gfxQueueFSyncItem *pitem); * @api * @{ */ -gBool gfxBufferAlloc(unsigned num, size_t size); +gBool gfxBufferAlloc(unsigned num, gMemSize size); /** @} */ /** diff --git a/src/gtimer/gtimer.h b/src/gtimer/gtimer.h index a2b65cbc..e70d9443 100644 --- a/src/gtimer/gtimer.h +++ b/src/gtimer/gtimer.h @@ -54,7 +54,7 @@ typedef struct GTimer_t { void *param; gTicks when; gTicks period; - uint16_t flags; + gU16 flags; struct GTimer_t *next; struct GTimer_t *prev; } GTimer; diff --git a/src/gtrans/gtrans.c b/src/gtrans/gtrans.c index c2d41246..15630b20 100644 --- a/src/gtrans/gtrans.c +++ b/src/gtrans/gtrans.c @@ -26,7 +26,7 @@ void _gtransDeinit(void) const char* gtransString(const char* string) { // Find the index of the specified string in the base language table - size_t i = 0; + unsigned i = 0; while (1) { // Prevent overflow if (i >= _languageBase->numEntries) { diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 0e309ba1..b254fb96 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -84,7 +84,7 @@ void _gwinDeinit(void) // Internal routine for use by GWIN components only // Initialise a window creating it dynamically if required. -GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint32_t flags) { +GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, gU32 flags) { // Allocate the structure if necessary if (!pgw) { if (!(pgw = gfxAlloc(vmt->size))) @@ -324,13 +324,13 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s #endif #if GDISP_NEED_ARCSECTORS - void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) { + void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors) { if (!_gwinDrawStart(gh)) return; gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color); _gwinDrawEnd(gh); } - void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) { + void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors) { if (!_gwinDrawStart(gh)) return; gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color); _gwinDrawEnd(gh); diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h index ed48de11..b55cb381 100644 --- a/src/gwin/gwin.h +++ b/src/gwin/gwin.h @@ -50,7 +50,7 @@ typedef struct GWindowObject { gCoord height; /**< The height of this window */ gColor color; /**< The current foreground drawing color */ gColor bgcolor; /**< The current background drawing color */ - uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */ + gU32 flags; /**< Window flags (the meaning is private to the GWIN class) */ #if GDISP_NEED_TEXT gFont font; /**< The current font */ #endif @@ -830,7 +830,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s * * @api */ - void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors); + void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors); /* * @brief Draw a filled selection of 45 degree arcs of a circle in the window. @@ -853,7 +853,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s * * @api */ - void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors); + void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors); #endif /*------------------------------------------------- diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c index 2b65856f..7d588e80 100644 --- a/src/gwin/gwin_button.c +++ b/src/gwin/gwin_button.c @@ -67,14 +67,14 @@ #if GINPUT_NEED_TOGGLE // A toggle off has occurred - static void ButtonToggleOff(GWidgetObject *gw, uint16_t role) { + static void ButtonToggleOff(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags &= ~GBUTTON_FLG_PRESSED; _gwinUpdate((GHandle)gw); } // A toggle on has occurred - static void ButtonToggleOn(GWidgetObject *gw, uint16_t role) { + static void ButtonToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags |= GBUTTON_FLG_PRESSED; _gwinUpdate((GHandle)gw); @@ -82,12 +82,12 @@ _gwinSendEvent(&gw->g, GEVENT_GWIN_BUTTON); } - static void ButtonToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void ButtonToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GButtonObject *)gw)->toggle = instance; } - static uint16_t ButtonToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 ButtonToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GButtonObject *)gw)->toggle; } diff --git a/src/gwin/gwin_button.h b/src/gwin/gwin_button.h index 4a80cdf7..ff6e0a22 100644 --- a/src/gwin/gwin_button.h +++ b/src/gwin/gwin_button.h @@ -54,7 +54,7 @@ typedef GEventGWin GEventGWinButton; typedef struct GButtonObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif } GButtonObject; diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index 3be66e6b..7d09bddf 100644 --- a/src/gwin/gwin_checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -69,19 +69,19 @@ static void SendCheckboxEvent(GWidgetObject *gw) { #endif #if GINPUT_NEED_TOGGLE - static void CheckboxToggleOn(GWidgetObject *gw, uint16_t role) { + static void CheckboxToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags ^= GCHECKBOX_FLG_CHECKED; _gwinUpdate((GHandle)gw); SendCheckboxEvent(gw); } - static void CheckboxToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void CheckboxToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GCheckboxObject *)gw)->toggle = instance; } - static uint16_t CheckboxToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 CheckboxToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GCheckboxObject *)gw)->toggle; } diff --git a/src/gwin/gwin_checkbox.h b/src/gwin/gwin_checkbox.h index e67ff3ab..2b7ef9e9 100644 --- a/src/gwin/gwin_checkbox.h +++ b/src/gwin/gwin_checkbox.h @@ -57,7 +57,7 @@ typedef struct GEventGWinCheckbox { typedef struct GCheckboxObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif } GCheckboxObject; diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h index 6d66e3d7..05a4bbf4 100644 --- a/src/gwin/gwin_class.h +++ b/src/gwin/gwin_class.h @@ -54,7 +54,7 @@ */ typedef struct gwinVMT { const char * classname; /**< The GWIN classname (mandatory) */ - size_t size; /**< The size of the class object */ + gMemSize size; /**< The size of the class object */ void (*Destroy) (GWindowObject *gh); /**< The GWIN destroy function (optional) */ void (*Redraw) (GWindowObject *gh); /**< The GWIN redraw routine (optional) */ void (*AfterClear) (GWindowObject *gh); /**< The GWIN after-clear function (optional) */ @@ -66,7 +66,7 @@ typedef struct gwinVMT { /** * @brief An toggle/dial instance is not being used */ - #define GWIDGET_NO_INSTANCE ((uint16_t)-1) + #define GWIDGET_NO_INSTANCE ((gU16)-1) /** * @brief The source handle that widgets use when sending events @@ -99,19 +99,19 @@ typedef struct gwinVMT { #endif #if GINPUT_NEED_TOGGLE struct { - uint16_t toggleroles; /**< The roles supported for toggles (0->toggleroles-1) */ - void (*ToggleAssign) (GWidgetObject *gw, uint16_t role, uint16_t instance); /**< Assign a toggle to a role (optional) */ - uint16_t (*ToggleGet) (GWidgetObject *gw, uint16_t role); /**< Return the instance for a particular role (optional) */ - void (*ToggleOff) (GWidgetObject *gw, uint16_t role); /**< Process toggle off events (optional) */ - void (*ToggleOn) (GWidgetObject *gw, uint16_t role); /**< Process toggle on events (optional) */ + gU16 toggleroles; /**< The roles supported for toggles (0->toggleroles-1) */ + void (*ToggleAssign) (GWidgetObject *gw, gU16 role, gU16 instance); /**< Assign a toggle to a role (optional) */ + gU16 (*ToggleGet) (GWidgetObject *gw, gU16 role); /**< Return the instance for a particular role (optional) */ + void (*ToggleOff) (GWidgetObject *gw, gU16 role); /**< Process toggle off events (optional) */ + void (*ToggleOn) (GWidgetObject *gw, gU16 role); /**< Process toggle on events (optional) */ }; #endif #if GINPUT_NEED_DIAL struct { - uint16_t dialroles; /**< The roles supported for dials (0->dialroles-1) */ - void (*DialAssign) (GWidgetObject *gw, uint16_t role, uint16_t instance); /**< Test the role and save the dial instance handle (optional) */ - uint16_t (*DialGet) (GWidgetObject *gw, uint16_t role); /**< Return the instance for a particular role (optional) */ - void (*DialMove) (GWidgetObject *gw, uint16_t role, uint16_t value, uint16_t max); /**< Process dial move events (optional) */ + gU16 dialroles; /**< The roles supported for dials (0->dialroles-1) */ + void (*DialAssign) (GWidgetObject *gw, gU16 role, gU16 instance); /**< Test the role and save the dial instance handle (optional) */ + gU16 (*DialGet) (GWidgetObject *gw, gU16 role); /**< Return the instance for a particular role (optional) */ + void (*DialMove) (GWidgetObject *gw, gU16 role, gU16 value, gU16 max); /**< Process dial move events (optional) */ }; #endif } gwidgetVMT; @@ -185,7 +185,7 @@ typedef struct gwinVMT { * * @notapi */ -GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint32_t flags); +GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, gU32 flags); /** * @brief Redraw the window after a status change. diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c index cf331e59..67593557 100644 --- a/src/gwin/gwin_console.c +++ b/src/gwin/gwin_console.c @@ -42,23 +42,23 @@ #define Stream2GWindow(ip) ((GHandle)(((char *)(ip)) - (size_t)(&(((GConsoleObject *)0)->stream)))) #if CH_KERNEL_MAJOR == 2 - static size_t GWinStreamWrite(void *ip, const uint8_t *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } - static size_t GWinStreamRead(void *ip, uint8_t *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } - static msg_t GWinStreamPut(void *ip, uint8_t b) { gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } + static size_t GWinStreamWrite(void *ip, const gU8 *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } + static size_t GWinStreamRead(void *ip, gU8 *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } + static msg_t GWinStreamPut(void *ip, gU8 b) { gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } static msg_t GWinStreamGet(void *ip) {(void)ip; return RDY_OK; } - static msg_t GWinStreamPutTimed(void *ip, uint8_t b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } + static msg_t GWinStreamPutTimed(void *ip, gU8 b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } static msg_t GWinStreamGetTimed(void *ip, systime_t timeout) { (void)ip; (void)timeout; return RDY_OK; } - static size_t GWinStreamWriteTimed(void *ip, const uint8_t *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } - static size_t GWinStreamReadTimed(void *ip, uint8_t *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } + static size_t GWinStreamWriteTimed(void *ip, const gU8 *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } + static size_t GWinStreamReadTimed(void *ip, gU8 *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } #elif CH_KERNEL_MAJOR == 3 - static size_t GWinStreamWrite(void *ip, const uint8_t *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } - static size_t GWinStreamRead(void *ip, uint8_t *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } - static msg_t GWinStreamPut(void *ip, uint8_t b) { gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } + static size_t GWinStreamWrite(void *ip, const gU8 *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } + static size_t GWinStreamRead(void *ip, gU8 *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } + static msg_t GWinStreamPut(void *ip, gU8 b) { gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } static msg_t GWinStreamGet(void *ip) {(void)ip; return MSG_OK; } - static msg_t GWinStreamPutTimed(void *ip, uint8_t b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } + static msg_t GWinStreamPutTimed(void *ip, gU8 b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } static msg_t GWinStreamGetTimed(void *ip, systime_t timeout) { (void)ip; (void)timeout; return MSG_OK; } - static size_t GWinStreamWriteTimed(void *ip, const uint8_t *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } - static size_t GWinStreamReadTimed(void *ip, uint8_t *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } + static size_t GWinStreamWriteTimed(void *ip, const gU8 *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } + static size_t GWinStreamReadTimed(void *ip, gU8 *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } #endif struct GConsoleWindowVMT_t { @@ -79,8 +79,8 @@ #if GWIN_CONSOLE_ESCSEQ // Convert escape sequences to attributes - static gBool ESCtoAttr(char c, uint8_t *pattr) { - uint8_t attr; + static gBool ESCtoAttr(char c, gU8 *pattr) { + gU8 attr; attr = pattr[0]; switch(c) { @@ -157,7 +157,7 @@ */ static void scrollBuffer(GConsoleObject *gcw) { char *p, *ep; - size_t dp; + gPtrDiff dp; // Only scroll if we need to if (!gcw->buffer || (gcw->g.flags & GCONSOLE_FLG_NOSTORE)) @@ -256,7 +256,7 @@ // Do we have enough space in the buffer if (gcw->bufpos >= gcw->bufsize) { char *p, *ep; - size_t dp; + gPtrDiff dp; /** * This should never really happen except if the user has changed the window @@ -433,7 +433,7 @@ GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *p void gwinPutChar(GHandle gh, char c) { #define gcw ((GConsoleObject *)gh) - uint8_t width, fy; + gU8 width, fy; if (gh->vmt != &consoleVMT || !gh->font) return; @@ -625,7 +625,7 @@ void gwinPutString(GHandle gh, const char *str) { gwinPutChar(gh, *str++); } -void gwinPutCharArray(GHandle gh, const char *str, size_t n) { +void gwinPutCharArray(GHandle gh, const char *str, gMemSize n) { while(n--) gwinPutChar(gh, *str++); } diff --git a/src/gwin/gwin_console.h b/src/gwin/gwin_console.h index fdf77e67..437968e0 100644 --- a/src/gwin/gwin_console.h +++ b/src/gwin/gwin_console.h @@ -34,15 +34,15 @@ typedef struct GConsoleObject { gCoord cx, cy; // Cursor position #if GWIN_CONSOLE_ESCSEQ - uint8_t startattr; // ANSI-like escape sequences - uint8_t currattr; - uint16_t escstate; + gU8 startattr; // ANSI-like escape sequences + gU8 currattr; + gU16 escstate; #endif #if GWIN_CONSOLE_USE_HISTORY char * buffer; // buffer to store console content - size_t bufsize; // size of buffer - size_t bufpos; // the position of the next char + gMemSize bufsize; // size of buffer + gMemSize bufpos; // the position of the next char #endif #if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM @@ -141,7 +141,7 @@ void gwinPutString(GHandle gh, const char *str); * * @api */ -void gwinPutCharArray(GHandle gh, const char *str, size_t n); +void gwinPutCharArray(GHandle gh, const char *str, gMemSize n); /** * @brief Print a formatted string at the cursor position in the window. It will wrap lines as required. diff --git a/src/gwin/gwin_container.c b/src/gwin/gwin_container.c index 7757ed5b..7f5f60bc 100644 --- a/src/gwin/gwin_container.c +++ b/src/gwin/gwin_container.c @@ -134,7 +134,7 @@ static const gcontainerVMT containerVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gc, const GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gc, const GWidgetInit *pInit, gU32 flags) { if (!(gc = (GContainerObject *)_gcontainerCreate(g, gc, pInit, &containerVMT))) return 0; diff --git a/src/gwin/gwin_container.h b/src/gwin/gwin_container.h index 2ac7f605..3460e3b7 100644 --- a/src/gwin/gwin_container.h +++ b/src/gwin/gwin_container.h @@ -113,7 +113,7 @@ gCoord gwinGetInnerHeight(GHandle gh); * * @api */ -GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gw, const GWidgetInit *pInit, uint32_t flags); +GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gw, const GWidgetInit *pInit, gU32 flags); #define gwinContainerCreate(gc, pInit, flags) gwinGContainerCreate(GDISP, gc, pInit, flags) diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c index 13998bda..402da514 100644 --- a/src/gwin/gwin_frame.c +++ b/src/gwin/gwin_frame.c @@ -208,7 +208,7 @@ static const gcontainerVMT frameVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, gU32 flags) { if (!(fo = (GFrameObject *)_gcontainerCreate(g, (GContainerObject *)fo, pInit, &frameVMT))) return 0; diff --git a/src/gwin/gwin_frame.h b/src/gwin/gwin_frame.h index 89efa4c6..df26008d 100644 --- a/src/gwin/gwin_frame.h +++ b/src/gwin/gwin_frame.h @@ -68,7 +68,7 @@ typedef GContainerObject GFrameObject; * * @api */ -GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint32_t flags); +GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, gU32 flags); #define gwinFrameCreate(fo, pInit, flags) gwinGFrameCreate(GDISP, fo, pInit, flags); /** diff --git a/src/gwin/gwin_graph.h b/src/gwin/gwin_graph.h index 71bee1b0..20def920 100644 --- a/src/gwin/gwin_graph.h +++ b/src/gwin/gwin_graph.h @@ -61,7 +61,7 @@ typedef struct GGraphStyle_t { GGraphLineStyle yaxis; GGraphGridStyle xgrid; GGraphGridStyle ygrid; - uint16_t flags; + gU16 flags; #define GWIN_GRAPH_STYLE_XAXIS_POSITIVE_ARROWS 0x0001 #define GWIN_GRAPH_STYLE_XAXIS_NEGATIVE_ARROWS 0x0002 #define GWIN_GRAPH_STYLE_YAXIS_POSITIVE_ARROWS 0x0004 diff --git a/src/gwin/gwin_keyboard.c b/src/gwin/gwin_keyboard.c index 88d97583..70257f36 100644 --- a/src/gwin/gwin_keyboard.c +++ b/src/gwin/gwin_keyboard.c @@ -17,12 +17,12 @@ #include "gwin_class.h" #include "gwin_keyboard_layout.h" -typedef uint8_t utf8; -typedef uint16_t utf16; -typedef uint32_t utf32; +typedef gU8 utf8; +typedef gU16 utf16; +typedef gU32 utf32; // A character code - note this is not UTF-32 but a representation of the UTF-8 code stream for a single character. -typedef uint32_t ucode; +typedef gU32 ucode; static GSourceHandle AllKeyboards; @@ -393,7 +393,7 @@ void gwinKeyboardDraw_Normal(GWidgetObject *gw, void *param) { const char *pcap; const utf8 *krow; gCoord x, y, cx, cy; - uint8_t rows, cols, row, col, kcols; + gU8 rows, cols, row, col, kcols; ucode key; fixed fx, fy; const GColorSet *pcol; diff --git a/src/gwin/gwin_keyboard.h b/src/gwin/gwin_keyboard.h index aec159ea..653ed218 100644 --- a/src/gwin/gwin_keyboard.h +++ b/src/gwin/gwin_keyboard.h @@ -59,9 +59,9 @@ typedef struct GKeyboardObject { const char **keyset; gCoord keyx, keyy; gCoord keycx, keycy; - uint8_t lastkeyrow, lastkeycol; - uint8_t keyrow, keycol; - uint32_t key; + gU8 lastkeyrow, lastkeycol; + gU8 keyrow, keycol; + gU32 key; } GKeyboardObject; /** diff --git a/src/gwin/gwin_keyboard_layout.h b/src/gwin/gwin_keyboard_layout.h index 9a2db343..b35bd139 100644 --- a/src/gwin/gwin_keyboard_layout.h +++ b/src/gwin/gwin_keyboard_layout.h @@ -52,11 +52,11 @@ typedef struct GVSpecialKey { const char const *keycap; // The caption on the key const char const *sendkey; // The key to send (NULL means none) - uint8_t flags; // Flags + gU8 flags; // Flags #define GVKEY_INVERT 0x01 // Invert the color #define GVKEY_SINGLESET 0x02 // Change set when this key is pressed but only for a single keystroke #define GVKEY_LOCKSET 0x04 // Change set when this key is pressed but stay there until the set is changed by the user - uint8_t newset; // The new set to change to + gU8 newset; // The new set to change to } GVSpecialKey; typedef const char **GVKeySet; // Array of Rows - Null indicates the end diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c index 76e4da3a..82b5c106 100644 --- a/src/gwin/gwin_list.c +++ b/src/gwin/gwin_list.c @@ -179,7 +179,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { #if GINPUT_NEED_TOGGLE // a toggle-on has occurred - static void ListToggleOn(GWidgetObject *gw, uint16_t role) { + static void ListToggleOn(GWidgetObject *gw, gU16 role) { const gfxQueueASyncItem * qi; const gfxQueueASyncItem * qix; int i; @@ -236,14 +236,14 @@ static void sendListEvent(GWidgetObject *gw, int item) { } } - static void ListToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void ListToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { if (role) gw2obj->t_up = instance; else gw2obj->t_dn = instance; } - static uint16_t ListToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 ListToggleGet(GWidgetObject *gw, gU16 role) { return role ? gw2obj->t_up : gw2obj->t_dn; } #endif @@ -356,7 +356,7 @@ int gwinListAddItem(GHandle gh, const char* text, gBool useAlloc) { return -1; if (useAlloc) { - size_t len = strlen(text)+1; + gMemSize len = strlen(text)+1; if (!(newItem = gfxAlloc(sizeof(ListItem) + len))) return -1; @@ -409,7 +409,7 @@ void gwinListItemSetText(GHandle gh, int item, const char* text, gBool useAlloc) // create the new object if (useAlloc) { - size_t len = strlen(text)+1; + gMemSize len = strlen(text)+1; if (!(newItem = gfxAlloc(sizeof(ListItem) + len))) return; @@ -498,7 +498,7 @@ int gwinListGetSelected(GHandle gh) { return -1; } -void gwinListItemSetParam(GHandle gh, int item, uint16_t param) { +void gwinListItemSetParam(GHandle gh, int item, gU16 param) { const gfxQueueASyncItem * qi; int i; @@ -559,7 +559,7 @@ void gwinListItemDelete(GHandle gh, int item) { } } -uint16_t gwinListItemGetParam(GHandle gh, int item) { +gU16 gwinListItemGetParam(GHandle gh, int item) { const gfxQueueASyncItem * qi; int i; diff --git a/src/gwin/gwin_list.h b/src/gwin/gwin_list.h index 34c5e249..a8f915fe 100644 --- a/src/gwin/gwin_list.h +++ b/src/gwin/gwin_list.h @@ -57,8 +57,8 @@ typedef struct GListObject { gCoord last_mouse_y; #endif #if GINPUT_NEED_TOGGLE - uint16_t t_up; - uint16_t t_dn; + gU16 t_up; + gU16 t_dn; #endif int cnt; // Number of items currently in the list (quicker than counting each time) @@ -95,9 +95,9 @@ typedef enum scroll_t { scrollAlways, scrollAuto, scrollSmooth } scroll_t; typedef struct ListItem { gfxQueueASyncItem q_item; // This must be the first member in the struct - uint16_t flags; + gU16 flags; #define GLIST_FLG_SELECTED 0x0001 - uint16_t param; // A parameter the user can specify himself + gU16 param; // A parameter the user can specify himself const char* text; #if GWIN_NEED_LIST_IMAGES gdispImage* pimg; @@ -218,7 +218,7 @@ int gwinListFindText(GHandle gh, const char* text); * * @api */ -void gwinListItemSetParam(GHandle gh, int item, uint16_t param); +void gwinListItemSetParam(GHandle gh, int item, gU16 param); /** * @brief Get the custom parameter of an item with a given ID @@ -230,7 +230,7 @@ void gwinListItemSetParam(GHandle gh, int item, uint16_t param); * * @api */ -uint16_t gwinListItemGetParam(GHandle gh, int item); +gU16 gwinListItemGetParam(GHandle gh, int item); /** * @brief Delete all the items of the list diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c index c1450611..c3d1564a 100644 --- a/src/gwin/gwin_radio.c +++ b/src/gwin/gwin_radio.c @@ -69,18 +69,18 @@ static void SendRadioEvent(GWidgetObject *gw) { #if GINPUT_NEED_TOGGLE // A toggle on has occurred - static void RadioToggleOn(GWidgetObject *gw, uint16_t role) { + static void RadioToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gwinRadioPress((GHandle)gw); } - static void RadioToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void RadioToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GRadioObject *)gw)->toggle = instance; } - static uint16_t RadioToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 RadioToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GRadioObject *)gw)->toggle; } @@ -127,7 +127,7 @@ static const gwidgetVMT radioVMT = { #endif }; -GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gw, const GWidgetInit *pInit, uint16_t group) { +GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gw, const GWidgetInit *pInit, gU16 group) { if (!(gw = (GRadioObject *)_gwidgetCreate(g, &gw->w, pInit, &radioVMT))) return 0; @@ -161,7 +161,7 @@ gBool gwinRadioIsPressed(GHandle gh) { return (gh->flags & GRADIO_FLG_PRESSED) ? gTrue : gFalse; } -GHandle gwinRadioGetActive(uint16_t group) { +GHandle gwinRadioGetActive(gU16 group) { GHandle gh; for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { diff --git a/src/gwin/gwin_radio.h b/src/gwin/gwin_radio.h index a3cb194d..05d2742f 100644 --- a/src/gwin/gwin_radio.h +++ b/src/gwin/gwin_radio.h @@ -42,7 +42,7 @@ typedef struct GEventGWinRadio { #if GWIN_WIDGET_TAGS WidgetTag tag; // The radio tag #endif - uint16_t group; // The group for this radio button + gU16 group; // The group for this radio button } GEventGWinRadio; /** @@ -60,9 +60,9 @@ typedef struct GEventGWinRadio { typedef struct GRadioObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif - uint16_t group; + gU16 group; } GRadioObject; /** @@ -88,7 +88,7 @@ typedef struct GRadioObject { * * @api */ -GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, uint16_t group); +GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, gU16 group); #define gwinRadioCreate(w, pInit, gr) gwinGRadioCreate(GDISP, w, pInit, gr) /** @@ -120,7 +120,7 @@ gBool gwinRadioIsPressed(GHandle gh); * * @api */ -GHandle gwinRadioGetActive(uint16_t group); +GHandle gwinRadioGetActive(gU16 group); /** * @defgroup Renderings_Radiobutton Renderings diff --git a/src/gwin/gwin_slider.c b/src/gwin/gwin_slider.c index a87ef9ed..22373027 100644 --- a/src/gwin/gwin_slider.c +++ b/src/gwin/gwin_slider.c @@ -42,7 +42,7 @@ static int SliderCalcPosFromDPos(GSliderObject *gsw) { } // Send the slider event -static void SendSliderEvent(GSliderObject *gsw, uint8_t action) { +static void SendSliderEvent(GSliderObject *gsw, gU8 action) { GSourceListener * psl; GEvent * pe; #define pse ((GEventGWinSlider *)pe) @@ -178,7 +178,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #if GINPUT_NEED_TOGGLE // A toggle on has occurred - static void SliderToggleOn(GWidgetObject *gw, uint16_t role) { + static void SliderToggleOn(GWidgetObject *gw, gU16 role) { #define gsw ((GSliderObject *)gw) if (role) { @@ -191,26 +191,26 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #undef gsw } - static void SliderToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void SliderToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { if (role) ((GSliderObject *)gw)->t_up = instance; else ((GSliderObject *)gw)->t_dn = instance; } - static uint16_t SliderToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 SliderToggleGet(GWidgetObject *gw, gU16 role) { return role ? ((GSliderObject *)gw)->t_up : ((GSliderObject *)gw)->t_dn; } #endif #if GINPUT_NEED_DIAL // A dial move event - static void SliderDialMove(GWidgetObject *gw, uint16_t role, uint16_t value, uint16_t max) { + static void SliderDialMove(GWidgetObject *gw, gU16 role, gU16 value, gU16 max) { #define gsw ((GSliderObject *)gw) (void) role; // Set the new position - gsw->pos = (uint16_t)((uint32_t)value*(gsw->max-gsw->min)/max + gsw->min); + gsw->pos = (gU16)((gU32)value*(gsw->max-gsw->min)/max + gsw->min); SliderResetDisplayPos(gsw); _gwinUpdate(&gsw->w.g); @@ -220,12 +220,12 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #undef gsw } - static void SliderDialAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void SliderDialAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GSliderObject *)gw)->dial = instance; } - static uint16_t SliderDialGet(GWidgetObject *gw, uint16_t role) { + static gU16 SliderDialGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GSliderObject *)gw)->dial; } diff --git a/src/gwin/gwin_slider.h b/src/gwin/gwin_slider.h index 0b11385b..4eb9ed41 100644 --- a/src/gwin/gwin_slider.h +++ b/src/gwin/gwin_slider.h @@ -36,7 +36,7 @@ typedef struct GEventGWinSlider { #endif int position; - uint8_t action; + gU8 action; #define GSLIDER_EVENT_SET 4 /* Slider position is set. This is the only event returned by default */ #define GSLIDER_EVENT_CANCEL 3 /* Slider position changing has been cancelled */ #define GSLIDER_EVENT_START 2 /* Slider position has started changing */ @@ -57,11 +57,11 @@ typedef struct GEventGWinSlider { typedef struct GSliderObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t t_dn; - uint16_t t_up; + gU16 t_dn; + gU16 t_up; #endif #if GINPUT_NEED_DIAL - uint16_t dial; + gU16 dial; #endif gCoord dpos; int min; diff --git a/src/gwin/gwin_tabset.c b/src/gwin/gwin_tabset.c index abfd9823..80a5f10d 100644 --- a/src/gwin/gwin_tabset.c +++ b/src/gwin/gwin_tabset.c @@ -288,7 +288,7 @@ static const gcontainerVMT tabsetVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, gU32 flags) { if (!(fo = (GTabsetObject *)_gcontainerCreate(g, (GContainerObject *)fo, pInit, &tabsetVMT))) return 0; diff --git a/src/gwin/gwin_tabset.h b/src/gwin/gwin_tabset.h index d01f9d9a..f2bde48b 100644 --- a/src/gwin/gwin_tabset.h +++ b/src/gwin/gwin_tabset.h @@ -76,7 +76,7 @@ typedef struct GTabsetObject { * * @api */ -GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, uint32_t flags); +GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, gU32 flags); #define gwinTabsetCreate(fo, pInit, flags) gwinGTabsetCreate(GDISP, fo, pInit, flags); /** diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c index 853da0b7..3a2626d0 100644 --- a/src/gwin/gwin_textedit.c +++ b/src/gwin/gwin_textedit.c @@ -88,7 +88,7 @@ static gBool TextEditAddChars(GHandle gh, unsigned cnt) { // and do the comparation directly inside of that loop so we only iterate // the string once. static void TextEditMouseDown(GWidgetObject* gw, gCoord x, gCoord y) { - uint16_t i = 0; + gU16 i = 0; (void)y; @@ -118,7 +118,7 @@ static void TextEditMouseDown(GWidgetObject* gw, gCoord x, gCoord y) { // Is it a special key? if (pke->keystate & GKEYSTATE_SPECIAL) { // Arrow keys to move the cursor - gwinTextEditSendSpecialKey(&gw->g, (uint8_t)pke->c[0]); + gwinTextEditSendSpecialKey(&gw->g, (gU8)pke->c[0]); return; } @@ -167,7 +167,7 @@ static const gwidgetVMT texteditVMT = { #endif }; -GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, size_t maxSize) +GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, gMemSize maxSize) { // Create the underlying widget if (!(wt = (GTexteditObject*)_gwidgetCreate(g, &wt->w, pInit, &texteditVMT))) @@ -184,7 +184,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit } #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD - void gwinTextEditSendSpecialKey(GHandle gh, uint8_t key) { + void gwinTextEditSendSpecialKey(GHandle gh, gU8 key) { // Is it a valid handle? if (gh->vmt != (gwinVMT*)&texteditVMT) return; @@ -224,7 +224,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit return; // Normal key press - switch((uint8_t)key[0]) { + switch((gU8)key[0]) { case GKEY_BACKSPACE: // Backspace if (!gh2obj->cursorPos) @@ -246,7 +246,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit break; default: // Ignore any other control characters - if ((uint8_t)key[0] < GKEY_SPACE) + if ((gU8)key[0] < GKEY_SPACE) return; // Keep the edit length to less than the maximum diff --git a/src/gwin/gwin_textedit.h b/src/gwin/gwin_textedit.h index 496b6408..c32f98e0 100644 --- a/src/gwin/gwin_textedit.h +++ b/src/gwin/gwin_textedit.h @@ -36,8 +36,8 @@ typedef struct GTexteditObject { GWidgetObject w; char* textBuffer; - size_t maxSize; - uint16_t cursorPos; + gMemSize maxSize; + gU16 cursorPos; } GTexteditObject; /** @@ -56,7 +56,7 @@ typedef struct GTexteditObject { * @note If the initial text set is larger than maxSize then the text is truncated at maxSize characters. * @api */ -GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, size_t maxSize); +GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, gMemSize maxSize); #define gwinTexteditCreate(wt, pInit, maxSize) gwinGTexteditCreate(GDISP, wt, pInit, maxSize) /** @@ -67,7 +67,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit * @pre Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on * @api */ -void gwinTextEditSendSpecialKey(GHandle gh, uint8_t key); +void gwinTextEditSendSpecialKey(GHandle gh, gU8 key); /** * @brief Send a normal utf8 character to the textedit diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index 8da2ebdd..94b9dd33 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -107,7 +107,7 @@ static void gwidgetEvent(void *param, GEvent *pe) { GHandle gh; #endif #if GINPUT_NEED_TOGGLE || GINPUT_NEED_DIAL - uint16_t role; + gU16 role; #endif #endif @@ -346,9 +346,9 @@ static void gwidgetEvent(void *param, GEvent *pe) { #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE - static GHandle FindToggleUser(uint16_t instance) { + static GHandle FindToggleUser(gU16 instance) { GHandle gh; - uint16_t role; + gU16 role; for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { if (!(gh->flags & GWIN_FLG_WIDGET)) // check if it a widget @@ -364,9 +364,9 @@ static void gwidgetEvent(void *param, GEvent *pe) { #endif #if GFX_USE_GINPUT && GINPUT_NEED_DIAL - static GHandle FindDialUser(uint16_t instance) { + static GHandle FindDialUser(gU16 instance) { GHandle gh; - uint16_t role; + gU16 role; for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { if (!(gh->flags & GWIN_FLG_WIDGET)) // check if it a widget @@ -420,7 +420,7 @@ GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit void _gwidgetDestroy(GHandle gh) { #if GFX_USE_GINPUT && (GINPUT_NEED_TOGGLE || GINPUT_NEED_DIAL) - uint16_t role, instance; + gU16 role, instance; #endif // Make the window is invisible so it is not eligible for focus @@ -635,7 +635,7 @@ gBool gwinAttachListener(GListener *pl) { } #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE - gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(uint16_t instance) { + gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(gU16 instance) { // This is now a NULL event because we automatically attach to all mice in the system. (void) instance; return gTrue; @@ -643,9 +643,9 @@ gBool gwinAttachListener(GListener *pl) { #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE - gBool gwinAttachToggle(GHandle gh, uint16_t role, uint16_t instance) { + gBool gwinAttachToggle(GHandle gh, gU16 role, gU16 instance) { GSourceHandle gsh; - uint16_t oi; + gU16 oi; // Is this a widget if (!(gh->flags & GWIN_FLG_WIDGET)) @@ -676,8 +676,8 @@ gBool gwinAttachListener(GListener *pl) { return geventAttachSource(&gl, gsh, GLISTEN_TOGGLE_ON|GLISTEN_TOGGLE_OFF); } - gBool gwinDetachToggle(GHandle gh, uint16_t role) { - uint16_t oi; + gBool gwinDetachToggle(GHandle gh, gU16 role) { + gU16 oi; // Is this a widget if (!(gh->flags & GWIN_FLG_WIDGET)) @@ -701,9 +701,9 @@ gBool gwinAttachListener(GListener *pl) { #endif #if GFX_USE_GINPUT && GINPUT_NEED_DIAL - gBool gwinAttachDial(GHandle gh, uint16_t role, uint16_t instance) { + gBool gwinAttachDial(GHandle gh, gU16 role, gU16 instance) { GSourceHandle gsh; - uint16_t oi; + gU16 oi; if (!(gh->flags & GWIN_FLG_WIDGET)) return gFalse; diff --git a/src/gwin/gwin_widget.h b/src/gwin/gwin_widget.h index 88943cc3..bd23de08 100644 --- a/src/gwin/gwin_widget.h +++ b/src/gwin/gwin_widget.h @@ -78,7 +78,7 @@ typedef void (*CustomWidgetDrawFunction)(struct GWidgetObject *gw, void *param); /** * @brief Defines a the type of a tag on a widget */ -typedef uint16_t WidgetTag; +typedef gU16 WidgetTag; /** * @brief The structure to initialise a widget. @@ -333,7 +333,7 @@ void gwinSetCustomDraw(GHandle gh, CustomWidgetDrawFunction fn, void *param); gBool gwinAttachListener(GListener *pl); #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) || defined(__DOXYGEN__) - gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(uint16_t instance); + gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(gU16 instance); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) || defined(__DOXYGEN__) @@ -351,7 +351,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinAttachToggle(GHandle gh, uint16_t role, uint16_t instance); + gBool gwinAttachToggle(GHandle gh, gU16 role, gU16 instance); /** * @brief Detach a toggle from a widget * @return gTrue on success @@ -365,7 +365,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinDetachToggle(GHandle gh, uint16_t role); + gBool gwinDetachToggle(GHandle gh, gU16 role); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_DIAL) || defined(__DOXYGEN__) @@ -383,7 +383,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinAttachDial(GHandle gh, uint16_t role, uint16_t instance); + gBool gwinAttachDial(GHandle gh, gU16 role, gU16 instance); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index eea44cb9..458d1408 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -171,7 +171,7 @@ static gfxQueueASync _GWINList; static GTimer RedrawTimer; static void RedrawTimerFn(void *param); #endif -static volatile uint8_t RedrawPending; +static volatile gU8 RedrawPending; #define DOREDRAW_INVISIBLES 0x01 #define DOREDRAW_VISIBLES 0x02 #define DOREDRAW_FLASHRUNNING 0x04 @@ -748,7 +748,7 @@ static void WM_Delete(GHandle gh) { } static void WM_Redraw(GHandle gh) { - uint32_t flags; + gU32 flags; flags = gh->flags; gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); diff --git a/tools/mcufontencoder/src/export_bwfont.cc b/tools/mcufontencoder/src/export_bwfont.cc index 9b97fb9c..c367a20e 100644 --- a/tools/mcufontencoder/src/export_bwfont.cc +++ b/tools/mcufontencoder/src/export_bwfont.cc @@ -134,12 +134,12 @@ static void encode_character_range(std::ostream &out, } offsets.push_back(data.size() / stride); - write_const_table(out, data, "uint8_t", "mf_bwfont_" + name + "_glyph_data_" + std::to_string(range_index)); + write_const_table(out, data, "gU8", "mf_bwfont_" + name + "_glyph_data_" + std::to_string(range_index)); if (!constant_width) { - write_const_table(out, offsets, "uint16_t", "mf_bwfont_" + name + "_glyph_offsets_" + std::to_string(range_index), 4); - write_const_table(out, widths, "uint8_t", "mf_bwfont_" + name + "_glyph_widths_" + std::to_string(range_index)); + write_const_table(out, offsets, "gU16", "mf_bwfont_" + name + "_glyph_offsets_" + std::to_string(range_index), 4); + write_const_table(out, widths, "gU8", "mf_bwfont_" + name + "_glyph_widths_" + std::to_string(range_index)); } } diff --git a/tools/mcufontencoder/src/export_rlefont.cc b/tools/mcufontencoder/src/export_rlefont.cc index 4b7272d4..8c76325c 100644 --- a/tools/mcufontencoder/src/export_rlefont.cc +++ b/tools/mcufontencoder/src/export_rlefont.cc @@ -36,8 +36,8 @@ static void encode_dictionary(std::ostream &out, } offsets.push_back(data.size()); - write_const_table(out, data, "uint8_t", "mf_rlefont_" + name + "_dictionary_data"); - write_const_table(out, offsets, "uint16_t", "mf_rlefont_" + name + "_dictionary_offsets", 4); + write_const_table(out, data, "gU8", "mf_rlefont_" + name + "_dictionary_data"); + write_const_table(out, offsets, "gU16", "mf_rlefont_" + name + "_dictionary_offsets", 4); } // Encode the data tables for a single character range. @@ -78,8 +78,8 @@ static void encode_character_range(std::ostream &out, } } - write_const_table(out, data, "uint8_t", "mf_rlefont_" + name + "_glyph_data_" + std::to_string(range_index)); - write_const_table(out, offsets, "uint16_t", "mf_rlefont_" + name + "_glyph_offsets_" + std::to_string(range_index), 4); + write_const_table(out, data, "gU8", "mf_rlefont_" + name + "_glyph_data_" + std::to_string(range_index)); + write_const_table(out, offsets, "gU16", "mf_rlefont_" + name + "_glyph_offsets_" + std::to_string(range_index), 4); } void write_source(std::ostream &out, std::string name, const DataFile &datafile)