From 53f1b747726d85020beca994f6fe67a5e9af7b8e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 16 May 2009 14:49:41 +0000 Subject: Added static initializers for mailboxes and memory pools. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@978 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/testmbox.c | 10 +++++++--- test/testpools.c | 2 +- test/testqueues.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/testmbox.c b/test/testmbox.c index 2403afce6..a485c3a4e 100644 --- a/test/testmbox.c +++ b/test/testmbox.c @@ -55,8 +55,12 @@ #define ALLOWED_DELAY MS2ST(5) #define MB_SIZE 5 -static msg_t mb1_buf[MB_SIZE]; -static Mailbox mb1; +/* + * Note, the static initializers are not really required because the + * variables are explicitly initialized in each test case. It is done in order + * to test the macros. + */ +static MAILBOX_DECL(mb1, waT0, MB_SIZE); /** * @page test_mbox_001 Queuing and timeouts @@ -74,7 +78,7 @@ static char *mbox1_gettest(void) { static void mbox1_setup(void) { - chMBInit(&mb1, mb1_buf, MB_SIZE); + chMBInit(&mb1, (msg_t *)waT0, MB_SIZE); } static void mbox1_execute(void) { diff --git a/test/testpools.c b/test/testpools.c index 78f19a91c..ce6716444 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -49,7 +49,7 @@ #if CH_USE_MEMPOOLS -static MemoryPool mp1; +static MEMORYPOOL_DECL(mp1, THD_WA_SIZE(THREADS_STACK_SIZE)); /** * @page test_pools_001 Allocation and enqueuing test diff --git a/test/testqueues.c b/test/testqueues.c index 36c90402b..fe79712eb 100644 --- a/test/testqueues.c +++ b/test/testqueues.c @@ -64,8 +64,8 @@ static void notify(void) {} * variables are explicitly initialized in each test case. It is done in order * to test the macros. */ -static INPUTQUEUE_DECL(iq, (uint8_t *)waT0, TEST_QUEUES_SIZE, notify); -static OUTPUTQUEUE_DECL(oq, (uint8_t *)waT0, TEST_QUEUES_SIZE, notify); +static INPUTQUEUE_DECL(iq, waT0, TEST_QUEUES_SIZE, notify); +static OUTPUTQUEUE_DECL(oq, waT0, TEST_QUEUES_SIZE, notify); /** * @page test_queues_001 Input Queues functionality and APIs -- cgit v1.2.3