Bläddra i källkod

解决开机闪屏
解决设置时间重启

guohui 1 år sedan
förälder
incheckning
34a3bce238

+ 1 - 1
output/t113i/pack.sh

@@ -24,7 +24,7 @@ dos2unix -q $SCRIPTS
 cp -f $SRCDIR/root/run/app/pdu_dat.db $SRCDIR/root/run/app/pdu_dat_bak.db
 chmod 777 -R $SRCDIR
 tar -czpf $OUTDIR/$TMP -C $SRCDIR .
-cp -f $OUTDIR/$TMP $OUTDIR/push/
+cp -f $OUTDIR/$TMP $OUTDIR/push2/
 
 #echo merge pdupkg
 $MERG $NUM $STRA $OBJ1 $OBJ2 $OUTDIR/$TMP

+ 1 - 1
output/t113i/pack_dir/etc/init.d/rcS

@@ -46,4 +46,4 @@ if [ ! -f "/usr/lib/libssl.so.1.0.0" ]; then
     ln -s /usr/lib/libssl.so.1.1 /usr/lib/libssl.so.1.0.0
 fi
 
-. /etc/qtenv.sh && Launcher &
+#. /etc/qtenv.sh && Launcher &

+ 27 - 0
output/t113i/push2/pull.bat

@@ -0,0 +1,27 @@
+@ECHO OFF
+
+SET TARGET=/root/run/app/pdu_dat.db
+SET IP=192.168.1.132
+
+SET CURDIR=%~dp0
+SET CURDIR=%CURDIR:~0,-1%
+
+SET  OUTDIR=%CURDIR%
+SET  DEVDIR=/root
+
+SET PSCP=%CURDIR%\tools\pscp 
+SET PLINK=%CURDIR%\tools\plink
+
+SET USR=root
+SET FBAT=%CURDIR%\tools\script.sh
+SET PWD=123456
+
+::pull file
+ECHO  y  | %PSCP%  -r %USR%@%IP%:%TARGET% %OUTDIR%
+IF %ERRORLEVEL% EQU 0 (
+    ECHO pull finished!) 
+ELSE (
+    ECHO pull failed!
+    EXIT /B 1)
+
+

+ 28 - 6
output/t113i/push2/smartPDU.ini

@@ -2,15 +2,37 @@
 id          = "0"
 number      = "Smart PDU"
 name        = "Smart PDU"
-type        = "1"
-pwrtype     = "5"
-language    = "2"
+type = "1"
+pwrtype = "5"
+language = "0"
 samptime    = "30"
 savetime    = "60000"
-ph_group    = "8"
-ch_delay    = "8"
+ph_group = "6"
+ch_delay = "6"
 
 [modbus]
-mode        = "1"
+mode = "0"
 address     = "1"
 baudrate    = "115200"
+
+[ptotal]
+voltage = "400"
+current = "100"
+power = "100"
+brd_max = "10"
+
+[webcfg]
+monway = "2"
+netway = "1"
+nwire = "0"
+ipv4  = "1"
+ipv6  = "1"
+
+[misc]
+watchdog = "1"
+fliptime = "0"
+led = "1"
+beep = "1"
+rotate = "0"
+
+

+ 3 - 3
pro/CMakeLists.txt

@@ -1,10 +1,10 @@
 cmake_minimum_required (VERSION 2.8)
 
-#set(CHIP t113i)
+set(CHIP t113i)
 #set(CHIP t113s)
 
 
-if(${CHIP} STREQUAL "t113i" )
+if("${CHIP}" STREQUAL "t113i" )
 
 # 设置编译器路径
 set(CMAKE_C_COMPILER "arm-linux-gnueabi-gcc")
@@ -153,8 +153,8 @@ add_custom_command(TARGET  smartPDU  POST_BUILD
 
 #execute_process(COMMAND ${DST_DIR}/pack.sh)
 #add_custom_target(PACK COMMAND ${DST_DIR}/pack.sh ALWAYS)
-elseif(${CHIP} STREQUAL "t113s" )
 
+elseif("${CHIP}" STREQUAL "t113s" )
 
 set(CMAKE_C_COMPILER "arm-openwrt-linux-gcc")
 set(CMAKE_CXX_COMPILER "arm-openwrt-linux-g++")

+ 3 - 4
pro/src/common.c

@@ -393,7 +393,7 @@ int set_utctime(time_t t)
 int get_tzone(void)
 {
     int tz = 0;
-#if (CHIP_TYPE == CHIP_T113s)
+#if 1//(CHIP_TYPE == CHIP_T113s)
 
     time_t t1,t2;
     struct tm *tm_local,*tm_utc;
@@ -407,8 +407,8 @@ int get_tzone(void)
     tz = (t1 - t2)/3600;
 #else
     time_t now = time(NULL);
-    struct tm local_time = *localtime(&now);
-    time_t utc = mktime2(&local_time, 0);
+    struct *tm local = *localtime(&now);
+    time_t utc = mktime2(&local, 0);
     tz = (now - utc)/3600;
 #endif
 
@@ -504,7 +504,6 @@ int set_tzone(int tzone)
 #if (CHIP_TYPE == CHIP_T113s)
     sprintf(buf, "ln -sf /usr/share/zoneinfo/GMT%s%d /etc/localtime", (tzone<0)?"+":"-", abs(tzone));
 #else
-
     sprintf(buf, "ln -sf /usr/share/zoneinfo/Etc/GMT%s%d /etc/localtime", (tzone<0)?"+":"-", abs(tzone));
 #endif
 

+ 1 - 0
pro/ui/lcd.c

@@ -84,6 +84,7 @@ static int lcd_hw_init(lcd_handle_t *h)
         LOGE("Error: failed to map framebuffer device to memory\n");
         return -1;
     }
+    memset(h->buf, 0, h->buflen);
 #else
     h->io = gpio_init(DC_GPIO, GPIO_OUT);
     h->buflen = h->width*h->height/8;

+ 5 - 0
pro/ui/menu.c

@@ -93,6 +93,10 @@ static uint64_t get_ms(void)
     gettimeofday(&tv, NULL);
     return (uint64_t)(tv.tv_sec)*1000 + (uint64_t)(tv.tv_usec)/1000;
 }
+static void delay_ms(int ms)
+{
+    usleep(1000*ms);
+}
 static ModbusInfo_t*get_pmb(menu_handle_t *h)
 {
     if(h->menu.menu_lv==0) {
@@ -432,6 +436,7 @@ int menu_init(void)
         h->menu.page[i].item_id = 0;
         h->menu.page[i].item_max = 0;
     }
+
     key_init();
     led_init();
     beep_init();

+ 3 - 3
pub

@@ -21,7 +21,7 @@
 #PRJS="PRJ_TEST_AC_I1_O1"
 #PRJS="PRJ_TEST_AC_I3_O1"
 #PRJS="PRJ_INST2302_DC_OLED"
-#PRJS="PRJ_INST2106_AC_I1_O1_OLED"
+PRJS="PRJ_INST2106_AC_I1_O1_OLED"
 
 #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
 #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
@@ -31,7 +31,7 @@
 #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
 #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
 #PRJS="PRJ_IP_AC_I3_O3"
-PRJS="PRJ_IP_AC_I3_O1"
+#PRJS="PRJ_IP_AC_I3_O1"
 fulldir=$(realpath $0)
 curdir=$(dirname $fulldir)
 
@@ -215,7 +215,7 @@ function do_zip()
         mv $zname.zip $curdir/output/t113s/
     else
         zname="upgrade_"$ztm"_$name"
-        zdir=$curdir/output/t113i/push
+        zdir=$curdir/output/t113i/push2
         files="push.bat pdutar tools/*"
         cd $zdir; zip -q $zname.zip $files
         mv $zname.zip $curdir/output/t113i/