Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT-FS → Thread

   

What is the proper way to stop ANT-FS?

Rank

Total Posts: 17

Joined 2015-10-28

PM

I have an N5150 SOC running my application and want ANT-FS running only at selected times. Starting up is easy but I don't see any examples of closing/stopping ANT-FS. Obviously it will 'stop' if I close the channel, but it seems I'd be leaving a bunch of 'residue' in the antfs functions.

Another thought was calling state_machine_reset(), but this is a local function only so that doesn't seem to be an intentional interface.

Any suggestions?

Tom      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Tom,

Unfortunately that particular reference design does not have clean API's for starting/stopping the library, unlike the PC ANT-FS Library.

The safest procedure would be to close & unassign the channel, and then re-initializing.      
Rank

Total Posts: 17

Joined 2015-10-28

PM

Thanks. I did get a reply on the Nordic forum where they suggested the same thing, but also added a call to sd_ant_burst_handler_wait_flag_disable();

I do this after my call to channel close, but was wondering if I should disable the handler first?

Tom      
Rank

Total Posts: 17

Joined 2015-10-28

PM

One additional piece of information, I had to add a function to antfs.c:
void antfs_stop(void)       // TWS, added to provide clean up on stop
{
    state_machine_reset
();

because the timer used by antfs was still running if I called antfs soon after shutting it down and antfs would fail in antfs_init() on the app_timer_create() call.

Tom      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Tom,

Thanks for the feedback, it looks like Nordic is planning to make the ANT-FS reference design more modular in the future as well.

I would close the channel before disabling the handler, as ANT throws a channel close message which the handler could process in the future.

Cheers