From 1375e4917dc9f9ec7ad488fa83c23d94a1053de9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 Dec 2009 20:56:22 +0000 Subject: Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2352 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/skp16c26/src/skp16c26_internal.h | 4 --- nuttx/configs/skp16c26/src/up_buttons.c | 10 +++--- nuttx/configs/skp16c26/src/up_lcd.c | 50 +++++++++++++------------- nuttx/configs/skp16c26/src/up_lcdconsole.c | 2 +- nuttx/configs/skp16c26/src/up_leds.c | 18 +++++----- 5 files changed, 41 insertions(+), 43 deletions(-) (limited to 'nuttx/configs/skp16c26/src') diff --git a/nuttx/configs/skp16c26/src/skp16c26_internal.h b/nuttx/configs/skp16c26/src/skp16c26_internal.h index cdfc4460d..5d8f235f8 100644 --- a/nuttx/configs/skp16c26/src/skp16c26_internal.h +++ b/nuttx/configs/skp16c26/src/skp16c26_internal.h @@ -40,10 +40,6 @@ * Included Files ************************************************************************************/ -#ifndef __ASSEMBLY__ -# include -#endif - /************************************************************************************ * Definitions ************************************************************************************/ diff --git a/nuttx/configs/skp16c26/src/up_buttons.c b/nuttx/configs/skp16c26/src/up_buttons.c index 64d9d7345..828269a8e 100644 --- a/nuttx/configs/skp16c26/src/up_buttons.c +++ b/nuttx/configs/skp16c26/src/up_buttons.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include +#include #include "chip.h" #include "up_arch.h" @@ -75,7 +75,7 @@ #ifdef CONFIG_ARCH_BUTTONS void up_buttoninit(void) { - ubyte regval; + uint8_t regval; regval = getreg8(M16C_PD8); regval |= (SW1_BIT | SW2_BIT | SW3_BIT); @@ -86,10 +86,10 @@ void up_buttoninit(void) * Name: up_buttons ****************************************************************************/ -ubyte up_buttons(void) +uint8_t up_buttons(void) { - ubyte swset = 0; - ubyte regval = getreg8(M16C_P8); + uint8_t swset = 0; + uint8_t regval = getreg8(M16C_P8); if (SW_PRESSED(regval, SW1_BIT)) { diff --git a/nuttx/configs/skp16c26/src/up_lcd.c b/nuttx/configs/skp16c26/src/up_lcd.c index 4cb08ca25..197b67084 100644 --- a/nuttx/configs/skp16c26/src/up_lcd.c +++ b/nuttx/configs/skp16c26/src/up_lcd.c @@ -38,7 +38,9 @@ ************************************************************************************/ #include -#include + +#include +#include #include #include "up_arch.h" @@ -77,8 +79,8 @@ * Private Data ************************************************************************************/ -static ubyte g_nchars; /* Number of characters in lines 2 */ -static ubyte g_line[LCD_NCHARS]; /* The content of lines 2 */ +static uint8_t g_nchars; /* Number of characters in lines 2 */ +static uint8_t g_line[LCD_NCHARS]; /* The content of lines 2 */ /************************************************************************************ * Private Functions @@ -88,9 +90,9 @@ static ubyte g_line[LCD_NCHARS]; /* The content of lines 2 */ * Name: up_lcddelay ************************************************************************************/ -static void up_lcddelay(uint16 count) +static void up_lcddelay(uint16_t count) { - uint32 counter = (uint16)count << 8; + uint32_t counter = (uint16_t)count << 8; while(counter--) { asm("\tnop\n\tnop\n\tnop\n" : :); /* 3 NOPs */ @@ -101,11 +103,11 @@ static void up_lcddelay(uint16 count) * Name: up_setrs ************************************************************************************/ -static inline void up_setrs(boolean data) +static inline void up_setrs(bool data) { /* Set/clear bit 1 of port 6 */ - register ubyte regval = getreg8(M16C_P6); + register uint8_t regval = getreg8(M16C_P6); if (data) { regval |= (1 << 0); /* High = data */ @@ -125,7 +127,7 @@ static inline void up_seten(void) { /* Set bit 1 of port 6 */ - register ubyte regval = getreg8(M16C_P6); + register uint8_t regval = getreg8(M16C_P6); regval = (1 << 1); putreg8(regval, M16C_P6); } @@ -138,7 +140,7 @@ static inline void up_clren(void) { /* Clear bit 1 of port 6 */ - register ubyte regval = getreg8(M16C_P6); + register uint8_t regval = getreg8(M16C_P6); regval &= ~(1 << 1); putreg8(regval, M16C_P6); } @@ -147,7 +149,7 @@ static inline void up_clren(void) * Name: up_enpluse ************************************************************************************/ -static inline void up_enpulse(boolean data) +static inline void up_enpulse(bool data) { up_seten(); /* EN enable chip (HIGH) */ up_lcddelay(0); /* Short delay */ @@ -160,7 +162,7 @@ static inline void up_enpulse(boolean data) * Name: up_lcdwrite ************************************************************************************/ -void up_lcdwrite(boolean data, ubyte ch) +void up_lcdwrite(bool data, uint8_t ch) { up_setrs(data); /* Set RS appropriately */ @@ -187,19 +189,19 @@ static void up_scroll(void) /* Clear the display and position the cursor at the beginning of line 1 */ - up_lcdwrite(FALSE, LCD_CLEAR); - up_lcdwrite(FALSE, LCD_HOME_L1); + up_lcdwrite(false, LCD_CLEAR); + up_lcdwrite(false, LCD_HOME_L1); /* Copy line 2 to line 1 */ for (i = 0; i < g_nchars; i++) { - up_lcdwrite(TRUE, g_line[i]); + up_lcdwrite(true, g_line[i]); } /* Position the cursor at the beginning of line 2 */ - up_lcdwrite(FALSE, LCD_HOME_L2); + up_lcdwrite(false, LCD_HOME_L2); g_nchars = 0; } @@ -213,7 +215,7 @@ static void up_scroll(void) void up_lcdinit(void) { - ubyte regval; + uint8_t regval; /* Enable writing to PD9 by selecting bit 2 in the protection register */ @@ -241,15 +243,15 @@ void up_lcdinit(void) /* Write the reset sequence */ - up_lcdwrite(FALSE, 0x33); + up_lcdwrite(false, 0x33); up_lcddelay(20); - up_lcdwrite(FALSE, 0x32); + up_lcdwrite(false, 0x32); up_lcddelay(20); - up_lcdwrite(FALSE, FUNCTION_SET); /* reset sequence */ - up_lcdwrite(FALSE, FUNCTION_SET); - up_lcdwrite(FALSE, LCD_CURSOR_OFF); - up_lcdwrite(FALSE, LCD_CLEAR); - up_lcdwrite(FALSE, LCD_HOME_L1); + up_lcdwrite(false, FUNCTION_SET); /* reset sequence */ + up_lcdwrite(false, FUNCTION_SET); + up_lcdwrite(false, LCD_CURSOR_OFF); + up_lcdwrite(false, LCD_CLEAR); + up_lcdwrite(false, LCD_HOME_L1); } /************************************************************************************ @@ -271,7 +273,7 @@ void up_lcdputc(char ch) else if (g_nchars < LCD_NCHARS && isprint(ch)) { - up_lcdwrite(TRUE, ch); + up_lcdwrite(true, ch); g_line[g_nchars] = ch; g_nchars++; } diff --git a/nuttx/configs/skp16c26/src/up_lcdconsole.c b/nuttx/configs/skp16c26/src/up_lcdconsole.c index e203c24d9..c4e1d0e79 100644 --- a/nuttx/configs/skp16c26/src/up_lcdconsole.c +++ b/nuttx/configs/skp16c26/src/up_lcdconsole.c @@ -38,7 +38,7 @@ ************************************************************************************/ #include -#include + #include #include "up_internal.h" diff --git a/nuttx/configs/skp16c26/src/up_leds.c b/nuttx/configs/skp16c26/src/up_leds.c index a65d423a9..b64b8b7d0 100644 --- a/nuttx/configs/skp16c26/src/up_leds.c +++ b/nuttx/configs/skp16c26/src/up_leds.c @@ -38,7 +38,7 @@ ************************************************************************************/ #include -#include +#include #include #include "up_arch.h" @@ -85,7 +85,7 @@ * Private Data Definitions ************************************************************************************/ -static const ubyte g_ledstate[7] = +static const uint8_t g_ledstate[7] = { (GREEN_LED_OFF | YELLOW_LED_OFF | RED_LED_OFF), /* LED_STARTED */ (GREEN_LED_ON | YELLOW_LED_OFF | RED_LED_OFF), /* LED_HEAPALLOCATE */ @@ -97,8 +97,8 @@ static const ubyte g_ledstate[7] = (GREEN_LED_ON | YELLOW_LED_ON | RED_LED_ON ) /* LED_ASSERTION */ }; -static ubyte g_prevled[3]; -static ubyte g_nestlevel; +static uint8_t g_prevled[3]; +static uint8_t g_nestlevel; /************************************************************************************ * Private Functions @@ -108,9 +108,9 @@ static ubyte g_nestlevel; * Name: up_ledinit ************************************************************************************/ -static void up_setleds(ubyte gybits, ubyte rbit) +static void up_setleds(uint8_t gybits, uint8_t rbit) { - ubyte regval; + uint8_t regval; regval = getreg8(GREENYELLOW_LED_PORT); regval &= ~GREENYELLOW_LED_MASK; @@ -133,7 +133,7 @@ static void up_setleds(ubyte gybits, ubyte rbit) void up_ledinit(void) { - register ubyte regval; + register uint8_t regval; /* Make sure that the LEDs are in the OFF state */ @@ -162,7 +162,7 @@ void up_ledinit(void) void up_ledon(int led) { - ubyte ledset; + uint8_t ledset; /* If this is the ASSERTION led, preserve the Y&G bits from the last setting and * set the RED LED on. @@ -198,7 +198,7 @@ void up_ledon(int led) void up_ledoff(int led) { - ubyte ledset; + uint8_t ledset; /* If this is the ASSERTION led then what we do depends on the previous state */ -- cgit v1.2.3