summaryrefslogtreecommitdiff
path: root/cesar/bsu/aclf/src
diff options
context:
space:
mode:
authorlaranjeiro2010-05-17 09:30:30 +0000
committerlaranjeiro2010-05-17 09:30:30 +0000
commit7f359021ac816d07b2d4c942c7871b9016366f49 (patch)
tree821beebc973777011ee643831764dd347def2397 /cesar/bsu/aclf/src
parentd861f4338f507bb3471ed881f42d00763f893ab3 (diff)
cesar/{bsu,bsu/aclf}: return bsu_aclf_t context on bsu_aclf_init
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7031 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/bsu/aclf/src')
-rw-r--r--cesar/bsu/aclf/src/aclf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cesar/bsu/aclf/src/aclf.c b/cesar/bsu/aclf/src/aclf.c
index 1cb2b01771..2655cde640 100644
--- a/cesar/bsu/aclf/src/aclf.c
+++ b/cesar/bsu/aclf/src/aclf.c
@@ -30,6 +30,9 @@
/** WP History coefficient value. */
#define BSU_ACLF_WP 0.0625
+/** Local variable. */
+static bsu_aclf_t bsu_aclf_global;
+
/**
* Compute the beacon period duration from the AC Line frequency variation.
* \param ctx the module context.
@@ -52,15 +55,16 @@ bsu_aclf_compute_beacon_period_from_acl (bsu_aclf_t *ctx)
ctx->beacon_period += BSU_ACLF_WP * ((s32) diff - (s32)ctx->beacon_period);
}
-void
-bsu_aclf_init (bsu_aclf_t *ctx, phy_t *phy, mac_config_t *mac_config)
+bsu_aclf_t*
+bsu_aclf_init (phy_t *phy, mac_config_t *mac_config)
{
- dbg_assert (ctx);
+ bsu_aclf_t *ctx = &bsu_aclf_global;
dbg_assert (phy);
dbg_assert (mac_config);
memset (ctx, 0, sizeof (bsu_aclf_t));
ctx->phy = phy;
ctx->mac_config = mac_config;
+ return ctx;
}
void