Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_rtos.h
Go to the documentation of this file.
1 
60 #ifndef NZ_RTOS_H
61 #define NZ_RTOS_H
62 
64 // "RTOS" - documentation module
66 
96 #if (nzosENABLE==1)
97 
98 
100 #if !defined(nzosHEAP_SIZE)
101 #define nzosHEAP_SIZE ( 2048 )
102 #endif
103 
104 #if !defined(nzosMAIN_INT_PRIORITY)
105 #define nzosMAIN_INT_PRIORITY ( 2 )
106 #endif
107 
108 #if !(nzosMEM1_ENABLE) && !(nzosMEM2_ENABLE) && !(nzosMEM3_ENABLE) && !(nzosMEM4_ENABLE)
109 #define nzosMEM3_ENABLE ( 1 )
110 #endif
111 
112 #if !defined(nzosINT_FOR_RTOS_CUSTOM)
113 #define nzosINT_FOR_RTOS_CUSTOM ( 0 )
114 #endif
115 
116 #if !defined(nzosINCLUDE_PORT_C_FILE)
117 #define nzosINCLUDE_PORT_C_FILE ( 1 )
118 #endif
119 
120 
122 #define NZ_RTOS_SUCCESS ( 0 )
123 #define NZ_RTOS_ERROR ( 0xffff )
124 
125 #define NZ_THR_SUCCESS ( 0 )
126 #define NZ_THR_ERR_CREATE ( 0xffef )
127 
128 #define NZ_FBR_SUCCESS ( 0 )
129 #define NZ_FBR_ERR_CREATE ( 0xffdf )
130 #define NZ_FBR_ERR_LEVEL_FULL ( 0xffde )
131 #define NZ_FBR_ERR_INVALID_LEVEL ( 0xffdd )
132 
134 #if defined(__PIC24F__)
135  #if (nzosINT_FOR_RTOS_CUSTOM==0)
136  //Use I2C1 Slave interrupt
137  #define NZOS_INT_KERNEL_IF (_SI2C1IF)
138  #define NZOS_INT_KERNEL_IE (_SI2C1IE)
139  #define NZOS_INT_KERNEL_IP (_SI2C1IP)
140 
141  #define NZOS_INT_KERNEL_CLEAR_IF() (NZOS_INT_KERNEL_IF=0)
142  #define NZOS_INT_KERNEL_SET_IF() (NZOS_INT_KERNEL_IF=1)
143  #define NZOS_INT_KERNEL_GET_IF() (NZOS_INT_KERNEL_IF)
144  #define NZOS_INT_KERNEL_SET_IP(prty) (NZOS_INT_KERNEL_IP=prty)
145  #define NZOS_INT_KERNEL_GET_IP() (NZOS_INT_KERNEL_IP)
146  #define NZOS_INT_KERNEL_ENABLE() (NZOS_INT_KERNEL_IE = 1)
147  #define NZOS_INT_KERNEL_DISABLE() (NZOS_INT_KERNEL_IE = 0)
148  #define NZOS_INT_KERNEL_GET_INT_ENABLE() (NZOS_INT_KERNEL_IE)
149  #endif
150 #elif defined(__PIC32MX__)
151  #if (nzosINT_FOR_RTOS_CUSTOM==0)
153  //Use Timer 3 interrupt
154  #define NZOS_INT_KERNEL_CLEAR_IF() mT3ClearIntFlag()
155  #define NZOS_INT_KERNEL_SET_IF() (IFS0SET = _IFS0_T3IF_MASK)
156  #define NZOS_INT_KERNEL_GET_IF() mT3GetIntFlag()
157  #define NZOS_INT_KERNEL_SET_IP(prty) mT3SetIntPriority(prty)
158  #define NZOS_INT_KERNEL_GET_IP() mT3GetIntPriority()
159  #define NZOS_INT_KERNEL_ENABLE() mT3IntEnable(1)
160  #define NZOS_INT_KERNEL_DISNABLE() mT3IntEnable(0)
161  #define NZOS_INT_KERNEL_GET_INT_ENABLE() mT3GetIntEnable()
162  #endif
163 #endif
164 
165 
166 #endif //#if (nzosENABLE==1)
167 
168 #endif //#ifndef NZ_RTOS_H