ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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) 2015, Freescale Semiconductor, Inc.
8  */
9 
10 #include "isf_user_config.h"
11 #include "isf_init.h"
12 #include "fsl_os_abstraction.h"
14 
15 
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{
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  event_flags_t temp;
53  OSA_EnterCritical(kCriticalDisableInt);
54  if(!synchCreate){
55  uint32_t st = OSA_EventCreate(&isfSysEventHandler, kEventManualClear);
56  if(kStatus_OSA_Success != st){
57  return;
58  }
59  synchCreate = 1;
60  }
61  OSA_ExitCritical(kCriticalDisableInt);
62  // wait for the system ready event.
63  OSA_EventWait(&isfSysEventHandler, ISF_SYSTEM_READY_EVENT, FALSE, OSA_WAIT_FOREVER, &temp);
64 }
65 
66 
67 
unsigned char uint8
Definition: isf_types.h:76
#define ISF_SYSTEM_READY_EVENT
Definition of the system ready event.
Definition: isf_init.h:23
isf_status_t isf_lib_init(void *pOptions)
Please see isf_init.h for complete documentation.
Definition: isf_init.c:18
volatile uint8 synchCreate
Definition: isf_init.c:16
#define FALSE
Definition: isf_types.h:86
The isf_user_config.h file contains the user configurable settings to either include or exclude an IS...
isf_status_t ci_init(void)
This API initializes the Command Interpreter.
Definition: task_ci.c:580
event_t isfSysEventHandler
Definition: isf_init.c:13
isf_status_t bm_init(void)
Bus management initialization .
General library initialization failure status.
Definition: isf.h:34
The isf_init.h file contains the task initialization attributes required for initialization of the fo...
int32 isf_status_t
ISF return status type.
Definition: isf.h:76
void isf_system_sync(void)
This function synchronizes the user tasks and the system initialization.
Definition: isf_init.c:50