| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_init.c
Go to the documentation of this file.
1 /**
2 * @file isf_init.c
3 *
4 * @brief The \b isf_init.c file contains implementation of the ISF library
5 * initialization functions.
6 *
7 * @copyright Copyright (c) 2012, Freescale Semiconductor, Inc.
8 */
9
10 #include "isf_user_config.h"
11 #include "isf_init.h"
12 #include <mqxlite.h>
13 #include <lwevent.h>
14
15 LWEVENT_STRUCT isfSysEventHandler;
16 volatile uint8 synchCreate = 0;
17 /*! @brief Please see isf_init.h for complete documentation. */
18 isf_status_t isf_lib_init(void *pOptions)
19 {
20
21 isf_status_t status = ISF_SUCCESS;
22
23
24 #if ISF_COMPONENT_BM
25 // Initialize the Bus Manager
26 status |= bm_init();
27 #endif
28 #if ISF_COMPONENT_CI
29 // Initialize the Command Interpreter
30 status |= ci_init();
31 #endif
32 #if ISF_COMPONENT_PM
33 // Initialize the Power Manager
34 status |= pm_init();
35 #endif
36
37 if (status){
38 status = ISF_ERR_LIB_INIT;
39 }
40 else{
41 _lwevent_set(&isfSysEventHandler, ISF_SYSTEM_READY_EVENT);
42 }
43 return status;
44 }
45
46
47 /*!
48 * @brief This function synchronizes the user tasks and the system initialization. */
49
50 void isf_system_sync(void)
51 {
52 _int_disable();
53 if(!synchCreate){
54 _mqx_uint MQX_stat = _lwevent_create(&isfSysEventHandler, FALSE);
55 if(MQX_stat != MQX_OK){
56 return;
57 }
58 synchCreate = 1;
59 }
60 _int_enable();
61 // wait for the system ready event.
62 _lwevent_wait_for(&isfSysEventHandler, ISF_SYSTEM_READY_EVENT, FALSE, NULL);
63 }
64
65
pm_init
isf_status_t pm_init(void)
Definition: pm.c:44
uint8
unsigned char uint8
This defines uint8 as unsigned char.
Definition: isf_types.h:18
ISF_SYSTEM_READY_EVENT
#define ISF_SYSTEM_READY_EVENT
Definition of the system ready event.
Definition: isf_init.h:24
isf_lib_init
isf_status_t isf_lib_init(void *pOptions)
Please see isf_init.h for complete documentation.
Definition: isf_init.c:18
ISF_SUCCESS
Definition: isf.h:33
synchCreate
volatile uint8 synchCreate
Definition: isf_init.c:16
FALSE
#define FALSE
Definition: isf_types.h:56
isf_user_config.h
The isf_user_config.h file contains the user configurable settings to either include or exclude an IS...
isfSysEventHandler
LWEVENT_STRUCT isfSysEventHandler
Definition of the event handle to the system ready event.
Definition: isf_init.c:15
ci_init
isf_status_t ci_init(void)
This API initializes the Command Interpreter.
Definition: task_ci.c:584
bm_init
isf_status_t bm_init(void)
Bus management initialization .
Definition: bus_management.c:409
ISF_ERR_LIB_INIT
General library initialization failure status.
Definition: isf.h:36
isf_init.h
The isf_init.h file contains the task initialization attributes required for initialization of the fo...
isf_status_t
int32 isf_status_t
ISF return status type.
Definition: isf.h:51
isf_system_sync
void isf_system_sync(void)
This function synchronizes the user tasks and the system initialization.
Definition: isf_init.c:50
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.