LPCtarget/plc_LPC_main.c
changeset 29 86fb7dc2b54e
parent 0 51f5a3138405
child 30 9cd6bc93ed89
--- a/LPCtarget/plc_LPC_main.c	Wed Mar 13 12:04:18 2013 +0900
+++ b/LPCtarget/plc_LPC_main.c	Tue Mar 19 17:22:27 2013 +0900
@@ -1,19 +1,18 @@
 /**
- * Yagarto specific code
+ * LPC specific code
  **/
 
 #include <string.h>
 #include <app_glue.h>
 
-/* provided by POUS.C */
-extern unsigned long long common_ticktime__;
-extern unsigned long __tick;
-
 extern unsigned long idLen;
 extern unsigned char *idBuf;
 
-static unsigned char RetainedIdBuf[128] __attribute__((section (".nvolatile")));
-static unsigned char retain_buffer[RETAIN_BUFFER_SIZE] __attribute__((section (".nvolatile")));
+static unsigned char RetainedIdBuf[128] NONVOLATILE;
+static unsigned char retain_buffer[RETAIN_BUFFER_SIZE] NONVOLATILE;
+
+#define LOG_BUFFER_SIZE (1<<10) /*1Ko*/
+#define LOG_BUFFER_ATTRS NONVOLATILE
 
 static int debug_locked = 0;
 static int _DebugDataAvailable = 0;
@@ -47,8 +46,7 @@
 int startPLC(int argc,char **argv)
 {
 	if(__init(argc,argv) == 0){
-        /* sign retain buffer */
-		PLC_SetTimer(0, common_ticktime__);
+		PLC_SetTimer(0, Ttick);
 		return 0;
 	}else{
 		return 1;