mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-11 18:33:16 +01:00
TESTS: Function parameters cannot be named "data" when using Raisonance STM8 compiler.
This commit is contained in:
@@ -39,7 +39,7 @@ static uint8_t test_thread_stack[TEST_THREAD_STACK_SIZE];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,12 +107,15 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Wait forever */
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ static volatile int sleep_request[2];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -213,16 +213,16 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Thread ID (0 = low prio, 1 = high prio)
|
||||
* @param[in] param Thread ID (0 = low prio, 1 = high prio)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
int thread_id;
|
||||
|
||||
/* Pull out thread ID */
|
||||
thread_id = (int)data;
|
||||
thread_id = (int)param;
|
||||
|
||||
/* Run forever */
|
||||
while (1)
|
||||
|
||||
@@ -50,7 +50,7 @@ static int volatile test_started;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -184,11 +184,11 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Thread ID (0 to 3)
|
||||
* @param[in] param Thread ID (0 to 3)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
int thread_id, expected_thread;
|
||||
int time_error, thread_error;
|
||||
@@ -196,7 +196,7 @@ static void test_thread_func (uint32_t data)
|
||||
CRITICAL_STORE;
|
||||
|
||||
/* Pull out thread ID */
|
||||
thread_id = (int)data;
|
||||
thread_id = (int)param;
|
||||
|
||||
/* Run forever */
|
||||
while (1)
|
||||
|
||||
@@ -48,8 +48,8 @@ static volatile int g_result;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test1_thread_func (uint32_t data);
|
||||
static void test2_thread_func (uint32_t data);
|
||||
static void test1_thread_func (uint32_t param);
|
||||
static void test2_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -291,14 +291,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread 1.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test1_thread_func (uint32_t data)
|
||||
static void test1_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on mutex1 with no timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
@@ -327,14 +330,17 @@ static void test1_thread_func (uint32_t data)
|
||||
*
|
||||
* Entry point for test thread 2.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test2_thread_func (uint32_t data)
|
||||
static void test2_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on mutex1 with timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
|
||||
@@ -50,7 +50,7 @@ static volatile int g_result, g_owned;
|
||||
|
||||
/* Forward declarations */
|
||||
static void testCallback (POINTER cb_data);
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -296,14 +296,17 @@ static void testCallback (POINTER cb_data)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Take mutex2 so that main thread can test mutex APIs on a mutex
|
||||
* which it does not own.
|
||||
|
||||
@@ -47,7 +47,7 @@ static volatile uint8_t wake_cnt;
|
||||
static volatile uint8_t wake_order[4];
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -246,16 +246,16 @@ uint32_t test_start (void)
|
||||
* four test threads, with the thread number/ID (1-4) passed as the entry
|
||||
* point parameter.
|
||||
*
|
||||
* @param[in] data Thread number (1,2,3,4)
|
||||
* @param[in] param Thread number (1,2,3,4)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t thread_id;
|
||||
|
||||
/* Thread ID is passed through the function parameter */
|
||||
thread_id = (uint8_t)data;
|
||||
thread_id = (uint8_t)param;
|
||||
|
||||
/*
|
||||
* Wait for mutex1 to be posted. At creation of all test threads the mutex
|
||||
|
||||
@@ -56,7 +56,7 @@ static volatile int g_failures;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -242,16 +242,19 @@ uint32_t test_start (void)
|
||||
* Entry point for test thread. The same thread entry point is used for all
|
||||
* four test threads.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint8_t status;
|
||||
CRITICAL_STORE;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Run a Get/Put pair many times */
|
||||
loop_cnt = NUM_TEST_LOOPS;
|
||||
while (loop_cnt--)
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int shared_data;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -255,14 +255,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Repeatedly attempt to get the mutex and set shared_data to 1 */
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ static volatile int shared_data;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -246,14 +246,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Repeatedly attempt to get the mutex and set shared_data to 1 */
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ static volatile int shared_data;
|
||||
|
||||
/* Forward declarations */
|
||||
static void testCallback (POINTER cb_data);
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -210,14 +210,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Block on the mutex */
|
||||
if ((status = atomMutexGet (&mutex1, 0)) != ATOM_OK)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int pass_flag[3];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -192,17 +192,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test threads.
|
||||
*
|
||||
* @param[in] data Thread ID (0-2)
|
||||
* @param[in] param Thread ID (0-2)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
int thread_id;
|
||||
|
||||
/* Pull out the passed thread ID */
|
||||
thread_id = (int)data;
|
||||
thread_id = (int)param;
|
||||
|
||||
/*
|
||||
* Wait on mutex1 with timeout. We are expecting to be woken up
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int shared_data;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -185,14 +185,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Block on the mutex */
|
||||
if ((status = atomMutexGet (&mutex1, 0)) != ATOM_OK)
|
||||
{
|
||||
|
||||
@@ -53,8 +53,8 @@ static volatile int g_result;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test1_thread_func (uint32_t data);
|
||||
static void test2_thread_func (uint32_t data);
|
||||
static void test1_thread_func (uint32_t param);
|
||||
static void test2_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -237,14 +237,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread 1.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test1_thread_func (uint32_t data)
|
||||
static void test1_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status, msg;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on queue1 with no timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
@@ -273,14 +276,17 @@ static void test1_thread_func (uint32_t data)
|
||||
*
|
||||
* Entry point for test thread 2.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test2_thread_func (uint32_t data)
|
||||
static void test2_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status, msg;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on queue1 with timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
|
||||
@@ -53,8 +53,8 @@ static volatile int g_result;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test1_thread_func (uint32_t data);
|
||||
static void test2_thread_func (uint32_t data);
|
||||
static void test1_thread_func (uint32_t param);
|
||||
static void test2_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -269,14 +269,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread 1.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test1_thread_func (uint32_t data)
|
||||
static void test1_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status, msg;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Set a test value for posting to the queue */
|
||||
msg = 0x66;
|
||||
|
||||
@@ -309,14 +312,17 @@ static void test1_thread_func (uint32_t data)
|
||||
*
|
||||
* Entry point for test thread 2.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test2_thread_func (uint32_t data)
|
||||
static void test2_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status, msg;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Set a test value for posting to the queue */
|
||||
msg = 0x66;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ static volatile uint8_t wake_cnt;
|
||||
static volatile uint8_t wake_order[4];
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -263,17 +263,17 @@ uint32_t test_start (void)
|
||||
* four test threads, with the thread number/ID (1-4) passed as the entry
|
||||
* point parameter.
|
||||
*
|
||||
* @param[in] data Thread number (1,2,3,4)
|
||||
* @param[in] param Thread number (1,2,3,4)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t thread_id;
|
||||
uint8_t msg;
|
||||
|
||||
/* Thread ID is passed through the function parameter */
|
||||
thread_id = (uint8_t)data;
|
||||
thread_id = (uint8_t)param;
|
||||
|
||||
/*
|
||||
* Wait for a message to appear on queue1. At creation of all test
|
||||
|
||||
@@ -70,7 +70,7 @@ static volatile int g_result;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test1_thread_func (uint32_t data);
|
||||
static void test1_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -215,15 +215,18 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread 1.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test1_thread_func (uint32_t data)
|
||||
static void test1_thread_func (uint32_t param)
|
||||
{
|
||||
uint32_t msg;
|
||||
int num_entries, count, failures;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Default to no errors */
|
||||
failures = 0;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ static volatile int pass_flag[3];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -192,18 +192,18 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test threads.
|
||||
*
|
||||
* @param[in] data Thread ID (0-2)
|
||||
* @param[in] param Thread ID (0-2)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
uint8_t msg;
|
||||
int thread_id;
|
||||
|
||||
/* Pull out the passed thread ID */
|
||||
thread_id = (int)data;
|
||||
thread_id = (int)param;
|
||||
|
||||
/*
|
||||
* Wait on queue1 with timeout. We are expecting to be woken up
|
||||
|
||||
@@ -62,7 +62,7 @@ static volatile int g_failures;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -237,17 +237,20 @@ uint32_t test_start (void)
|
||||
* Entry point for test thread. The same thread entry point is used for all
|
||||
* four test threads.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint8_t status;
|
||||
uint8_t msg;
|
||||
CRITICAL_STORE;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Run a Put/Get pair many times */
|
||||
loop_cnt = NUM_TEST_LOOPS;
|
||||
while (loop_cnt--)
|
||||
|
||||
18
tests/sem1.c
18
tests/sem1.c
@@ -45,8 +45,8 @@ static uint8_t test_thread_stack[NUM_TEST_THREADS][TEST_THREAD_STACK_SIZE];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test1_thread_func (uint32_t data);
|
||||
static void test2_thread_func (uint32_t data);
|
||||
static void test1_thread_func (uint32_t param);
|
||||
static void test2_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -298,14 +298,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread 1.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test1_thread_func (uint32_t data)
|
||||
static void test1_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on sem1 with no timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
@@ -337,14 +340,17 @@ static void test1_thread_func (uint32_t data)
|
||||
*
|
||||
* Entry point for test thread 2.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test2_thread_func (uint32_t data)
|
||||
static void test2_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Wait on sem1 with timeout. We are expecting to be woken up
|
||||
* by the main thread while blocking.
|
||||
|
||||
@@ -49,7 +49,7 @@ static volatile uint8_t wake_order[4];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -242,16 +242,16 @@ uint32_t test_start (void)
|
||||
* four test threads, with the thread number/ID (1-4) passed as the entry
|
||||
* point parameter.
|
||||
*
|
||||
* @param[in] data Thread number (1,2,3,4)
|
||||
* @param[in] param Thread number (1,2,3,4)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t thread_id;
|
||||
|
||||
/* Thread ID is passed through the function parameter */
|
||||
thread_id = (uint8_t)data;
|
||||
thread_id = (uint8_t)param;
|
||||
|
||||
/*
|
||||
* Wait for sem1 to be posted. At creation of all test threads
|
||||
|
||||
@@ -55,7 +55,7 @@ static volatile int g_failures;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -231,16 +231,19 @@ uint32_t test_start (void)
|
||||
* Entry point for test thread. The same thread entry point is used for all
|
||||
* four test threads.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint8_t status;
|
||||
CRITICAL_STORE;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Run a Get/Put pair many times */
|
||||
loop_cnt = NUM_TEST_LOOPS;
|
||||
while (loop_cnt--)
|
||||
|
||||
@@ -44,7 +44,7 @@ static uint8_t test_thread_stack[NUM_TEST_THREADS][TEST_THREAD_STACK_SIZE];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -193,14 +193,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Block on sem1. Main thread will post when we should wake up. */
|
||||
if ((status = atomSemGet (&sem1, 0)) != ATOM_OK)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ static uint8_t test_thread_stack[NUM_TEST_THREADS][TEST_THREAD_STACK_SIZE];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -176,16 +176,19 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
int count;
|
||||
int failures;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/*
|
||||
* Attempt to decrement sem1 ten times, which should happen immediately
|
||||
* each time.
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int shared_data;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -262,14 +262,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data Unused (optional thread entry parameter)
|
||||
* @param[in] param Unused (optional thread entry parameter)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
|
||||
/* Compiler warnings */
|
||||
param = param;
|
||||
|
||||
/* Repeatedly attempt to get the mutex and set shared_data to 1 */
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int test_running;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
static void testCallback (POINTER cb_data);
|
||||
|
||||
|
||||
@@ -221,17 +221,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test thread.
|
||||
*
|
||||
* @param[in] data sleep_flag passed through here
|
||||
* @param[in] param sleep_flag passed through here
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
int sleep_flag, count, failures;
|
||||
|
||||
/* Were we requested to sleep occasionally? */
|
||||
sleep_flag = (int)data;
|
||||
sleep_flag = (int)param;
|
||||
|
||||
/* Run until the main thread sets the finish flag or we get an error */
|
||||
failures = 0;
|
||||
|
||||
@@ -48,7 +48,7 @@ static volatile int pass_flag[3];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -185,17 +185,17 @@ uint32_t test_start (void)
|
||||
*
|
||||
* Entry point for test threads.
|
||||
*
|
||||
* @param[in] data Thread ID (0-2)
|
||||
* @param[in] param Thread ID (0-2)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t status;
|
||||
int thread_id;
|
||||
|
||||
/* Pull out the passed thread ID */
|
||||
thread_id = (int)data;
|
||||
thread_id = (int)param;
|
||||
|
||||
/*
|
||||
* Wait on sem1 with timeout. We are expecting to be woken up
|
||||
|
||||
@@ -50,7 +50,7 @@ static volatile int g_failure_cnt[3];
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static void test_thread_func (uint32_t data);
|
||||
static void test_thread_func (uint32_t param);
|
||||
|
||||
|
||||
/**
|
||||
@@ -157,17 +157,17 @@ uint32_t test_start (void)
|
||||
* three test threads, with the thread number/ID (1-3) passed as the entry
|
||||
* point parameter.
|
||||
*
|
||||
* @param[in] data Thread number (1,2,3)
|
||||
* @param[in] param Thread number (1,2,3)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void test_thread_func (uint32_t data)
|
||||
static void test_thread_func (uint32_t param)
|
||||
{
|
||||
uint8_t thread_id;
|
||||
uint32_t start_time, end_time;
|
||||
|
||||
/* Thread ID is passed through the function parameter */
|
||||
thread_id = (uint8_t)data;
|
||||
thread_id = (uint8_t)param;
|
||||
|
||||
/*
|
||||
* Sleep for 1 tick to ensure that the thread starts near
|
||||
|
||||
Reference in New Issue
Block a user