zhangbo
2025-04-29 403dc14c0083a99d6f2c3d7992e3bf1f1d1bc139
修改休眠逻辑,现在是假休眠MCU并没有进入休眠现在有8ma的底电流
已修改9个文件
28078 ■■■■■ 文件已修改
keil/JLinkLog.txt 8066 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 6175 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 11040 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 2689 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/PCA9555.c 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/src/TCPClient.c 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/JLinkLog.txt
ÎļþÌ«´ó
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -481,7 +481,7 @@
I (include\drivers\mk_io.h)(0x680D9C68)
F (.\sn74hc595.h)(0x680D9C68)()
F (.\mk_4G.h)(0x680D9C68)()
F (.\include\drivers\PCA9555.c)(0x680D9C68)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/drivers -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/pca9555.o -MD)
F (.\include\drivers\PCA9555.c)(0x6810734D)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/drivers -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/pca9555.o -MD)
I (include\drivers\PCA9555.h)(0x680D9C68)
I (include\board\board.h)(0x680D9C68)
I (include\drivers\mk_common.h)(0x680D9C68)
@@ -748,7 +748,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x680D9C68)
I (include\drivers\Usart.h)(0x680D9C68)
F (.\include\main\main.c)(0x680F5539)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
F (.\include\main\main.c)(0x68107D3A)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
I (include\drivers\mk_trace.h)(0x680D9C68)
I (include\drivers\mk_common.h)(0x680D9C68)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -804,7 +804,7 @@
I (include\drivers\PCA9555.h)(0x680D9C68)
I (include\drivers\WS2812.h)(0x680D9C68)
I (include\drivers\DBG.h)(0x680D9C68)
F (.\include\src\TCPClient.c)(0x680D9C68)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/tcpclient.o -MD)
F (.\include\src\TCPClient.c)(0x681076F3)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include/components/internet/src -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/tcpclient.o -MD)
I (include\src\TCPClient.h)(0x680D9C68)
I (include\components\hido\Include\HIDO_TYpeDef.h)(0x680D9C68)
I (include\components\internet\inc\Socket.h)(0x680D9C68)
keil/include/drivers/PCA9555.c
@@ -559,12 +559,12 @@
    PCA9555_Set_One_Value_Config(AIR780E_ENBALE,0);//配置4G供电
    PCA9555_Set_One_Value_Output(AIR780E_ENBALE,1);//打开4G
    
    PCA9555_Set_One_Value_Config(MAIN_RI,0);//配置4G唤醒引脚为输入
    PCA9555_Set_One_Value_Output(MAIN_RI,1);
//    PCA9555_Set_One_Value_Config(MAIN_RI,0);//配置4G唤醒引脚为输入
//    PCA9555_Set_One_Value_Output(MAIN_RI,1);
//    PCA9555_Set_One_Value_Config(SOS_ENBALE,1);//设置SOS按钮输入
    
    PCA9555_Set_One_Value_Config(WAKE_UP,1);
    PCA9555_Set_One_Value_Config(TTS_ENABLE,0);//配置tts供电
//    PCA9555_Set_One_Value_Config(TTS_ENABLE,0);//配置tts供电
//    PCA9555_Set_One_Value_Output(PWR_ON,0);//拉低
    //PCA9555_readdata_from_output_register(PCA9555_DEVICE_ADDR,pca9555writedata_input);
    //PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0);
@@ -583,10 +583,17 @@
}
extern float nomove_count;
extern uint8_t deep_sleep_falg;
void move_handler()
{
    nomove_count=0;
    nomove_count=0;
        if(deep_sleep_falg==0)
        {
     deep_sleep_falg=1;
//       sleep_timer_start();
     NVIC_SystemReset();
        }
}
uint8_t test11,test21,test31,test41,test51;
void check_input_change(void)
@@ -597,7 +604,14 @@
              if(WAKE_UP_POSITION&gpio_state)
                {
                 //移动
         move_handler();
                    nomove_count=0;
                    if(deep_sleep_falg==0)
                    {
                     deep_sleep_falg=1;
           NVIC_SystemReset();
                     sys_reset(0);
                    }
//
                 test51++;
                }
//    if(!(MAIN_RI_POSITION&gpio_state))
keil/include/main/main.c
@@ -28,6 +28,7 @@
//#define DEBUG_MODE
extern int simple_main(void);
extern int temp_main(void);
void boot_deinit(void);
#define TEST_UART_POLL_MODE 0
#define TEST_UART_INTERUPT_MODE 1
#define TEST_UART_DMA_MODE 2
@@ -131,22 +132,31 @@
{
    uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);
}
uint8_t deep_sleep_falg=1;
void mcu_deep_sleep(void)
{
            uint32_t lock;
            trace_flush();
            lock = int_lock();
//                        LOG_INFO(TRACE_MODULE_APP, "进入深度休眠\r\n");
//            uint32_t lock;
//            trace_flush();
//            lock = int_lock();
////                        LOG_INFO(TRACE_MODULE_APP, "进入深度休眠\r\n");
//                        gps_air780_power_change(0,0);//关闭gps,4G 
              deep_sleep_falg=0;
            PCA9555_Set_One_Value_Output(LED_POWER,0);//输出低电平关闭LED
            PCA9555_Set_One_Value_Output(GPS_POWER,0);//关闭gps,4G 
                        PCA9555_Set_One_Value_Config(MAIN_RI,0);//配置4G唤醒引脚为输入
//                        PCA9555_Set_One_Value_Output(MAIN_RI,1);
              boot_deinit();
            CloseUWB();
            PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0);//关闭gps,4G 
                            sleep_timer_stop();
                        //adc_close();
            power_enter_power_down_mode(1);
//                        LOG_INFO(TRACE_MODULE_APP, "从休眠出来\r\n");
                        sys_reset(0);
            int_unlock(lock);
//                        sleep_timer_stop();
//                        //adc_close();
//            power_enter_power_down_mode(1);
//              delay_us(200000);
//              sys_reset(0);
////                        LOG_INFO(TRACE_MODULE_APP, "从休眠出来\r\n");
//            int_unlock(lock);
}
static void adc_callback(void *data, uint32_t number)
{
@@ -525,7 +535,7 @@
                        g_com_map[CNT_RESTART]=0;
                        save_com_map_to_flash();
                        NVIC_SystemReset();
                                              LOG_INFO(TRACE_MODULE_APP,"1111");
                    }
                }
                else
@@ -541,7 +551,6 @@
                }
            }
            NVIC_SystemReset();
                        LOG_INFO(TRACE_MODULE_APP,"2222");
            input5vflag=1;
        }
        else 
@@ -561,12 +570,11 @@
        {
            g_com_map[CNT_RESTART]=0;
            NVIC_SystemReset();
                         LOG_INFO(TRACE_MODULE_APP,"3333");
        }
        if(g_com_map[MAP_SIGN_INDEX]!=0x55AA||g_com_map[COM_INTERVAL]==0)
        {
            NVIC_SystemReset();
                        LOG_INFO(TRACE_MODULE_APP,"4444");
        }
        HIDO_TimerPoll();
        if(ledonflag==1)
@@ -585,9 +593,12 @@
// UART0 TX/RX
    io_pin_mux_set(IO_PIN_5, IO_FUNC0);
    io_pin_mux_set(IO_PIN_6, IO_FUNC0);
      gpio_pin_set_dir(IO_PIN_5 , GPIO_DIR_OUT, 0);
      gpio_pin_set_dir(IO_PIN_6 , GPIO_DIR_OUT, 0);
    // UART1 RX/TX
    io_pin_mux_set(IO_PIN_10, IO_FUNC0);
    io_pin_mux_set(IO_PIN_9, IO_FUNC0);
     uart_close(UART_ID1);//解绑原来串口1
     uart_close(UART_ID0);//解绑原来串口0
}
keil/include/src/TCPClient.c
@@ -640,10 +640,10 @@
char str[17]= {"AT+IPR=9600;&W\r\n"};
void AIR780E_Reset(void)
{
        PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0);//关闭4G
    delay_ms(1500);
    PCA9555_Set_One_Value_Output(AIR780E_ENBALE,1);//打开4G
    delay_ms(3000);
//        PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0);//关闭4G
//    delay_ms(1500);
//    PCA9555_Set_One_Value_Output(AIR780E_ENBALE,1);//打开4G
//    delay_ms(3000);
//    Uart_ReConfigBaudRate(UART_ID_4G,115200);
//    uart_send(UART_ID0, str,17, NULL);
//    Uart_ReConfigBaudRate(UART_ID_4G,9600);
keil/uwb_simple_example.uvoptx
@@ -148,7 +148,24 @@
          <Name></Name>
        </SetRegEntry>
      </TargetDriverDllRegistry>
      <Breakpoint/>
      <Breakpoint>
        <Bp>
          <Number>0</Number>
          <Type>0</Type>
          <LineNumber>659</LineNumber>
          <EnabledFlag>1</EnabledFlag>
          <Address>59804</Address>
          <ByteObject>0</ByteObject>
          <HtxType>0</HtxType>
          <ManyObjects>0</ManyObjects>
          <SizeOfObject>0</SizeOfObject>
          <BreakByAccess>0</BreakByAccess>
          <BreakIfRCount>1</BreakIfRCount>
          <Filename>&lt;1&gt;.\include\main\main.c</Filename>
          <ExecCommand></ExecCommand>
          <Expression>\\uwb_simple_example\include/main/main.c\659</Expression>
        </Bp>
      </Breakpoint>
      <WatchWindow1>
        <Ww>
          <count>0</count>
@@ -327,6 +344,16 @@
          <WinNumber>2</WinNumber>
          <ItemText>dev_id</ItemText>
        </Ww>
        <Ww>
          <count>11</count>
          <WinNumber>2</WinNumber>
          <ItemText>nomove_count</ItemText>
        </Ww>
        <Ww>
          <count>12</count>
          <WinNumber>2</WinNumber>
          <ItemText>deep_sleep_falg</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>
        <Mm>