diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/README.md b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/README.md
new file mode 100644
index 00000000..95d51837
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/README.md
@@ -0,0 +1,139 @@
+# Anti-lost security detection system
+
+The portable outdoor travel equipment designed by us is based on sensors to collect motion information, intelligently discriminate, realize abnormal posture recognition, and can detect the distance with the guardian in real time through combined positioning to ensure the safety of the user. Compared with the machine vision-based gesture recognition method, it has the advantages of fast speed, good real-time performance and convenient carrying.
+
+
+- [Introduction](#introduction)
+ - [Function](#function)
+ - [System Architecture](#system-architecture)
+- [Hardware and Software Setup](#hardware-and-software-setup)
+ - [Required Hardware](#required-hardware)
+ - [Required Software](#required-software)
+ - [Hardware Connection](#hardware-connection)
+- [User Manual](#user-manual)
+ - [Before Running This Application](#before-running-this-application)
+ - [Run This Application](#run-this-application)
+- [Demo Video](#demo-video)
+
+
+# Introduction
+The intelligent monitoring device performs intelligent discrimination based on the sensor to collect motion information, and realizes abnormal posture recognition.
+## Function
+ - **Shedding check mode**
+ The buzzer sounds an alarm when the sensor comes off.
+
+ 
+ - **Posture detection mode**
+ The device can detect abnormal conditions such as human fall and being picked up.
+
+ 
+ 
+ - **GPS mode**
+ When the user exceeds the safe distance, the location information can be sent to the guardian's mobile phone.
+
+ 
+ - **Wisdom broadcast mode**
+ When the user is lost, the voice mode can be switched with one button for playing the user's family information.
+
+ 
+## System Architecture
+ As shown in the figure below, the system consists of **three parts: input, master, and output**.
+ - The **input** includes a Bluetooth module, a GPS module and a JY901 nine-axis sensor module. The Bluetooth module receives the connection signal and sends it to the ARC processor; The JY901 module is responsible for detecting the motion state, The module mainly detects the acceleration change during motion and relative to the horizontal direction of the deflection condition; the GPS module is responsible for locating the user's location information and sending it to the master.
+ - The **master** is composed of an ARC processor. It mainly complete the processing of the data and complete the matching with the database according to the algorithm, and send the corresponding command to the output, the data processing includes through personalized calibration. Different people's movements have their own characteristics. Through personalized calibration, a database with posture characteristic information is established, which makes the system suitable for different users, and the user can customize according to individual usage.
+ - The **output** includes a voice synthesis module and a GPRS module. When the user exceeds the safety distance, the position information acquired by the GPS can be sent to the guardian mobile phone through the GPRS module to realize quick rescue and real-time positioning, and the family information can be reproduced in the form of voice. Convenient and timely contact with the guardian.
+ 
+# Hardware and Software Setup
+## Required Hardware
+ - 1 DesignWare ARC EM Starter Kit(EMSK)
+ - 1 Posture sensor(JY-901)
+ - 1 Voice composite module(SYN6288)
+ - 1 Bluetooth module(E104-BT02)
+ - 1 GPS module(C3-470A)
+ - 1 GPRS module(SIM900A)
+ - 1 Buzzer
+ - 1 SD Card
+
+## Required Software
+ - ARC GNU Toolset
+ - Serial port terminal, such as putty, tera-term or minicom
+
+## Hardware Connection
+ 1. The EMSK implement smart gloves,it will processe the data collected by sensors and translate gestures to corresponding sign language, we can get the corresponding sign language information by displaying text and making voice.
+ - Connect **Posture sensor** to **J1**(Using UART interface)
+ - Connect **Voice composite module** and **GPRS module** to **J2**(Using I2C interface)
+ - Connect **GPS module** to **J5**(Using UART interface)
+ - Connect **Buzzer** to **J3**(Using GPIO interface)
+ - Connect **Bluetooth module** to **J4**(Using I2C interface)
+ 2. Configure your EMSKs with proper core configuration
+ - EMSK connection
+ 
+
+# User Manual
+## Before Running This Application
+ Download source code of Anti-lost security detection system based on ARC processor from github.
+ - The hardware resources are allocated as following table.
+
+| Hardware Resource | Functioon |
+| ------------------ | ----------------------------- |
+| JY-901 | Acceleration and angle sensor |
+| E104-BT02 | Indoor Positioning |
+| SYN6288 | Voice composite |
+| C3-470A | position |
+| SIM900A | send messages |
+
+## Run This Application
+ Here take EMSK2.0 - ARC EM7D with GNU Toolset for example to show how to run this application.We need to use embARC bootloader to automatically load application binary for different EMSK and run. See embARC Secondary Bootloader Example for reference.
+ * Modify emsk_init.c (/board/emsk/common/emsk_init.c)
+ ```
+line 107: change
+ set_pmod_mux(mux_regs, PM1_UR_UART_0 | PM1_LR_SPI_S \
+ | PM2_I2C_HRI \
+ | PM3_GPIO_AC \
+ | PM4_I2C_GPIO_D \
+ | PM5_UR_SPI_M1 | PM5_LR_GPIO_A \
+ | PM6_UR_SPI_M0 | PM6_LR_GPIO_A );
+ to
+ set_pmod_mux(mux_regs, PM1_UR_UART_0 | PM1_LR_GPIO_A \
+ | PM2_I2C_HRI \
+ | PM3_GPIO_AC \
+ | PM4_I2C_GPIO_D \
+ | PM5_UR_SPI_M1 |PM5_LR_SPI_M2 \
+ | PM6_UR_SPI_M0 | PM6_LR_GPIO_A );
+```
+### Makefile
+ - Target options about EMSK and toolchain
+
+```
+ BOARD ?= emsk
+ BD_VER ?= 22
+ CUR_CORE ?= arcem7d
+ TOOLCHAIN ?= gnu
+```
+ - The relative series of the root directory, here the path of the Makefile is
+```
+ #
+ # root dir of embARC
+ #
+ EMBARC_ROOT = ../../..
+ MID_SEL = common
+```
+ See [ embARC Example User Guide][40], "Options to Hard-Code in the Application Makefile" for more detailed information about Makefile Options
+
+ - Driver
+ Placing the drivers' source code in driver folder, you can see there are subfolders for data,buletooth,buzzer,gps and gprs drivers. Placing the C source file and header file in the corresponding subfolder.
+
+| folder/file | Function |
+| ---------------- | --------------------------------------------------------- |
+| data | get and deal with data from sensor |
+| buletooth | Receive a connection signal and send it to the processor |
+| gprs | send position information |
+| buzzer | Sensor drop alarm |
+| gps | Detect location information |
+
+# Demo Video
+[Link](https://v.youku.com/v_show/id_XNDI4NjQ0NTQxMg==.html?spm=a2h3j.8428770.3416059.1)
+
+
+[40]: http://embarc.org/embarc_osp/doc/embARC_Document/html/page_example.html " embARC Example User Guide"
+
+
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Architecture.png b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Architecture.png
new file mode 100644
index 00000000..145dc914
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Architecture.png differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/GPS mode.gif b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/GPS mode.gif
new file mode 100644
index 00000000..2b566e8e
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/GPS mode.gif differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_1.gif b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_1.gif
new file mode 100644
index 00000000..6fb09f33
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_1.gif differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_2.gif b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_2.gif
new file mode 100644
index 00000000..3a97b9a8
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Posture detection_2.gif differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Shedding check.gif b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Shedding check.gif
new file mode 100644
index 00000000..a371d25a
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Shedding check.gif differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Wisdom broadcast.gif b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Wisdom broadcast.gif
new file mode 100644
index 00000000..ab6fcfd4
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/Wisdom broadcast.gif differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/connection.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/connection.jpg
new file mode 100644
index 00000000..ebf9e24e
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/Screenshots/connection.jpg differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.c
new file mode 100644
index 00000000..9509c079
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.c
@@ -0,0 +1,71 @@
+/* ------------------------------------------
+ * \version 2016-01
+ * \date 2019-05-20
+ * \author Jinyu Yang
+ * \function蓝牙定位模块
+--------------------------------------------- */
+#include
+#include "embARC_debug.h"
+#include "embARC_toolchain.h"
+#include "embARC_error.h"
+#include "board.h"
+#include "dev_uart.h"
+#include
+#include "dev_iic.h"
+#define I2C_SLAVE_ADDR2 0x02
+DEV_IIC *dev_iicble=NULL;
+
+//DEV_UART *dev_uart2 = NULL;
+static void delay_ms(volatile int z) //1ms
+{
+ volatile uint32_t x,y;
+ for(x=1400;x>0;x--)
+ for(y=z;y>0;y--);
+}
+int ble_comeback(char re_buf[15])
+{
+ int ble_state;
+ if (re_buf[0]=='<')
+ if(re_buf[1]=='C')
+ ble_state=2;
+ else
+ ble_state=1;
+ return ble_state;
+}
+
+ int ble(void)
+ {
+ char rcv_buf[15];
+ uint32_t rcv_cnt;
+ uint32_t rd_avail;
+ uint32_t baudrate =19200;//bt02
+ int8_t *cmd={""};
+ int8_t *cmdbk={""};
+ int8_t state;
+ unsigned int i;
+
+
+ dev_iicble = iic_get_dev(DW_IIC_1_ID );
+ dev_iicble->iic_open(DEV_MASTER_MODE, IIC_SPEED_STANDARD);
+ dev_iicble->iic_control(IIC_CMD_MST_SET_TAR_ADDR, CONV2VOID(I2C_SLAVE_ADDR2));
+ delay_ms(200);
+ // blue init
+ for(i=0;i<2;i++)
+ {
+ dev_iicble->iic_write(cmd,strlen(cmd));
+ dev_iicble->iic_read(rcv_buf, 15);
+
+ state=ble_comeback(rcv_buf);
+
+ EMBARC_PRINTF("data is %s\r\n",rcv_buf);
+ EMBARC_PRINTF("state is %d\r\n",state);
+ //EMBARC_PRINTF("i is %d\r\n",i);
+
+
+ delay_ms(10);
+ }
+
+ return state;
+ }
+
+
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.h b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.h
new file mode 100644
index 00000000..b3f79e1c
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/bluetooth/ble.h
@@ -0,0 +1,4 @@
+#ifndef _BLE_H_
+#define _BLE_H_
+extern int ble(void);
+#endif /* _BLE_H_ */
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.c
new file mode 100644
index 00000000..76cf59c6
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.c
@@ -0,0 +1,30 @@
+#include "embARC.h"
+#include "embARC_debug.h"
+#include "stdio.h"
+#include "arc.h"
+DEV_GPIO_PTR port_alarm;
+
+
+static void delay_ms(volatile int z) //1ms
+{
+ volatile uint32_t x,y;
+ for(x=1400;x>0;x--)
+ for(y=z;y>0;y--);
+}
+
+void beep(void)
+{
+
+
+ port_alarm = gpio_get_dev(DW_GPIO_PORT_A);
+ port_alarm->gpio_open(0x10000);
+ port_alarm->gpio_control(GPIO_CMD_SET_BIT_DIR_OUTPUT, (void *)0x10000);
+
+
+ port_alarm->gpio_write(0x00000, 0x10000);
+ delay_ms(8000);
+ port_alarm->gpio_write(0x10000, 0x10000);
+ delay_ms(11000);
+ EMBARC_PRINTF("beep \r\n");
+
+}
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.h b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.h
new file mode 100644
index 00000000..6ce81264
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/buzzer/buzzer.h
@@ -0,0 +1,7 @@
+#ifndef _BUZZER_H_
+#define _BUZZER_H_
+
+extern void beep(void);
+static void delay_ms(volatile int z);
+
+#endif /* _BUZZER_H_ */
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.c
new file mode 100644
index 00000000..d0989279
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.c
@@ -0,0 +1,116 @@
+/* ------------------------------------------
+ * \version 2016-01
+ * \date 2019-05-20
+ * \author Renjie Cao
+ * \functionJY901模块
+--------------------------------------------- */
+#include "embARC.h"
+#include "embARC_debug.h"
+#include "embARC_toolchain.h"
+#include "embARC_error.h"
+#include "board.h"
+#include "dev_uart.h"
+
+
+
+unsigned char ucStra[6],ucStrw[6],ucStrAngle[6];
+double aValue[3];
+double wValue[3];
+double AValue[3];
+DEV_UART *dev_uart0 = NULL;
+
+void mpu6050_isr(unsigned char ucstra[6] ,unsigned char ucStrw[6],unsigned char ucStrAngle[6],uint8_t Re_buf[33])
+{
+ if(Re_buf[0]!=0x55) return; //第0号数据不是帧头
+ //重新赋值,准备下一帧数据的接收
+ switch(Re_buf [1])
+ {
+ case 0x51:
+ ucStra[0]=Re_buf[2];
+ ucStra[1]=Re_buf[3];
+ ucStra[2]=Re_buf[4];
+ ucStra[3]=Re_buf[5];
+ ucStra[4]=Re_buf[6];
+ ucStra[5]=Re_buf[7];
+ break;
+ }
+
+ switch(Re_buf [12])
+ {
+ case 0x52:
+ ucStrw[0]=Re_buf[13];
+ ucStrw[1]=Re_buf[14];
+ ucStrw[2]=Re_buf[15];
+ ucStrw[3]=Re_buf[16];
+ ucStrw[4]=Re_buf[17];
+ ucStrw[5]=Re_buf[18];
+ break;
+ }
+ switch(Re_buf [23])
+ {
+ case 0x53:
+ ucStrAngle[0]=Re_buf[24];
+ ucStrAngle[1]=Re_buf[25];
+ ucStrAngle[2]=Re_buf[26];
+ ucStrAngle[3]=Re_buf[27];
+ ucStrAngle[4]=Re_buf[28];
+ ucStrAngle[5]=Re_buf[29];
+ break;
+ }
+
+}
+
+
+static void delay_ms(volatile int z) //1ms
+{
+ volatile uint32_t x,y;
+ for(x=1400;x>0;x--)
+ for(y=z;y>0;y--);
+}
+
+void data0(double aValue[3],double wValue[3],double AValue[3],double *Z1,double *AWM,double *A1,double *A2)
+{
+ uint8_t rcv_buf[33];
+ unsigned int j;
+ uint32_t rcv_cnt;
+ uint32_t baudrate =230400 ;
+ uint32_t rd_avail = 0;
+
+ dev_uart0 = uart_get_dev(DW_UART_0_ID);
+ dev_uart0->uart_open(baudrate);
+ dev_uart0->uart_control(UART_CMD_GET_RXAVAIL, (void *)(&rd_avail));
+
+ if(rd_avail > 0){
+ rcv_cnt = dev_uart0->uart_read(rcv_buf, rd_avail);
+ if (rcv_cnt) {
+ mpu6050_isr(ucStra,ucStrw,ucStrAngle,rcv_buf);
+ aValue[0] = ((short)(ucStra[1]<<8| ucStra[0]))/32768.0*16;
+ aValue[1] = ((short)(ucStra[3]<<8| ucStra[2]))/32768.0*16;
+ aValue[2] = ((short)(ucStra[5]<<8| ucStra[4]))/32768.0*16;
+ printf("{%4.3f,%4.3f,%4.3f,",aValue[0],aValue[1],aValue[2]);
+
+ *Z1 = aValue[2];
+ *AWM = aValue[0]*aValue[0]+aValue[1]*aValue[1]+aValue[2]*aValue[2];
+ printf("AWM:%4.3f,",*AWM);
+
+ wValue[0] = ((short)(ucStrw[1]<<8| ucStrw[0]))/32768.0*2000;
+ wValue[1] = ((short)(ucStrw[3]<<8| ucStrw[2]))/32768.0*2000;
+ wValue[2] = ((short)(ucStrw[5]<<8| ucStrw[4]))/32768.0*2000;
+ //printf("%4.3f,%4.3f,%4.3f,",wValue[0],wValue[1],wValue[2]);
+
+ AValue[0] = ((short)(ucStrAngle[1]<<8| ucStrAngle[0]))/32768.0*180;
+ AValue[1] = ((short)(ucStrAngle[3]<<8| ucStrAngle[2]))/32768.0*180;
+ AValue[2] = ((short)(ucStrAngle[5]<<8| ucStrAngle[4]))/32768.0*180;
+ // printf("%4.2f,%4.2f,%4.2f},\r\n",AValue[0],AValue[1],AValue[2]);
+ *A1=AValue[0];
+ *A2=AValue[1];
+ printf("A1:%4.3f,",*A1);
+ printf("A2:%4.3f,\r\n",*A2);
+ }
+ }
+}
+
+
+
+
+
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.h b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.h
new file mode 100644
index 00000000..2efbe757
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/data/data.h
@@ -0,0 +1,4 @@
+#ifndef _DATA_H_
+#define _DATA_H_
+extern void data0(double aValue[3],double wValue[3],double AValue[3],double *Z1,double *AWM,double *A1,double *A2);
+#endif /* _DATA_H_ */
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.c
new file mode 100644
index 00000000..e8112188
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.c
@@ -0,0 +1,81 @@
+/* ------------------------------------------
+ * \version 2016-01
+ * \date 2019-05-20
+ * \author Chaoyang Wang
+ * \functionGPRS模块
+--------------------------------------------- */
+#include "embARC.h"
+#include "embARC_debug.h"
+#include "stdio.h"
+#include
+#include "arc.h"
+#define I2C_SLAVE_ADDR3 0x03
+DEV_IIC *dev_iic_gprs=NULL;
+
+//uint8_t *phoneNum = "00310035003000300032003900380036003400360036";
+//uint8_t *msg = "4E3B4EBAFF0C4E3B4EBAFF0C621189818DDF4E224F604E86";
+
+static void delay_ms(volatile int z) //1ms
+{
+ volatile uint32_t x,y;
+ for(x=1400;x>0;x--)
+ for(y=z;y>0;y--);
+}
+
+void call(void)
+{
+
+ dev_iic_gprs = iic_get_dev(DW_IIC_0_ID);
+ dev_iic_gprs->iic_open(DEV_MASTER_MODE, IIC_SPEED_STANDARD);
+ dev_iic_gprs->iic_control(IIC_CMD_MST_SET_TAR_ADDR, CONV2VOID(I2C_SLAVE_ADDR3));
+ uint8_t i;
+
+ //int8_t *cmd[2]={"ATD13772407849;\r\n",};
+ int8_t *cmd[2]={"ATD15002986466;\r\n",};
+ //while(1){
+ for(i = 0; i < 4; i++)
+ {
+ dev_iic_gprs->iic_write(cmd[i], strlen(cmd[i]));
+ delay_ms(100);
+ }
+ uint8_t end[]={0x1a,0x00};
+ dev_iic_gprs->iic_write(end, strlen(end));
+ printf("end call\r\n");
+ //}
+ // return E_SYS;
+
+}
+
+void send(uint8_t *phoneNum, uint8_t *msg)
+{
+
+
+ dev_iic_gprs = iic_get_dev(DW_IIC_0_ID );
+ dev_iic_gprs->iic_open(DEV_MASTER_MODE, IIC_SPEED_STANDARD);
+ dev_iic_gprs->iic_control(IIC_CMD_MST_SET_TAR_ADDR, CONV2VOID(I2C_SLAVE_ADDR3));
+
+ uint8_t i;
+ uint8_t pnum[64];
+ int8_t *cmd[5]={"AT+CMGF=1\r\n", "AT+CSCS=\"UCS2\"\r\n",
+ "AT+CSCA?\r\n", "AT+CSMP=17,167,0,25\r\n",};
+ snprintf(pnum, 64, "AT+CMGS=\"%s\"\r\n",phoneNum);
+ //snprintf(pnum, 64, "AT+CMGS=\"%s\"\r\n","00310035003000300032003900380036003400360036");
+ //while(1){
+ for(i = 0; i < 4; i++)
+ {
+ dev_iic_gprs->iic_write(cmd[i], strlen(cmd[i]));
+ delay_ms(260);
+ }
+ dev_iic_gprs->iic_write(pnum, strlen(pnum));
+ delay_ms(260);
+
+ dev_iic_gprs->iic_write(msg, strlen(msg));
+// dev_iic_gprs->iic_write("4E3B4EBAFF0C4E3B4EBAFF0C621189818DDF4E224F604E86", strlen("4E3B4EBAFF0C4E3B4EBAFF0C621189818DDF4E224F604E86"));
+// delay_ms(500);
+
+ uint8_t end[]={0x1a,0x00};
+ dev_iic_gprs->iic_write(end, strlen(end));
+
+ printf("完成短信发送\r\n");
+ //}
+}
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.h b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.h
new file mode 100644
index 00000000..782835c8
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gprs/GPRS.h
@@ -0,0 +1,8 @@
+#ifndef _GPRS_H_
+#define _GPRS_H_
+
+static void delay_ms(volatile int z);
+extern void call(void);
+extern void send(uint8_t *phoneNum, uint8_t *msg);
+
+#endif /* _GPRS_H_ */
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.c
new file mode 100644
index 00000000..ec3ec9b8
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.c
@@ -0,0 +1,422 @@
+/* ------------------------------------------
+ * \version 2016-01
+ * \date 2019-05-20
+ * \author Jinyu Yang
+ * \functionGPS定位模块
+--------------------------------------------- */
+#include "arc.h"
+#include "arc_builtin.h"
+#include
+#include
+#include
+#include
+#include "embARC.h"
+#include "embARC_debug.h"
+#include "embARC_toolchain.h"
+#include "embARC_error.h"
+#include "board.h"
+#include "dev_uart.h"
+#include "dev_iic.h"
+#define I2C_SLAVE_ADDR3 0x03
+DEV_IIC *dev_iic2=NULL;
+uint8_t *phoneNumber = "15002986466";
+
+//static GPS_Information GPS;
+//static UTC_Time_Date UTC;
+//static Latitude Lati;
+//static Longitude Long;
+
+uint8_t DH_id_sep[20]; //全局变量数组,最多处理20个逗号索引
+
+
+
+struct GPS_Information
+{
+ uint8_t Located; //定位有效位
+ uint8_t UTC_Time[7]; //时间
+ uint8_t UTC_Date[7]; //日期
+ char Latitude[11]; //纬度
+ uint8_t NS_Indicator; //N=北半球,S=南半球
+ char Longitude[12]; //经度
+ uint8_t EW_Indicator; //E=东经,W=西经
+ uint8_t Speed[7]; //地面速率
+ uint8_t Course[7]; //地面航向
+ uint8_t MSL_Altitude[7]; //MSL海拔高度
+ uint8_t Use_EPH_Sum[2]; //使用的卫星数量
+ char lat_long[100]; //换算后的经纬度
+}*GPS;
+
+struct UTC_Time_Date
+{
+ uint8_t year; //年份
+ uint8_t month; //月份
+ uint8_t date; //日期
+ uint8_t hour; //小时
+ uint8_t min; //分钟
+ uint8_t sec; //秒钟
+}*UTC;
+
+struct Latitude
+{
+ uint8_t du; //度
+ uint8_t fen; //分
+ uint8_t miao; //秒
+}*Lati;
+
+struct Longitude
+{
+ uint8_t du; //度
+ uint8_t fen; //分
+ uint8_t miao; //秒
+}*Long;
+
+
+
+
+
+
+static void delay_ms(volatile uint32_t z)//延时函数,单位是ms
+{
+ volatile uint32_t x,y;
+ for (x = 1400 ;x > 0; x --)
+ for (y = z ;y > 0; y --);
+}
+
+void Creat_DH_Index(uint8_t k ,int8_t* buffer ) //存储一帧数据中每个逗号的地址
+{
+ uint8_t i;
+ uint8_t idj = 0;
+ for ( i = 0;i < k;i++ )
+ {
+ if ( buffer[i] == ',' )
+ {
+ DH_id_sep[idj] = i;
+ idj++;
+ }
+ }
+}
+
+int8_t* Real_Process_DH( int8_t* buffer, uint8_t num ) //返回第num个参数第一位数据的地址
+{
+ if ( num < 1 )
+ return &buffer[0];
+ else
+ return &buffer[ DH_id_sep[num - 1] + 1];
+}
+
+void Real_GPS_Command_Process(uint8_t k, char *data )
+{
+ char *rd_pt;
+ uint8_t i,t;
+
+ for(i=0;i= '0' ) && ( *rd_pt <= '9' ) )//内容是数字0到9
+ {
+ for(t=0;t<6;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->UTC_Time[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->UTC_Time[t] = '\0';
+// EMBARC_PRINTF("GPS->UTC_Time=%s\r\n",GPS->UTC_Time);
+ // printf("GPS->UTC_Time=%s\r\n",GPS->UTC_Time);
+ }
+
+ /* rd_pt = Real_Process_DH( data, 2 );//第2个参数,定位是否有效
+ if ( *rd_pt == 'A' )
+ {
+ GPS->Located = *rd_pt;//有效定位
+// EMBARC_PRINTF("GPS->Located=%c\r\n",GPS->Located);
+ }
+ else
+ {
+ GPS->Located = 0; //无效定位
+ break; //退出数据处理,重新接收收据
+ } */
+
+ rd_pt = Real_Process_DH( data, 2 ); //第3个参数为纬度
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<9;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->Latitude[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->Latitude[t] = '\0';
+ printf("GPS->Latitude=%s\r\n",GPS->Latitude);
+ }
+
+ rd_pt = Real_Process_DH( data, 3 ); //第4个参数为纬度半球,北纬或南纬
+ if ( ( *rd_pt == 'N' ) || ( *rd_pt == 'S' ) )
+ {
+ GPS->NS_Indicator = *rd_pt;
+ EMBARC_PRINTF("GPS->NS_Indicator=%c\r\n",GPS->NS_Indicator);
+ }
+
+ rd_pt = Real_Process_DH( data, 4 ); //第5个参数为经度
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<9;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->Longitude[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->Longitude[t] = '\0';
+ EMBARC_PRINTF("GPS->Longitude=%s\r\n",GPS->Longitude);
+ }
+
+ rd_pt = Real_Process_DH( data, 5 ); //第6个参数为经度半球,东经或西经
+ if ( ( *rd_pt == 'E' ) || ( *rd_pt == 'W' ) )
+ {
+ GPS->EW_Indicator = *rd_pt;
+ EMBARC_PRINTF("GPS->EW_Indicator=%c\r\n",GPS->EW_Indicator);
+ }
+
+ rd_pt = Real_Process_DH( data, 7 ); //第7个参数为地面速率
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<7;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->Speed[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->Speed[t] = '\0';
+ EMBARC_PRINTF("GPS->Speed=%s\r\n",GPS->Speed);
+ }
+
+ rd_pt = Real_Process_DH( data, 8 ); //第8个参数为地面航向
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<7;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->Course[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->Course[t] = '\0';
+ EMBARC_PRINTF("GPS->Course=%s\r\n",GPS->Course);
+ }
+
+ rd_pt = Real_Process_DH( data, 9 ); //第9个参数为UTC时间,日月年
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<6;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->UTC_Date[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->UTC_Date[t] = '\0';
+ EMBARC_PRINTF("GPS->UTC_Date=%s\r\n",GPS->UTC_Date);
+ }
+
+ //if ( ( data[3] == 'G' ) && ( data[4] == 'A' )) //$GPGGA
+
+ rd_pt = Real_Process_DH( data, 7 ); //第7个参数为正在使用的用于定位的卫星数量
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<2;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->Use_EPH_Sum[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->Use_EPH_Sum[t] = '\0';
+ EMBARC_PRINTF("GPS->Use_EPH_Sum=%s\r\n",GPS->Use_EPH_Sum);
+ }
+
+ rd_pt = Real_Process_DH( data, 9 ); //第9个参数为海拔高度
+ if ( ( *rd_pt >= '0' ) && ( *rd_pt <= '9' ) )
+ {
+ for(t=0;t<6;t++)
+ {
+ if( *rd_pt == ',' ) break;
+ GPS->MSL_Altitude[t] = *rd_pt;
+ rd_pt++;
+ }
+ GPS->MSL_Altitude[t] = '\0';
+ EMBARC_PRINTF("GPS->MSL_Altitude=%s\r\n",GPS->MSL_Altitude);
+ }
+
+
+ }
+}
+
+
+
+uint8_t Calc_GPS_Sum( const int8_t* Buffer )
+{
+ uint8_t i, j, k, sum;
+ sum = 0;
+
+ for ( i = 0; i < 100; i++ ) //i从1开始是闪过$开始符
+ {
+ if ( Buffer[i] != '*' ) //判断结束符
+ sum ^= Buffer[i]; //GPS校验和算法为XOR
+ else
+ break;
+ }
+
+ j = Buffer[i + 1]; //取结束符后两位字符
+ k = Buffer[i + 2]; //取结束符后两位字符
+
+ if ( isalpha( j ) ) //判断字符是否为英文字母,为英文字母时返回非零值,否则返回零
+ {
+ if ( isupper( j ) ) //判断字符为大写英文字母时,返回非零值,否则返回零
+ j -= 0x37;//强制转换为16进制
+ else
+ j -= 0x57;//强制转换为16进制
+ }
+ else
+ {
+ if ( ( j >= 0x30 ) && ( j <= 0x39 ) )
+ j -= 0x30;//强制转换为16进制
+ }
+
+ if ( isalpha( k ) ) //判断字符是否为英文字母,为英文字母时返回非零值,否则返回零
+ {
+ if ( isupper( k ) ) //判断字符为大写英文字母时,返回非零值,否则返回零
+ k -= 0x37;//强制转换为16进制
+ else
+ k -= 0x57;//强制转换为16进制
+ }
+ else
+ {
+ if ( ( k >= 0x30 ) && ( k <= 0x39 ) )
+ k -= 0x30;//强制转换为16进制
+ }
+
+ j = ( j << 4 ) + k; //强制合并为16进制
+
+ if ( sum == j )
+ return 1; //校验和正常
+ else
+ return 0; //校验和错误
+}
+
+double resolve(char *buf)
+{
+ double t;
+ int d;
+ t=atof(buf);
+ d=(int)(t/100);
+ t=d+(t-d*100)/60;
+ return t;
+}
+
+
+void sendGPS(uint8_t *phoneNumber, uint8_t *msg)
+{
+ dev_iic2 = iic_get_dev(DW_IIC_0_ID );
+ dev_iic2->iic_open(DEV_MASTER_MODE, IIC_SPEED_STANDARD);
+ dev_iic2->iic_control(IIC_CMD_MST_SET_TAR_ADDR, CONV2VOID(I2C_SLAVE_ADDR3));
+ //uint32_t baudrate = 115200;
+ //dev_uart0 = uart_get_dev(DW_UART_0_ID);
+ //dev_uart0-> uart_open(baudrate);
+
+ uint8_t i;
+ uint8_t pnum[64];
+ int8_t *cmd[5]={"AT+CMGF=1\r\n", "AT+CSCS=\"GSM\"\r\n",
+ "AT+CSCA?\r\n", "AT+CSMP=17,167,0,240\r\n",
+ };
+ snprintf(pnum, 64, "AT+CMGS=\"%s\"\r\n", phoneNumber);
+ for(i = 0; i < 4; i++)
+ {
+ dev_iic2->iic_write(cmd[i], strlen(cmd[i]));
+ // printf("cmd\r\n");
+ delay_ms(1000);
+ }
+ dev_iic2->iic_write(pnum, strlen(pnum));
+ //printf("pnum\r\n");
+ delay_ms(1000);
+ dev_iic2->iic_write(msg, strlen(msg));
+ //printf("msg\r\n");
+ delay_ms(1000);
+ uint8_t end[]={0x1a,0x00};
+ dev_iic2->iic_write(end, strlen(end));
+ printf("GPS发送定位信息已经完成\r\n");
+
+}
+
+void send_msg(void)
+{
+ DEV_UART *dev_uart2 = NULL;
+ uint8_t rcv_buf[10];
+ int8_t data[100];
+ uint32_t rcv_cnt;
+ uint32_t k;
+ uint32_t length;
+ uint32_t baudrate = 9600;
+ uint32_t rd_avail = 0;
+ char Longitude[]={"11540.5393"};
+ char Latitude[]={"3743.5044"};
+ cpu_lock();
+ board_init();
+ cpu_unlock();
+
+ dev_uart2 = uart_get_dev(DW_UART_2_ID);
+ dev_uart2->uart_open(baudrate);
+
+ k = 0;
+ dev_uart2->uart_control(UART_CMD_GET_RXAVAIL, (void *)(&rd_avail));
+ if(rd_avail > 0)
+ {
+ rcv_cnt = dev_uart2->uart_read(rcv_buf, 1);
+ rcv_buf[rcv_cnt] = '\0';
+ if (rcv_buf[0]=='$') //寻找帧命令起始位
+ {
+ while (1)
+ {
+ dev_uart2->uart_control(UART_CMD_GET_RXAVAIL, (void *)(&rd_avail));
+ if(rd_avail > 0)
+ {
+ rcv_cnt = dev_uart2->uart_read(rcv_buf, 1);
+
+ rcv_buf[rcv_cnt] = '\0';
+ //printf("rcv_buf[0]=%c\r\n",rcv_buf[0]);
+ if ((rcv_cnt) && (rcv_buf[0] != '\r')) //成功接收的字节数为1并且接收的字节不是帧结束标志(CR)
+ data[k++]= rcv_buf[0]; //将接收的字节放入数组中
+
+ if(rcv_buf[0]=='\r') //接收的字节是帧结束标志(CR),则此帧结束
+ break;
+ }
+ }
+ data[k]='\0';
+ if( Calc_GPS_Sum( data ) == 1 )
+ //if( data[4] == 'C' ) //$GPRMC
+ if ( ( data[3] == 'G' ) && ( data[4] == 'A' )) //$GPGGA
+ {
+ Creat_DH_Index( k,data );
+ Real_GPS_Command_Process( k,data );
+ //calculate_display();
+ double jingdu, weidu;
+ char mymsg[32]="the location of user is:";
+ //char lat_long[128];
+ // if(GPS.Real_Locate==1)//==1
+ {
+
+ jingdu=resolve(GPS->Longitude);
+ weidu=resolve(GPS->Latitude);
+ snprintf(GPS->lat_long,100,"%s longitude:%lf latitude:%lf\r\n",mymsg, jingdu, weidu);
+ EMBARC_PRINTF("lat_long=%s",GPS->lat_long);
+ //GPS.Real_Locate==0;
+ EMBARC_PRINTF("\nyouxiao\n ");//
+ }
+ }
+ }
+ }
+
+ sendGPS(phoneNumber,GPS->lat_long);
+
+}
+
+
+
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.h b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.h
new file mode 100644
index 00000000..9c340412
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/driver/gps/send_msg.h
@@ -0,0 +1,4 @@
+#ifndef _SEND_MSG_H_
+#define _SEND_MSG_H_
+extern void send_msg(void);
+#endif /* _SEND_MSG_H_ */
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/main.c b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/main.c
new file mode 100644
index 00000000..8ec9ec64
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/main.c
@@ -0,0 +1,275 @@
+/* ------------------------------------------
+ * \version 2016-01
+ * \date 2019-05-20
+ * \author Renjie Cao
+--------------------------------------------- */
+#include "string.h"
+#include "stdio.h"
+#include "embARC.h"
+#include "embARC_debug.h"
+#include "embARC_error.h"
+#include "board.h"
+#include "dev_iic.h"
+#include "dev_gpio.h"
+#define I2C_SLAVE_ADDR1 0x01
+#define uchar unsigned char
+#define uint unsigned int
+#define HEADLEN 5 //ݰͷij
+#define TH0 25 //ȫֵ
+#define TH1 1.25 //ͼٶȵĴС
+#define TH2 1.18 //ٶȾֵĴС
+#define TH30 55 //ǵֵ
+#define TH31 -55 //ǵֵ
+
+static DEV_GPIO_PTR port_stop;//ͣ
+static DEV_GPIO_PTR port_voice;//Ӣл
+double aValue[3];//ֲ˶ٶ
+double wValue[3];//ֲ˶ٶ
+double AValue[3];//ֲ˶Ƕ
+double AWM,Sawm,Z1,A1,A2;
+int BLESTATE;
+
+DEV_IIC *dev_iicyu=NULL;
+
+uint8_t *phoneNum = "00310035003000300032003900380036003400360036"; //ֻ
+uint8_t *msg1 = "7528623753EF80FD88AB62B18D77 "; //ûܱ
+uint8_t *msg2 = "752862378DCC5012"; //û
+
+
+//********************ӳٵԪ************************************
+static void delay_ms(volatile int z) //1ms
+{
+ volatile uint32_t x,y;
+ for(x=1400;x>0;x--)
+ for(y=z;y>0;y--);
+}
+//*****************************************************************
+
+//*********************ϳ*************************************
+void yuyin(char text[])
+{
+ dev_iicyu = iic_get_dev(DW_IIC_0_ID );
+ dev_iicyu->iic_open(DEV_MASTER_MODE, IIC_SPEED_STANDARD);
+ dev_iicyu->iic_control(IIC_CMD_MST_SET_TAR_ADDR, CONV2VOID(I2C_SLAVE_ADDR1));
+/****************Ҫ͵ı**********************************/
+ uint8_t length=0x00;
+ char ecc = 0x00; //Уֽ
+ uint8_t i=0;
+ //length =sizeof(text); //Ҫıij
+ while(text[length++]);
+/*******************************************************/
+ // headOfFrame[0] = 0xFD ; //֡ͷFD
+ // headOfFrame[1] = 0x00 ; //ȵĸֽ
+ // headOfFrame[2] = length + 3; //ȵĵֽ
+ // headOfFrame[3] = 0x01 ; //֣ϳɲ
+/*******************************************************/
+ // headOfFrame[4] = 0x00 ; //ʽΪGBK
+ char head[HEADLEN] = {0xfd,0x00,0x00,0x01,0x00};
+/*******************************************************/
+ //headOfFrame[4] = 0x01 ; //ʽΪGBK
+
+
+
+ head[2] = length + 3;
+
+ for(i = 0; i<5; i++) //ηõ5֡ͷֽ
+ {
+ ecc=ecc^(head[i]); //Է͵ֽڽУ
+ //SBUF = headOfFrame[i];
+ // printf("head[%d]=%d\r\n",i,head[i]);
+
+ }
+ // printf("length=%d\r\n",length);
+
+ dev_iicyu->iic_write(head, 5);
+
+
+ for(i = 0; iiic_write(text, length+1);
+
+ delay_ms(200);
+
+}
+//***********************************************************************
+
+int main(void)
+{
+ uint32_t DIP1,DIP2;
+ double Max,Sum,Aver;
+ int i,j,k,m;
+
+ cpu_lock(); /* lock cpu to do initializations */
+ board_init(); /* board level init */
+ cpu_unlock(); /* unlock cpu to let interrupt work */
+
+
+
+ while(1)
+ {
+
+//*****************************************************************************
+
+//**********************************ģʽ************************************
+
+ port_stop = gpio_get_dev(DW_GPIO_PORT_A);
+ port_stop->gpio_open(0x100);
+ port_stop->gpio_control(GPIO_CMD_SET_BIT_DIR_INPUT, (void *)0x100);
+ port_stop->gpio_read(&DIP1, 0x100);
+ printf("DIP1=0x%x\r\n",DIP1);
+
+ // port_stop->gpio_write(0x100, 0x100);
+ // port_stop->gpio_read(&DIP1, 0x100);
+ // printf("DIP1=0x%x\r\n",DIP1);
+//
+
+ if(DIP1==0x0)
+ {
+ printf("Ѿ\r\n");
+ }
+ else if(DIP1==0x100)
+ {
+//*****************************************************************************
+ printf("Ѿ\r\n");
+ data0(aValue,wValue,AValue,&Z1,&AWM,&A1,&A2);
+ printf("AWM:%4.3f,",AWM);
+
+
+//**********************************һ************************************
+
+ port_voice = gpio_get_dev(DW_GPIO_PORT_C);
+ port_voice -> gpio_open(0x10000);
+ port_voice -> gpio_control(GPIO_CMD_SET_BIT_DIR_INPUT, (void *)0x10000);
+ port_voice -> gpio_read(&DIP2,0x10000);
+ printf("DIP2=0x%x\r\n",DIP2);
+
+ delay_ms(100);
+ BLESTATE=ble();
+ printf("ble state is %d\r\n",BLESTATE);
+
+ if(DIP2==0x0)
+ {
+ EMBARC_PRINTF("Զ\r\n");
+
+ char texta[]={","};
+ yuyin(texta);
+ delay_ms(6000);
+ char textb[]={"Ҽڸ"};
+ yuyin(textb);
+ delay_ms(5000);
+ char textc[]={"ϵ绰15236578965"};
+ yuyin(textc);
+ delay_ms(9000);
+
+ }
+//*****************************************************************************
+
+//**********************************************************************
+ else if(AWM == 0 | BLESTATE ==0 )
+ {
+ printf("侯\r\n");
+ beep();
+ //send(phoneNum,msg);
+ delay_ms(500);
+ }
+//*****************************************************************************
+
+//**********************************̬************************************
+
+ else
+ {
+ data0(aValue,wValue,AValue,&Z1,&AWM,&A1,&A2);
+ printf("AWM:%4.3f,\r\n",AWM);
+ m=0;
+ j=0;
+ Max = Z1;
+ k=4;
+ if(AWM > 0.990 & AWM < 1.050){
+ printf("ܴھֹ\r\n");
+ }
+ if(AWM > TH1 | Z1>=1.25){
+ if(Z1>=3.8) continue;
+ else if(Z1>=2.5 & Z1 <3.8) {
+ printf("ֱӱ\r\n");
+ send(phoneNum,msg1);
+ delay_ms(5000);
+ continue;
+ }
+ else {
+ Sum=0;
+ printf("жϻ\r\n");
+ Max = (Max > Z1)? Max : Z1;
+ for(i = 0; i< 18; i++) {
+ data0(aValue,wValue,AValue,&Z1,&AWM,&A1,&A2);
+ delay_ms(150);
+ Max = (Max > Z1)? Max : Z1;
+ Sum += AWM;
+ //жǷָȶ
+ if(0.93<=Z1 & Z1<=1.08 & (k-1)>0)
+ {
+ j=i;
+ k=k-1;
+ }
+
+ printf("Sum:%4.3f,\r\n",Sum);
+ }
+ Aver = Sum/18;
+ printf("Aver:%4.3f,\r\n",Aver);//ƽٶ
+
+ m = (1 < j< 11)? (j-1) : 18; //õָȶҪʱ
+ printf("m:%d,\r\n",m);
+
+ if(Aver < TH2 ){
+ printf("\r\n");
+ printf("A1:%4.3f,\r\n",A1);
+ printf("A2:%4.3f,\r\n",A2);
+
+ if(A1>=TH30 | A1<=TH31 | A2>=TH30 | A2<=TH31 ) {
+ printf("\r\n");
+ send(phoneNum,msg2);
+ delay_ms(3000);
+ continue;
+ }
+ else if(m > 1 & m < 12 & ((Max-1)*m*m >=TH0)) //жǷȫ
+ {
+ printf("\r\n");
+ printf("m:%d,\r\n",m);
+ send(phoneNum,msg1);
+ delay_ms(7000);
+ continue;
+ }
+ else
+ {
+ printf("صһ\r\n");
+ }
+ }
+ }
+ }
+
+ }
+ printf("\r\n");
+//*****************************************************************************
+
+//**********************************λ************************************
+ if(BLESTATE == 1 & !AWM ==0){
+ printf("зΧ\r\n");
+ send_msg();
+ delay_ms(3000);
+ }
+
+ }
+
+}
+ return E_SYS;
+
+ }
\ No newline at end of file
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/makefile b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/makefile
new file mode 100644
index 00000000..550f895a
--- /dev/null
+++ b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/arc/makefile
@@ -0,0 +1,60 @@
+# Application name
+APPL ?= 527
+
+# Optimization Level
+# Please Refer to toolchain_xxx.mk for this option
+OLEVEL ?= O2
+
+##
+# Current Board And Core
+##
+BOARD ?= emsk
+BD_VER ?= 22
+CUR_CORE ?= arcem7d
+TOOLCHAIN ?= gnu
+
+##
+# select debugging jtag
+##
+JTAG ?= usb
+
+##
+# Uncomment following options
+# if you want to set your own heap and stack size
+# Default settings see options.mk
+##
+#HEAPSZ ?= 8192
+#STACKSZ ?= 8192
+
+##
+# Uncomment following options
+# if you want to add your own library into link process
+# For example:
+# If you want link math lib for gnu toolchain,
+# you need to set the option to -lm
+##
+#APPL_LIBS ?=
+
+#
+# root dir of embARC
+#
+EMBARC_ROOT = ../../../../..
+
+MID_SEL = common
+
+# application source dirs
+APPL_CSRC_DIR = . ./driver/bluetooth ./driver/data ./driver/gprs ./driver/buzzer ./driver/gps
+APPL_ASMSRC_DIR = .
+
+# application include dirs
+APPL_INC_DIR = . ./driver/bluetooth ./driver/data ./driver/gprs ./driver/buzzer ./driver/gps
+
+# application defines
+APPL_DEFINES =
+# include current project makefile
+COMMON_COMPILE_PREREQUISITES += makefile
+
+### Options above must be added before include options.mk ###
+# include key embARC build system makefile
+override EMBARC_ROOT := $(strip $(subst \,/,$(EMBARC_ROOT)))
+include $(EMBARC_ROOT)/options/options.mk
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pdf b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pdf
new file mode 100644
index 00000000..7def9318
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pdf differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pptx b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pptx
new file mode 100644
index 00000000..4826ec15
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/doc-ppt/Anti-lost security detection system based on ARC processor.pptx differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/Over appearance.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/Over appearance.jpg
new file mode 100644
index 00000000..f0fc6347
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/Over appearance.jpg differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/external view.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/external view.jpg
new file mode 100644
index 00000000..c74ba103
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/external view.jpg differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/plantform.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/plantform.jpg
new file mode 100644
index 00000000..ebf9e24e
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/plantform.jpg differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/power switch.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/power switch.jpg
new file mode 100644
index 00000000..724a0fcd
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/power switch.jpg differ
diff --git a/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/wear picture.jpg b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/wear picture.jpg
new file mode 100644
index 00000000..aad0c65a
Binary files /dev/null and b/arc_design_contest/2019/XDU_Anti-lost_security_detection_system/project picture/wear picture.jpg differ