From 5e64a9fec2e17d008b9488faa027d2beaa130a88 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 5 Mar 2008 10:59:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@215 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/Win32-MinGW/chcore.c | 2 +- demos/Win32-MinGW/chcore.h | 2 +- demos/Win32-MinGW/chtypes.h | 25 ++++++++++++++----------- demos/Win32-MinGW/demo.c | 30 +++++++++++++++--------------- 4 files changed, 31 insertions(+), 28 deletions(-) (limited to 'demos/Win32-MinGW') diff --git a/demos/Win32-MinGW/chcore.c b/demos/Win32-MinGW/chcore.c index 866ac791e..047fe66da 100644 --- a/demos/Win32-MinGW/chcore.c +++ b/demos/Win32-MinGW/chcore.c @@ -91,7 +91,7 @@ void ChkIntSources(void) { } } -t_msg _IdleThread(void *p) { +msg_t _IdleThread(void *p) { while (TRUE) { diff --git a/demos/Win32-MinGW/chcore.h b/demos/Win32-MinGW/chcore.h index fed88c171..bc0ed3e42 100644 --- a/demos/Win32-MinGW/chcore.h +++ b/demos/Win32-MinGW/chcore.h @@ -73,7 +73,7 @@ typedef struct { #define WorkingArea(s, n) uint32_t s[UserStackSize(n) >> 2]; #define IDLE_THREAD_STACK_SIZE 16384 -t_msg _IdleThread(void *p); +msg_t _IdleThread(void *p); __attribute__((fastcall)) void chSysHalt(void); __attribute__((fastcall)) void chSysSwitchI(Thread *otp, Thread *ntp); diff --git a/demos/Win32-MinGW/chtypes.h b/demos/Win32-MinGW/chtypes.h index c8a1dc69c..2fd609b1f 100644 --- a/demos/Win32-MinGW/chtypes.h +++ b/demos/Win32-MinGW/chtypes.h @@ -20,21 +20,24 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ +#define __need_NULL +#define __need_size_t +#include + #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; +typedef int8_t bool_t; +typedef uint8_t tmode_t; +typedef uint8_t tstate_t; +typedef uint16_t tid_t; +typedef uint32_t tprio_t; +typedef int32_t msg_t; +typedef int32_t eventid_t; +typedef uint32_t eventmask_t; +typedef uint32_t systime_t; +typedef int32_t cnt_t; #define INLINE inline diff --git a/demos/Win32-MinGW/demo.c b/demos/Win32-MinGW/demo.c index 0b646a50b..f3d276599 100644 --- a/demos/Win32-MinGW/demo.c +++ b/demos/Win32-MinGW/demo.c @@ -29,21 +29,21 @@ static uint32_t cdguard; static WorkingArea(cdarea, 2048); static Thread *cdtp; -static t_msg WatchdogThread(void *arg); -static t_msg ConsoleThread(void *arg); +static msg_t WatchdogThread(void *arg); +static msg_t ConsoleThread(void *arg); -t_msg TestThread(void *p); +msg_t TestThread(void *p); void InitCore(void); extern FullDuplexDriver COM1, COM2; -#define cprint(msg) chMsgSend(cdtp, (t_msg)msg) +#define cprint(msg) chMsgSend(cdtp, (msg_t)msg) /* * Watchdog thread, it checks magic values located under the various stack * areas. The system is halted if something is wrong. */ -static t_msg WatchdogThread(void *arg) { +static msg_t WatchdogThread(void *arg) { wdguard = 0xA51F2E3D; cdguard = 0xA51F2E3D; while (TRUE) { @@ -63,7 +63,7 @@ static t_msg WatchdogThread(void *arg) { * to the C printf() thread safe and the print operation atomic among threads. * In this example the message is the zero termitated string itself. */ -static t_msg ConsoleThread(void *arg) { +static msg_t ConsoleThread(void *arg) { while (!chThdShouldTerminate()) { printf((char *)chMsgWait()); @@ -78,7 +78,7 @@ static void PrintLineFDD(FullDuplexDriver *sd, char *msg) { chFDDPut(sd, *msg++); } -static t_bool GetLineFDD(FullDuplexDriver *sd, char *line, int size) { +static bool_t GetLineFDD(FullDuplexDriver *sd, char *line, int size) { char *p = line; while (TRUE) { @@ -116,7 +116,7 @@ static t_bool GetLineFDD(FullDuplexDriver *sd, char *line, int size) { * Example thread, not much to see here. It simulates the CTRL-C but there * are no real signals involved. */ -static t_msg HelloWorldThread(void *arg) { +static msg_t HelloWorldThread(void *arg) { int i; short c; FullDuplexDriver *sd = (FullDuplexDriver *)arg; @@ -140,7 +140,7 @@ static t_msg HelloWorldThread(void *arg) { return 0; } -static t_bool checkend(FullDuplexDriver *sd) { +static bool_t checkend(FullDuplexDriver *sd) { char * lp = strtok(NULL, " \009"); /* It is not thread safe but this is a demo.*/ if (lp) { @@ -155,7 +155,7 @@ static t_bool checkend(FullDuplexDriver *sd) { * Simple command shell thread, the argument is the serial line for the * standard input and output. It recognizes few simple commands. */ -static t_msg ShellThread(void *arg) { +static msg_t ShellThread(void *arg) { FullDuplexDriver *sd = (FullDuplexDriver *)arg; char *lp, line[64]; Thread *tp; @@ -225,8 +225,8 @@ static WorkingArea(s1area, 4096); static Thread *s1; EventListener s1tel; -static void COM1Handler(t_eventid id) { - t_dflags flags; +static void COM1Handler(eventid_t id) { + dflags_t flags; if (s1 && chThdTerminated(s1)) { s1 = NULL; @@ -248,8 +248,8 @@ static WorkingArea(s2area, 4096); static Thread *s2; EventListener s2tel; -static void COM2Handler(t_eventid id) { - t_dflags flags; +static void COM2Handler(eventid_t id) { + dflags_t flags; if (s2 && chThdTerminated(s2)) { s2 = NULL; @@ -267,7 +267,7 @@ static void COM2Handler(t_eventid id) { chIQReset(&COM2.sd_iqueue); } -static t_evhandler fhandlers[2] = { +static evhandler_t fhandlers[2] = { COM1Handler, COM2Handler }; -- cgit v1.2.3