summaryrefslogtreecommitdiff
path: root/cesar/mac/sar/test
diff options
context:
space:
mode:
authorlaranjeiro2009-05-25 10:25:23 +0000
committerlaranjeiro2009-05-25 10:25:23 +0000
commit76c94bcbcf4b035fcc5aea560ddf550ed60e548e (patch)
treef21d996c2cef2e98af594cd137ef6ea21e645ab5 /cesar/mac/sar/test
parent9573cc6b8d2b7978bd085ea05244c585480e1d67 (diff)
mac/sar: (Closes #376)
* hal/phy: * Force the bridge DMA (software version) to change the current job before calling the eCos ISR. * Removed the direction boolean in the bridge mailbox, it was not used. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4696 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/mac/sar/test')
-rw-r--r--cesar/mac/sar/test/functional/src/sar_tx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cesar/mac/sar/test/functional/src/sar_tx.c b/cesar/mac/sar/test/functional/src/sar_tx.c
index 24790d8e51..5b0b8ef23a 100644
--- a/cesar/mac/sar/test/functional/src/sar_tx.c
+++ b/cesar/mac/sar/test/functional/src/sar_tx.c
@@ -37,6 +37,9 @@ static u8 skbuffer[2048];
static sar_t *sar_ctx = NULL;
static mac_store_t *mac_store = NULL;
+static uint count = 0;
+cyg_sem_t semaphore;
+
/* Thread data for the test. */
cyg_thread my_test_thread;
cyg_handle_t my_test_thread_handle;
@@ -55,6 +58,10 @@ bool ce_measurements (void *user, pbproc_rx_params_t *rx_params, uint pb_nb,
void
segmentation_done (void *ctx, u8 *buffer, void *user_data)
{
+ count ++;
+
+ if (count == 2)
+ cyg_semaphore_post (&semaphore);
}
void
@@ -182,7 +189,7 @@ test_thread_process (cyg_addrword_t data)
prepare_test (test);
/* Wait the bridgedma ends its job. */
- cyg_thread_delay (10);
+ cyg_semaphore_wait (&semaphore);
verify_test (test);
test_result (test);
@@ -194,6 +201,8 @@ test_thread_process (cyg_addrword_t data)
mac_store_uninit (mac_store);
mac_ntb_uninit();
+ cyg_semaphore_destroy (&semaphore);
+
#ifndef __sparc__
HAL_PLATFORM_EXIT (test_nb_failed (test) == 0 ? 0 : 1);
#endif
@@ -202,6 +211,8 @@ test_thread_process (cyg_addrword_t data)
int
cyg_user_start (void)
{
+ cyg_semaphore_init(&semaphore, 0);
+
// Create the thread.
cyg_thread_create( 10,
&test_thread_process,