84 #if (defined(__PIC24F__)) && defined(__C30__) // Microchip C30 compiler
86 #elif defined(__dsPIC33F__) && defined(__C30__) // Microchip C30 compiler
87 #elif defined(__PIC32MX__) // Microchip C32 compiler
89 #error Unknown processor or compiler. See Compiler.h
95 #if !defined(NZ_ADC_DISABLE) && !defined(HAS_NZ_ADC)
98 #if defined(NZ_RTC_ENABLE) && !defined(HAS_NZ_RTC)
101 #if !defined(NZ_PWM_DISABLE) && !defined(HAS_NZ_PWM)
106 #if defined(NZ_UART1_ENABLE) && !defined(HAS_SERPORT_UART1)
107 #define HAS_SERPORT_UART1
109 #if defined(NZ_UART2_ENABLE) && !defined(HAS_SERPORT_UART2)
110 #define HAS_SERPORT_UART2
112 #if defined(NZ_UART3_ENABLE) && !defined(HAS_SERPORT_UART3)
113 #define HAS_SERPORT_UART3
115 #if defined(NZ_UART4_ENABLE) && !defined(HAS_SERPORT_UART4)
116 #define HAS_SERPORT_UART4
118 #if defined(HAS_SERPORT_UART1) || defined(HAS_SERPORT_UART2) || defined(HAS_SERPORT_UART3) || defined(HAS_SERPORT_UART4)
119 #define HAS_SERPORT_UART
123 #if defined(NZ_I2C1_ENABLE) && !defined(HAS_SERPORT_I2C1)
124 #define HAS_SERPORT_I2C1
126 #if defined(NZ_I2C2_ENABLE) && !defined(HAS_SERPORT_I2C2)
127 #define HAS_SERPORT_I2C2
129 #if defined(NZ_I2C3_ENABLE) && !defined(HAS_SERPORT_I2C3)
130 #define HAS_SERPORT_I2C3
132 #if (defined(HAS_SERPORT_I2C1) || defined(HAS_SERPORT_I2C2) || defined(HAS_SERPORT_I2C3))
133 #define HAS_SERPORT_I2C
137 #if defined(NZ_SPI1_ENABLE) && !defined(HAS_SERPORT_SPI1)
138 #define HAS_SERPORT_SPI1
140 #if defined(NZ_SPI2_ENABLE) && !defined(HAS_SERPORT_SPI2)
141 #define HAS_SERPORT_SPI2
143 #if defined(NZ_SPI3_ENABLE) && !defined(HAS_SERPORT_SPI3)
144 #define HAS_SERPORT_SPI3
146 #if (defined(HAS_SERPORT_SPI1) || defined(HAS_SERPORT_SPI2) || defined(HAS_SERPORT_SPI3))
147 #define HAS_SERPORT_SPI
163 #include "../rtos/nz_rtos.h"
164 #include "../rtos/nzos_main.h"
168 #if !defined(__INLINE_FUNCTION__)
169 #define __INLINE_FUNCTION__ extern inline __attribute__((always_inline))
175 #ifndef DEBUG_CONF_DEFAULT
176 #ifdef DEBUG_LEVEL_ALLOFF
177 #define DEBUG_CONF_DEFAULT DEBUG_LEVEL_OFF
179 #define DEBUG_CONF_DEFAULT DEBUG_LEVEL_ERROR
184 #define NZ_MALLOC(size) malloc(size)
187 #if !defined(USER_RAM_SIZE)
189 #define USER_RAM_SIZE 256
192 #define MAIN_LOOP_TOP() \
193 static BOOL inMainLoop=0; \
194 nzSysTaskDefault(); \
195 if (inMainLoop == TRUE) return; \
198 #define MAIN_LOOP_BOTTOM() \
204 #define BUFFER_DUMMY_SIZE 2
205 #define NZ_GLOBALS_SERPORT_DEBUG nzGlobals.serDebug //Pointer to first SERPORT object
206 #define NZ_GLOBALS_SERPORT_FIRST nzGlobals.serUart1 //Pointer to first SERPORT object, EXCLUDING Debug serport!
207 #define NZ_GLOBALS_SERPORT_LAST nzGlobals.serUser8 //Pointer to last SERPORT object
208 #define SERPORT_COUNT (NZ_GLOBALS_SERPORT_LAST - NZ_GLOBALS_SERPORT_FIRST)
213 typedef struct __attribute__((aligned(2), packed))
218 unsigned int bPowerFail : 1;
219 unsigned int bFill : 15;
232 unsigned int main : 1;
233 unsigned int mainApp : 1;
234 unsigned int stackTask : 1;
235 unsigned int serUART : 1;
236 unsigned int serSPI : 1;
237 unsigned int serI2C : 1;
238 unsigned int serUDP : 1;
239 unsigned int serTCP : 1;
240 unsigned int serUSB : 1;
241 unsigned int fl9 : 1;
242 unsigned int fl10 : 1;
243 unsigned int fl11 : 1;
244 unsigned int fl12 : 1;
245 unsigned int fl13 : 1;
246 unsigned int fl14 : 1;
247 unsigned int fl15 : 1;
249 unsigned int app0 : 1;
250 unsigned int app1 : 1;
251 unsigned int app2 : 1;
252 unsigned int app3 : 1;
253 unsigned int app4 : 1;
254 unsigned int app5 : 1;
255 unsigned int app6 : 1;
256 unsigned int app7 : 1;
257 unsigned int app8 : 1;
258 unsigned int app9 : 1;
259 unsigned int app10 : 1;
260 unsigned int app11 : 1;
261 unsigned int app12 : 1;
262 unsigned int app13 : 1;
263 unsigned int app14 : 1;
264 unsigned int app15 : 1;
281 BYTE userRam[USER_RAM_SIZE];
318 #ifndef THIS_IS_NZ_NETCRUZER_C
326 #if !defined(NZSYS_DONT_MANAGE_TICK)
327 #if defined(NZSYS_ENABLE_COMPLEX_TICK)
330 #define NZSYS_ENABLE_TICK
332 #endif //#ifndef NZSYS_DONT_MANAGE_TICK
342 #if defined(NZ_USBHID_ENABLE)
343 #if !defined(HAS_SERPORT_USB_HID)
344 #define HAS_SERPORT_USB_HID
346 #if !defined(USB_IS_HID)
350 #if defined(NZ_USBCDC_ENABLE)
351 #if !defined(HAS_SERPORT_USB_CDC)
352 #define HAS_SERPORT_USB_CDC
354 #if !defined(USB_IS_CDC)
358 #if defined(NZ_USBMIDI_ENABLE)
359 #if !defined(HAS_SERPORT_USB_MIDI)
360 #define HAS_SERPORT_USB_MIDI
362 #if !defined(USB_IS_MIDI)
366 #if defined(HAS_SERPORT_USB_HID) || defined(HAS_SERPORT_USB_CDC) || defined(HAS_SERPORT_USB_MIDI)
367 #if !defined(HAS_A_SERPORT)
368 #define HAS_A_SERPORT
370 #if !defined(HAS_SERPORT_USB)
371 #define HAS_SERPORT_USB
381 #if defined(NZ_USBHID_DEBUG_ENABLE) && !defined(HAS_USBHID_DEBUGGING)
382 #define HAS_USBHID_DEBUGGING
384 #if defined(NZ_USBCDC_DEBUG_ENABLE) && !defined(HAS_USBCDC_DEBUGGING)
385 #define HAS_USBCDC_DEBUGGING
387 #if defined(NZ_UART1_DEBUG_ENABLE) && !defined(HAS_UART1_DEBUGGING)
388 #define HAS_UART1_DEBUGGING
390 #if defined(NZ_USBHID_DEBUG_ENABLE) || defined(NZ_USBCDC_DEBUG_ENABLE) || defined(NZ_UART1_DEBUG_ENABLE)
391 #define HAS_NZ_DEBUGGING
393 #if !defined(NZSYS_DONT_MANAGE_DEBUG) && defined(HAS_NZ_DEBUGGING)
394 #define NZSYS_MANAGE_DEBUG
410 #if defined(NZSYS_CALL_INITIALIZE_BOARD)
411 void initializeBoard(
void);
414 #if defined(NZSYS_CALL_APPCONF_FUNCTIONS)
415 void cfgInit(BYTE* pCfgStruct);
416 void appConfInit(
void);
450 #define USER_RAM_WORD(adr) (*((WORD*)(&nzGlobals.userRam[adr])))
462 #define USER_RAM_BYTE(adr) (nzGlobals.userRam[adr])
465 #if !defined(DOXY_FUNC) //Don't document in doxygen
467 #define nzsysInitDefault() nzSysInitDefault()
469 #define nzsysTaskDefault() nzSysTaskDefault()
471 #define nzsysGlobalInit() nzSysGlobalInit()
475 #endif //#ifndef NETCRUZER_H