From ec0a917ae1bef32f1848161e759ef98542327523 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 3 Mar 2008 15:52:55 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@212 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ports/ARM7-AT91SAM7X/sam7x_serial.c | 10 ++--- ports/ARM7-LPC214x/lpc214x_serial.c | 10 ++--- ports/ARM7-LPC214x/lpc214x_ssp.c | 2 +- ports/ARM7-LPC214x/lpc214x_ssp.h | 2 +- ports/ARM7/chcore.h | 4 +- ports/ARM7/chtypes.h | 36 +++++++---------- ports/AVR/chcore.h | 80 ++++++++++++++++++------------------- ports/AVR/chtypes.h | 37 +++++++---------- 8 files changed, 84 insertions(+), 97 deletions(-) (limited to 'ports') diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.c b/ports/ARM7-AT91SAM7X/sam7x_serial.c index 5d56e267d..b3719fbc2 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.c +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.c @@ -24,15 +24,15 @@ #include "at91lib/aic.h" FullDuplexDriver COM1; -static BYTE8 ib1[SERIAL_BUFFERS_SIZE]; -static BYTE8 ob1[SERIAL_BUFFERS_SIZE]; +static uint8_t ib1[SERIAL_BUFFERS_SIZE]; +static uint8_t ob1[SERIAL_BUFFERS_SIZE]; FullDuplexDriver COM2; -static BYTE8 ib2[SERIAL_BUFFERS_SIZE]; -static BYTE8 ob2[SERIAL_BUFFERS_SIZE]; +static uint8_t ib2[SERIAL_BUFFERS_SIZE]; +static uint8_t ob2[SERIAL_BUFFERS_SIZE]; static void SetError(AT91_REG csr, FullDuplexDriver *com) { - UWORD16 sts = 0; + uint16_t sts = 0; if (csr & AT91C_US_OVRE) sts |= SD_OVERRUN_ERROR; diff --git a/ports/ARM7-LPC214x/lpc214x_serial.c b/ports/ARM7-LPC214x/lpc214x_serial.c index 88fc9ab91..beed14cd2 100644 --- a/ports/ARM7-LPC214x/lpc214x_serial.c +++ b/ports/ARM7-LPC214x/lpc214x_serial.c @@ -25,15 +25,15 @@ #include "board.h" FullDuplexDriver COM1; -BYTE8 ib1[SERIAL_BUFFERS_SIZE]; -BYTE8 ob1[SERIAL_BUFFERS_SIZE]; +uint8_t ib1[SERIAL_BUFFERS_SIZE]; +uint8_t ob1[SERIAL_BUFFERS_SIZE]; FullDuplexDriver COM2; -BYTE8 ib2[SERIAL_BUFFERS_SIZE]; -BYTE8 ob2[SERIAL_BUFFERS_SIZE]; +uint8_t ib2[SERIAL_BUFFERS_SIZE]; +uint8_t ob2[SERIAL_BUFFERS_SIZE]; static void SetError(IOREG32 err, FullDuplexDriver *com) { - UWORD16 sts = 0; + uint16_t sts = 0; if (err & LSR_OVERRUN) sts |= SD_OVERRUN_ERROR; diff --git a/ports/ARM7-LPC214x/lpc214x_ssp.c b/ports/ARM7-LPC214x/lpc214x_ssp.c index ab0c4f141..80a936f4a 100644 --- a/ports/ARM7-LPC214x/lpc214x_ssp.c +++ b/ports/ARM7-LPC214x/lpc214x_ssp.c @@ -55,7 +55,7 @@ void sspReleaseBus(void) { * rest of the system. This kind of peripheral would really need a * dedicated DMA channel. */ -void sspRW(BYTE8 *in, BYTE8 *out, t_size n) { +void sspRW(uint8_t *in, uint8_t *out, t_size n) { int icnt, ocnt; SSP *ssp = SSPBase; diff --git a/ports/ARM7-LPC214x/lpc214x_ssp.h b/ports/ARM7-LPC214x/lpc214x_ssp.h index 07401d173..70a4be527 100644 --- a/ports/ARM7-LPC214x/lpc214x_ssp.h +++ b/ports/ARM7-LPC214x/lpc214x_ssp.h @@ -34,7 +34,7 @@ void sspAcquireBus(void); void sspReleaseBus(void); - void sspRW(BYTE8 *in, BYTE8 *out, t_size n); + void sspRW(uint8_t *in, uint8_t *out, t_size n); #ifdef __cplusplus } #endif diff --git a/ports/ARM7/chcore.h b/ports/ARM7/chcore.h index d03d6aaba..7965f1174 100644 --- a/ports/ARM7/chcore.h +++ b/ports/ARM7/chcore.h @@ -64,7 +64,7 @@ typedef struct { * Platform dependent part of the \p chThdCreate() API. */ #define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.r13 = (struct intctx *)((BYTE8 *)workspace + \ + tp->p_ctx.r13 = (struct intctx *)((uint8_t *)workspace + \ wsize - \ sizeof(struct intctx)); \ tp->p_ctx.r13->r4 = pf; \ @@ -91,7 +91,7 @@ extern void chSysUnlock(void); sizeof(struct extctx) + \ (n) + \ INT_REQUIRED_STACK) -#define WorkingArea(s, n) ULONG32 s[UserStackSize(n) >> 2]; +#define WorkingArea(s, n) uint32_t s[UserStackSize(n) >> 2]; #ifdef THUMB #define chSysSwitchI chSysSwitchI_thumb diff --git a/ports/ARM7/chtypes.h b/ports/ARM7/chtypes.h index 2ac219148..c8a1dc69c 100644 --- a/ports/ARM7/chtypes.h +++ b/ports/ARM7/chtypes.h @@ -20,27 +20,21 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -/* - * Generic types often dependant on the compiler. - */ -#define BOOL char -#define BYTE8 unsigned char -#define SBYTE8 char -#define WORD16 short -#define UWORD16 unsigned short -#define LONG32 int -#define ULONG32 unsigned int - -typedef BYTE8 t_tmode; -typedef BYTE8 t_tstate; -typedef UWORD16 t_tid; -typedef ULONG32 t_prio; -typedef LONG32 t_msg; -typedef LONG32 t_eventid; -typedef ULONG32 t_eventmask; -typedef ULONG32 t_time; -typedef LONG32 t_cnt; -typedef ULONG32 t_size; +#if !defined(_STDINT_H) && !defined(__STDINT_H_) +#include +#endif + +typedef int8_t t_bool; +typedef uint8_t t_tmode; +typedef uint8_t t_tstate; +typedef uint16_t t_tid; +typedef uint32_t t_prio; +typedef int32_t t_msg; +typedef int32_t t_eventid; +typedef uint32_t t_eventmask; +typedef uint32_t t_time; +typedef int32_t t_cnt; +typedef uint32_t t_size; #define INLINE inline diff --git a/ports/AVR/chcore.h b/ports/AVR/chcore.h index dd3f65ba8..eb7e334f6 100644 --- a/ports/AVR/chcore.h +++ b/ports/AVR/chcore.h @@ -24,52 +24,52 @@ * Interrupt saved context. */ struct extctx { - BYTE8 _next; - BYTE8 r31; - BYTE8 r30; - BYTE8 r27; - BYTE8 r26; - BYTE8 r25; - BYTE8 r24; - BYTE8 r23; - BYTE8 r22; - BYTE8 r21; - BYTE8 r20; - BYTE8 r19; - BYTE8 r18; - BYTE8 sr; - BYTE8 r1; - BYTE8 r0; - UWORD16 pc; + uint8_t _next; + uint8_t r31; + uint8_t r30; + uint8_t r27; + uint8_t r26; + uint8_t r25; + uint8_t r24; + uint8_t r23; + uint8_t r22; + uint8_t r21; + uint8_t r20; + uint8_t r19; + uint8_t r18; + uint8_t sr; + uint8_t r1; + uint8_t r0; + uint16_t pc; }; /* * System saved context. */ struct intctx { - BYTE8 _next; - BYTE8 r29; - BYTE8 r28; - BYTE8 r17; - BYTE8 r16; - BYTE8 r15; - BYTE8 r14; - BYTE8 r13; - BYTE8 r12; - BYTE8 r11; - BYTE8 r10; + uint8_t _next; + uint8_t r29; + uint8_t r28; + uint8_t r17; + uint8_t r16; + uint8_t r15; + uint8_t r14; + uint8_t r13; + uint8_t r12; + uint8_t r11; + uint8_t r10; #ifndef CH_CURRP_REGISTER_CACHE - BYTE8 r9; - BYTE8 r8; + uint8_t r9; + uint8_t r8; #endif - BYTE8 r7; - BYTE8 r6; - BYTE8 r5; - BYTE8 r4; - BYTE8 r3; - BYTE8 r2; - BYTE8 pcl; - BYTE8 pch; + uint8_t r7; + uint8_t r6; + uint8_t r5; + uint8_t r4; + uint8_t r3; + uint8_t r2; + uint8_t pcl; + uint8_t pch; }; /* @@ -84,7 +84,7 @@ typedef struct { * Platform dependent part of the \p chThdCreate() API. */ #define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.sp = (struct intctx*)((BYTE8 *)workspace + wsize - 1 - \ + tp->p_ctx.sp = (struct intctx*)((uint8_t *)workspace + wsize - 1 - \ (sizeof(struct intctx) - 1)); \ tp->p_ctx.sp->r2 = (int)pf; \ tp->p_ctx.sp->r3 = (int)pf >> 8; \ @@ -100,7 +100,7 @@ typedef struct { (sizeof(struct intctx) - 1) + \ (sizeof(struct extctx) - 1) + \ (n) + (INT_REQUIRED_STACK)) -#define WorkingArea(s, n) BYTE8 s[UserStackSize(n)]; +#define WorkingArea(s, n) uint8_t s[UserStackSize(n)]; #define chSysLock() asm volatile ("cli") diff --git a/ports/AVR/chtypes.h b/ports/AVR/chtypes.h index 60e16aaf4..67f188b82 100644 --- a/ports/AVR/chtypes.h +++ b/ports/AVR/chtypes.h @@ -20,28 +20,21 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -/* - * Generic types often dependant on the compiler. - */ -#define BOOL char -#define BYTE8 unsigned char -#define SBYTE8 signed char -#define WORD16 int -#define UWORD16 unsigned int -#define LONG32 long -#define ULONG32 unsigned long -#define PTR_EQ int - -typedef BYTE8 t_tmode; -typedef BYTE8 t_tstate; -typedef BYTE8 t_tid; -typedef BYTE8 t_prio; -typedef WORD16 t_msg; -typedef BYTE8 t_eventid; -typedef BYTE8 t_eventmask; -typedef UWORD16 t_time; -typedef SBYTE8 t_cnt; -typedef UWORD16 t_size; +#if !defined(_STDINT_H) && !defined(__STDINT_H_) +#include +#endif + +typedef int8_t t_bool; +typedef uint8_t t_tmode; +typedef uint8_t t_tstate; +typedef uint8_t t_tid; +typedef uint8_t t_prio; +typedef int16_t t_msg; +typedef uint8_t t_eventid; +typedef uint8_t t_eventmask; +typedef uint16_t t_time; +typedef int8_t t_cnt; +typedef uint16_t t_size; #define INLINE inline -- cgit v1.2.3