zhyinch
2019-11-13 8c44ac4d11d4e72eba7fc0506b1b78ec86c33dda
V1.7
已修改4个文件
172 ■■■■ 文件已修改
源码/核心板/Src/application/beep_logic_app.c 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
源码/核心板/Src/application/dw_app.c 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
源码/核心板/Src/application/dw_app.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
源码/核心板/Src/main.c 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Ô´Âë/ºËÐİå/Src/application/beep_logic_app.c
@@ -12,7 +12,7 @@
#define ONTIME3 1   // 500ms
#define OFFTIME3 5  // 500ms
int16_t min_dist;
int32_t min_dist;
void main_logic(void)    //主逻辑在这里执行
{
    static uint8_t beep_state,timer_state,beep_timer,beep_ontime,beep_offtime;
@@ -22,7 +22,7 @@
    if(beep_judge_cnt++ >= 100)
    {    
        beep_judge_cnt = 0;
        min_dist=0x7fff;
        min_dist=0x7fffff;
        for(i = 0; i < 255;i++)
        {
            if(g_Tagdist[i] < min_dist)
@@ -67,86 +67,86 @@
            RELAY2_OFF;
        }
        
        if(beep_state==1)
        {
            if(timer_state==1)
            {
                if(beep_timer++ < beep_ontime)
                {
                    switch(g_com_map[ALARM_DEV])
                            {
                                case 0:
                                    BEEP2_ON;
                                    BEEP_OFF;
                                    OUT2_OFF;
                                    break;
                                case 1:
                                    BEEP_ON;
                                    BEEP2_OFF;
                                    OUT2_OFF;
                                    break;
                                case 2:
                                    OUT2_ON;
                                    BEEP_OFF;
                                    BEEP2_OFF;
                                    break;
                                default:
                                    BEEP2_ON;
                                    BEEP_ON;
                                    OUT2_ON;
                                    break;
                            }
                }else{
                    timer_state=0;
                    beep_timer=0;
                }
            }else{
                if(beep_timer++ < beep_offtime)
                    {
                        switch(g_com_map[ALARM_DEV])
                            {
                                case 0:
                                    BEEP2_OFF;
                                    break;
                                case 1:
                                    BEEP_OFF;
                                    break;
                                case 2:
                                    OUT2_OFF;
                                    break;
                                default:
                                    BEEP2_OFF;
                                    BEEP_OFF;
                                    OUT2_OFF;
                                    break;
                            }
                    }else{
                            timer_state=1;
                            beep_timer=0;
                    }
            }
        }    else {
            switch(g_com_map[ALARM_DEV])
            {
                case 0:
                    BEEP2_OFF;
                    break;
                case 1:
                    BEEP_OFF;
                    break;
                case 2:
                    OUT2_OFF;
                    break;
                default:
                    BEEP2_OFF;
                    BEEP_OFF;
                    OUT2_OFF;
                    break;
            }
        }
//
//        if(beep_state==1)
//        {
//            if(timer_state==1)
//            {
//                if(beep_timer++ < beep_ontime)
//                {
//                    switch(g_com_map[ALARM_DEV])
//                            {
//                                case 0:
//                                    BEEP2_ON;
//                                    BEEP_OFF;
//                                    OUT2_OFF;
//                                    break;
//                                case 1:
//                                    BEEP_ON;
//                                    BEEP2_OFF;
//                                    OUT2_OFF;
//                                    break;
//                                case 2:
//                                    OUT2_ON;
//                                    BEEP_OFF;
//                                    BEEP2_OFF;
//                                    break;
//                                default:
//                                    BEEP2_ON;
//                                    BEEP_ON;
//                                    OUT2_ON;
//                                    break;
//                            }
//                }else{
//                    timer_state=0;
//                    beep_timer=0;
//                }
//            }else{
//                if(beep_timer++ < beep_offtime)
//                    {
//                        switch(g_com_map[ALARM_DEV])
//                            {
//                                case 0:
//                                    BEEP2_OFF;
//                                    break;
//                                case 1:
//                                    BEEP_OFF;
//                                    break;
//                                case 2:
//                                    OUT2_OFF;
//                                    break;
//                                default:
//                                    BEEP2_OFF;
//                                    BEEP_OFF;
//                                    OUT2_OFF;
//                                    break;
//                            }
//                    }else{
//                            timer_state=1;
//                            beep_timer=0;
//                    }
//
//            }
//
//        }    else {
//            switch(g_com_map[ALARM_DEV])
//            {
//                case 0:
//                    BEEP2_OFF;
//                    break;
//                case 1:
//                    BEEP_OFF;
//                    break;
//                case 2:
//                    OUT2_OFF;
//                    break;
//                default:
//                    BEEP2_OFF;
//                    BEEP_OFF;
//                    OUT2_OFF;
//                    break;
//            }
//        }
    }
}    
Ô´Âë/ºËÐİå/Src/application/dw_app.c
@@ -145,7 +145,7 @@
float dis_after_filter;                //当前距离值
LPFilter_Frac* p_Dis_Filter;        //测距用的低通滤波器
uint16_t g_Tagdist[TAG_NUM_IN_SYS];
int32_t g_Tagdist[TAG_NUM_IN_SYS];
uint8_t g_flag_Taggetdist[256];
/*------------------------------------ Functions ------------------------------------------*/
@@ -612,7 +612,7 @@
                    dis_after_filter=dist_cm;
                    hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET];
                        if(tag_id_recv-TAG_ID_START<=TAG_NUM_IN_SYS)
                    if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<1000&&hex_dist<100000)
                    if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<1000&&hex_dist<100000&&hex_dist>-1000)
                    {
                        g_Tagdist[tag_id_recv-TAG_ID_START] = hex_dist;
                        anchor_dist_last_frm[tag_id_recv-TAG_ID_START] = hex_dist;
Ô´Âë/ºËÐİå/Src/application/dw_app.h
@@ -37,7 +37,7 @@
void Tag_App(void);
void Anchor_App(void);
void tag_sleep_configuraion(void);
extern uint16_t g_Tagdist[TAG_NUM_IN_SYS];
extern int32_t g_Tagdist[TAG_NUM_IN_SYS];
extern uint8_t g_flag_Taggetdist[256];
extern void TagDistClear(void);
void Dw1000_App_Init(void);
Ô´Âë/ºËÐİå/Src/main.c
@@ -57,7 +57,7 @@
//        g_com_map[DEV_ID]=1;
//    g_com_map[COM_INTERVAL]=10;
    OUT485_ENABLE;
    g_com_map[VERSION] = 0x0106;
    g_com_map[VERSION] = 0x0107;
    temp=(float)g_com_map[MAX_REPORT_ANC_NUM]*4/3;    
    temp2=g_com_map[DEV_ID]*g_com_map[MAX_REPORT_ANC_NUM]*4/3;
    if(temp2<temp)