From 8310c609c31d7c0556935422940c3249fa4edaee Mon Sep 17 00:00:00 2001 From: schodet Date: Tue, 17 Nov 2009 13:36:42 +0000 Subject: cesar/mac/ca/test/fcall: use generic GPIO instead of leon ones git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6396 017c9cb6-072f-447c-8318-d5b54f68fe89 --- cesar/mac/ca/test/fcall/Config | 2 ++ cesar/mac/ca/test/fcall/src/beacon_period.c | 21 ++++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) create mode 100644 cesar/mac/ca/test/fcall/Config diff --git a/cesar/mac/ca/test/fcall/Config b/cesar/mac/ca/test/fcall/Config new file mode 100644 index 0000000000..c8aad03ed7 --- /dev/null +++ b/cesar/mac/ca/test/fcall/Config @@ -0,0 +1,2 @@ +CONFIG_GPIO_CA_FCALL_BEACON_PERIOD_SYNC = n +CONFIG_GPIO_CA_FCALL_BEACON_PERIOD_SYNC_GPIO = 0 diff --git a/cesar/mac/ca/test/fcall/src/beacon_period.c b/cesar/mac/ca/test/fcall/src/beacon_period.c index af013f7225..226a3419a3 100644 --- a/cesar/mac/ca/test/fcall/src/beacon_period.c +++ b/cesar/mac/ca/test/fcall/src/beacon_period.c @@ -15,10 +15,7 @@ #include "host/fcall/fcall.h" #include "mac/common/timings.h" -#if defined (__sparc__) -# include "hal/leon/gpio.h" -#endif - +#include "hal/gpio/gpio.h" #include "mac/ca/test/fcall/beacon_period.h" @@ -58,10 +55,6 @@ ca_test_fcall_beacon_period_init (ca_test_fcall_beacon_period_t *ctx, fcall_register (fcall, "set_beacon_period", ca_test_fcall_set_beacon_period_fcall, ctx); fcall_register (fcall, "sync", ca_test_fcall_sync_fcall, ctx); -#if defined (__sparc__) - /* Override GPIO 0 usage. */ - LEON_RB_GPIO_CONFIG (0) = 1; -#endif } void @@ -182,7 +175,7 @@ ca_test_fcall_set_beacon_period (ca_test_fcall_beacon_period_t *ctx, { /* Start now, or synchronise. */ u32 start_date = phy_date (ctx->phy); - if (sync) + if (CONFIG_GPIO_CA_FCALL_BEACON_PERIOD_SYNC && sync) { u32 ref_date = phy_clock_get_zero_cross_captured_date (ctx->phy); start_date = ref_date + (start_date - ref_date) @@ -242,12 +235,10 @@ ca_test_fcall_sync_fcall (fcall_ctx_t *fcall, fcall_param_t **param, dbg_assert (param && *param); dbg_assert (msg && *msg); /* Synchronisation pulse. */ -#if defined (__sparc__) - LEON_GPIO_DIR |= 1 << 0; - LEON_GPIO_PORT &= ~(1 << 0); - LEON_GPIO_PORT |= 1 << 0; - LEON_GPIO_PORT &= ~(1 << 0); -#endif + GPIO_SETUP (CA_FCALL_BEACON_PERIOD_SYNC, GPIO_DIRECTION_OUT); + GPIO_SET (CA_FCALL_BEACON_PERIOD_SYNC, 0); + GPIO_SET (CA_FCALL_BEACON_PERIOD_SYNC, 1); + GPIO_SET (CA_FCALL_BEACON_PERIOD_SYNC, 0); /* Return. */ fcall_param_reset (*param); return 0; -- cgit v1.2.3