| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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"
13 event_t isfSysEventHandler;
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{
41 OSA_EventSet(&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 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
uint8
unsigned char uint8
Definition: isf_types.h:76
ISF_SYSTEM_READY_EVENT
#define ISF_SYSTEM_READY_EVENT
Definition of the system ready event.
Definition: isf_init.h:23
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:31
synchCreate
volatile uint8 synchCreate
Definition: isf_init.c:16
FALSE
#define FALSE
Definition: isf_types.h:86
isf_user_config.h
The isf_user_config.h file contains the user configurable settings to either include or exclude an IS...
ci_init
isf_status_t ci_init(void)
This API initializes the Command Interpreter.
Definition: task_ci.c:580
isfSysEventHandler
event_t isfSysEventHandler
Definition: isf_init.c:13
bm_init
isf_status_t bm_init(void)
Bus management initialization .
Definition: bus_management.c:445
ISF_ERR_LIB_INIT
General library initialization failure status.
Definition: isf.h:34
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:76
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. 2016. All Rights Reserved.