main.h

Go to the documentation of this file.
00001 
00002 
00003 
00013 
00014 
00015 
00016 #ifndef MAIN_H
00017 
00018     #define     MAIN_H
00019 
00020     #include    <p18f67j60.h>
00021     #include    <string.h>
00022 
00023     #include    "version.h"
00024 
00025     #include    "TCPIP.h"
00026     #include    "output.h"
00027     #include    "appl.h"
00028     #include    "bootup.h"
00029     #include    "input.h"
00030 
00031     #ifdef MAIN_C
00032         #define PROTO
00033     #else
00034         #define PROTO extern
00035     #endif
00036 
00037 //  #define     DEBEXT_MODE
00038 
00039 
00040 
00042 // Fuse settings (This fuses must be the same like in the bootloader!)
00044 
00045     #ifdef MAIN_C
00046         #ifdef __DEBUG
00047             #pragma config DEBUG = ON
00048         #else
00049             #pragma config DEBUG = OFF
00050         #endif      
00051         #pragma config XINST = OFF  // Instruction set extension and Indexed Addressing mode disabled
00052         #pragma config STVR = OFF   // Reset on stack overflow/underflow disabled
00053         #pragma config WDT = OFF    // WDT disabled (control is placed on SWDTEN bit) 
00054         #pragma config CP0 = OFF    // Program memory is not code-protected 
00055         #pragma config FCMEN = OFF  // Fail-Safe Clock Monitor disabled 
00056         #pragma config IESO = OFF   // Two-Speed Start-up disabled  
00057         #pragma config FOSC2 = ON   // Clock selected by FOSC1:FOSC0 as system clock is enabled when OSCCON<1:0> = 00 
00058         #pragma config ETHLED = ON  // RA0/RA1 are multiplexed with LEDA/LEDB when Ethernet module is enabled and function as I/O when Ethernet is disabled
00059         #pragma config FOSC = HSPLL // HSPLL oscillator (eWicht runs with max. speed)  
00060         #pragma config WDTPS = 1    // Watchdog prescaler 1:1
00061     #endif
00062 
00063 
00065 // Global variables
00067 
00068     PROTO WORD u16GlobalFlags;
00069         #define FACRES_MASK         0x0001 // Factory reset requested...
00070         #define SHUTDOWN_MASK       0x0002 // Shut down of eWicht is pending...
00071         #define RESTART_MASK        0x0004 // Restart of eWicht is pending...
00072         #define BOOTLOADER_MASK     0x0008 // Enter boot mode after restart...
00073         #define LINKISUP_MASK       0x0010 // Indicates a up link (stack task execution)
00074 
00075 
00077 // Platform specific information defines
00079 
00080 #define GetSystemClock()        (41666667ul)      // Hz
00081 #define GetInstructionClock()   (GetSystemClock()/4)
00082 #define GetPeripheralClock()    GetInstructionClock()
00083 
00084 #undef PROTO    // #ifndef MAIN_H
00085 
00086 #endif

Generated on Sun Nov 27 20:02:38 2011 for eWicht by  doxygen 1.5.5