LPCtarget/plc_LPC_main.c
changeset 29 86fb7dc2b54e
parent 0 51f5a3138405
child 30 9cd6bc93ed89
equal deleted inserted replaced
28:79ee4178006c 29:86fb7dc2b54e
     1 /**
     1 /**
     2  * Yagarto specific code
     2  * LPC specific code
     3  **/
     3  **/
     4 
     4 
     5 #include <string.h>
     5 #include <string.h>
     6 #include <app_glue.h>
     6 #include <app_glue.h>
     7 
     7 
     8 /* provided by POUS.C */
       
     9 extern unsigned long long common_ticktime__;
       
    10 extern unsigned long __tick;
       
    11 
       
    12 extern unsigned long idLen;
     8 extern unsigned long idLen;
    13 extern unsigned char *idBuf;
     9 extern unsigned char *idBuf;
    14 
    10 
    15 static unsigned char RetainedIdBuf[128] __attribute__((section (".nvolatile")));
    11 static unsigned char RetainedIdBuf[128] NONVOLATILE;
    16 static unsigned char retain_buffer[RETAIN_BUFFER_SIZE] __attribute__((section (".nvolatile")));
    12 static unsigned char retain_buffer[RETAIN_BUFFER_SIZE] NONVOLATILE;
       
    13 
       
    14 #define LOG_BUFFER_SIZE (1<<10) /*1Ko*/
       
    15 #define LOG_BUFFER_ATTRS NONVOLATILE
    17 
    16 
    18 static int debug_locked = 0;
    17 static int debug_locked = 0;
    19 static int _DebugDataAvailable = 0;
    18 static int _DebugDataAvailable = 0;
    20 static unsigned long __debug_tick;
    19 static unsigned long __debug_tick;
    21 
    20 
    45 }
    44 }
    46 
    45 
    47 int startPLC(int argc,char **argv)
    46 int startPLC(int argc,char **argv)
    48 {
    47 {
    49 	if(__init(argc,argv) == 0){
    48 	if(__init(argc,argv) == 0){
    50         /* sign retain buffer */
    49 		PLC_SetTimer(0, Ttick);
    51 		PLC_SetTimer(0, common_ticktime__);
       
    52 		return 0;
    50 		return 0;
    53 	}else{
    51 	}else{
    54 		return 1;
    52 		return 1;
    55 	}
    53 	}
    56 }
    54 }