Skip to content

Commit

Permalink
Fix nasa#779, Change global vars to not be hidden by local vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzaben committed Feb 10, 2021
1 parent 09a2c5e commit e123896
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/tests/bin-sem-test/bin-sem-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ uint32 timer_failures;
osal_id_t bin_sem_id;

uint32 timer_counter;
osal_id_t timer_id;
osal_id_t Timer_Id;
uint32 timer_start = 1000;
uint32 timer_interval = 10000; /* 1000 = 1000 hz, 10000 == 100 hz */
uint32 timer_accuracy;
Expand Down Expand Up @@ -161,7 +161,7 @@ void BinSemCheck(void)
status = OS_TaskDelete(task_1_id);
UtAssert_True(status == OS_SUCCESS, "OS_TaskDelete Rc=%d", (int)status);

status = OS_TimerDelete(timer_id);
status = OS_TimerDelete(Timer_Id);
UtAssert_True(status == OS_SUCCESS, "OS_TimerDelete Rc=%d", (int)status);

OS_TaskDelay(100);
Expand Down Expand Up @@ -231,14 +231,14 @@ void BinSemSetup(void)
/*
** Create a timer
*/
status = OS_TimerCreate(&timer_id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(timer_id), (int)status);
status = OS_TimerCreate(&Timer_Id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(Timer_Id), (int)status);
UtPrintf("Timer Accuracy = %u microseconds \n", (unsigned int)accuracy);

/*
** Start the timer
*/
status = OS_TimerSet(timer_id, timer_start, timer_interval);
status = OS_TimerSet(Timer_Id, timer_start, timer_interval);
UtAssert_True(status == OS_SUCCESS, "Timer 1 set Rc=%d", (int)status);

/*
Expand Down
10 changes: 5 additions & 5 deletions src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ osal_id_t task_2_id;
osal_id_t bin_sem_id;

uint32 timer_counter;
osal_id_t timer_id;
osal_id_t Timer_Id;
uint32 timer_start = 1000000;
uint32 timer_interval = 2000000; /* 2 second period */
uint32 timer_accuracy;
Expand Down Expand Up @@ -150,7 +150,7 @@ void BinSemTimeoutCheck(void)
int32 status;
uint32 limit;

status = OS_TimerDelete(timer_id);
status = OS_TimerDelete(Timer_Id);
UtAssert_True(status == OS_SUCCESS, "OS_TimerDelete Rc=%d", (int)status);

status = OS_TaskDelete(task_1_id);
Expand Down Expand Up @@ -227,14 +227,14 @@ void BinSemTimeoutSetup(void)
/*
** Create a timer
*/
status = OS_TimerCreate(&timer_id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(timer_id), (int)status);
status = OS_TimerCreate(&Timer_Id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(Timer_Id), (int)status);
UtPrintf("Timer Accuracy = %u microseconds \n", (unsigned int)accuracy);

/*
** Start the timer
*/
status = OS_TimerSet(timer_id, timer_start, timer_interval);
status = OS_TimerSet(Timer_Id, timer_start, timer_interval);
UtAssert_True(status == OS_SUCCESS, "Timer 1 set Rc=%d", (int)status);

/*
Expand Down
18 changes: 9 additions & 9 deletions src/tests/queue-test/queue-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ osal_id_t task_2_id;
osal_id_t msgq_id;

uint32 timer_counter;
osal_id_t timer_id;
osal_id_t Timer_Id;
uint32 timer_start = 10000;
uint32 timer_interval = 100000; /* 1000 = 1000 hz, 10000 == 100 hz */
uint32 timer_accuracy;
Expand Down Expand Up @@ -110,7 +110,7 @@ void QueueTimeoutCheck(void)
int32 status;
uint32 limit;

status = OS_TimerDelete(timer_id);
status = OS_TimerDelete(Timer_Id);
UtAssert_True(status == OS_SUCCESS, "Timer delete Rc=%d", (int)status);
status = OS_TaskDelete(task_1_id);
UtAssert_True(status == OS_SUCCESS, "Task 1 delete Rc=%d", (int)status);
Expand Down Expand Up @@ -157,14 +157,14 @@ void QueueTimeoutSetup(void)
/*
** Create a timer
*/
status = OS_TimerCreate(&timer_id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(timer_id), (int)status);
status = OS_TimerCreate(&Timer_Id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(Timer_Id), (int)status);
UtPrintf("Timer Accuracy = %u microseconds \n", (unsigned int)accuracy);

/*
** Start the timer
*/
status = OS_TimerSet(timer_id, timer_start, timer_interval);
status = OS_TimerSet(Timer_Id, timer_start, timer_interval);
UtAssert_True(status == OS_SUCCESS, "Timer 1 set Rc=%d", (int)status);

/* allow some time for task to run and accrue queue timeouts */
Expand All @@ -181,7 +181,7 @@ void QueueMessageCheck(void)
OS_printf("Delay for half a second before checking\n");
OS_TaskDelay(500);

status = OS_TimerDelete(timer_id);
status = OS_TimerDelete(Timer_Id);
UtAssert_True(status == OS_SUCCESS, "Timer delete Rc=%d", (int)status);
status = OS_TaskDelete(task_1_id);
UtAssert_True(status == OS_SUCCESS, "Task 1 delete Rc=%d", (int)status);
Expand Down Expand Up @@ -217,14 +217,14 @@ void QueueMessageSetup(void)
/*
** Create a timer
*/
status = OS_TimerCreate(&timer_id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(timer_id), (int)status);
status = OS_TimerCreate(&Timer_Id, "Timer 1", &accuracy, &(TimerFunction));
UtAssert_True(status == OS_SUCCESS, "Timer 1 create Id=%lx Rc=%d", OS_ObjectIdToInteger(Timer_Id), (int)status);
UtPrintf("Timer Accuracy = %u microseconds \n", (unsigned int)accuracy);

/*
** Start the timer
*/
status = OS_TimerSet(timer_id, timer_start, timer_interval);
status = OS_TimerSet(Timer_Id, timer_start, timer_interval);
UtAssert_True(status == OS_SUCCESS, "Timer 1 set Rc=%d", (int)status);

/*
Expand Down

0 comments on commit e123896

Please sign in to comment.