• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Bluetooth® Low Energy & ANT Forum » I can't find where the function be executed
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

I can't find where the function be executed

This question is not answered
Weng Jine He
Posted by Weng Jine He
on Aug 03 2012 02:18 AM
Prodigy140 points

I'm a beginner  in CC2540....

In keyfob demo project, I can't find where the function "keyfobapp_HandleKeys" in keyfobdemo.c be executed.

I only see it is defined in keyfobdemo.c.

I use "ctrl+shift+F" to find "keyfobapp_HandleKeys", but I can't find in this project only in keyfobdemo.c.

Could someone tell me the program running sequence?

thanks.

2540
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • kazola
    Posted by kazola
    on Aug 03 2012 09:44 AM
    Guru10665 points

    Hehe, I also asked this in my first steps.

    You can see in the code that the following line is called:

    RegisterForKeys( keyfobapp_TaskID );

    This makes your application to be "aware" of the key events that may come from lower layers.

    In fact, in the keyfobapp_ProcessOSALMsg function, you have code to manage these kind of events that may come (KEY_CHANGE). As you have seen, this calls the function in keyfobdemo.c, which in fact contains the most important code. 

    The main() of the apps "only" contains init functions and several function calls and starts the state machine of the apps. If you need further info, we can give it to you. This is the basics to let you understand or even search on your own :)

    PD: Search for halProcessKeyInterrupt for example! :) Bye!



    Please click the     Verify Answer     button on a post if it answers your question! :)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Weng Jine He
    Posted by Weng Jine He
    on Aug 12 2012 08:22 AM
    Prodigy140 points

    Thanks for your answer .

    After I research  the code again, I still have some problems.

    I can fine the function "keyfobapp_HandleKeys" was executed in function "keyfobapp_ProcessOSALMsg", and function "keyfobapp_ProcessOSALMsg" was executed in function "KeyFobApp_ProcessEvent". But I can't find any function execute or call function "KeyFobApp_ProcessEvent", why?? 

    I'm sure the code in function "keyfobapp_HandleKeys" was executed, when I run the project "KeyFobDemo".

    could somebody can teach me?? thanks :)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • azmat bilal
    Posted by azmat bilal
    on Sep 01 2012 07:59 AM
    Prodigy20 points

    hello, 

    explaining the KeyFobApp_ProcessEvent execution: this function is not called in a direct manner ( like a normal fucntion called in a infinite main loop). instead you will see  a function " osal_start_system()" in the main loop which is executed once. when osal_start_system() is called, its an infinite loop which repeatedly calls "osal_run_system". what "osal_run_system" does is, it looks for functions ( KeyFobApp_ProcessEvent bieng one of the many others in the list) which want to get executed according to thier priority, and here it executes the KeyFobApp_ProcessEvent function. if you study the code for "osal_run_system" you will see that it scans the functions ( based on their taskID ) and looks for a non-zero entery in the array TaskEvents( indicting that task has pending events).

    hope that answers your question.

    Azmat

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use