导航

    Freqchip开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    1. 主页
    2. bing
    3. 帖子
    B
    • 继续与 bing 聊天
    • 开始与 bing 的新会话
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 主题
    • 帖子
    • 最佳
    • 群组

    bing 发布的帖子

    • 开启休眠后手机连接蓝牙很慢才能连接成功获取完所有服务

      attribute((section("ram_code"))) void user_entry_after_sleep_imp(void)
      {
      pmu_set_pin_to_CPU(GPIO_PORT_A, (1<<GPIO_BIT_0));

      system_set_port_pull(1 << LOG_UART_RX_PORT_SEL, GPIO_PULL_UP, true);
      system_set_port_mux(LOG_UART_RX_PORT_SEL/8, LOG_UART_RX_PORT_SEL%8, 4);
      system_set_port_mux(LOG_UART_TX_PORT_SEL/8, LOG_UART_TX_PORT_SEL%8, 4);
      
      //system_set_port_mux(GPIO_PORT_A, GPIO_BIT_0, PORTA0_FUNC_UART0_RXD);
      //system_set_port_mux(GPIO_PORT_A, GPIO_BIT_1, PORTA1_FUNC_UART0_TXD);
      uart_init(UART0, 1152);
      fr_uart_enableIrq(UART0, Uart_irq_erbfi);
      
      /* RC calibration start. Ensure the accuracy of sleep wake time */
      pmu_calibration_start(PMU_CALI_SEL_RCLFOSC, LP_RC_CALIB_CNT);
      
      uart_putc_noint_no_wait(UART0, 'w');
      co_delay_100us(1);
      
        pmu_set_pin_to_CPU(GPIO_PORT_C, (1<<GPIO_BIT_2));
      pmu_set_pin_to_CPU(GPIO_PORT_C, (1<<GPIO_BIT_3));
      
      
      __SYSTEM_UART1_CLK_ENABLE();
      	system_set_port_pull(GPIO_PC2,GPIO_PULL_UP,true);
      /* set PC2 and PC3 for AT command interface */
      system_set_port_mux(GPIO_PORT_C, GPIO_BIT_2, PORTA2_FUNC_UART1_RXD);
      system_set_port_mux(GPIO_PORT_C, GPIO_BIT_3, PORTA3_FUNC_UART1_TXD);
      Uart1_handle.UARTx = Uart1;
      Uart1_handle.Init.BaudRate   = gAT_buff_env.uart_param.BaudRate;
      Uart1_handle.Init.DataLength = gAT_buff_env.uart_param.DataLength;
      Uart1_handle.Init.StopBits   = gAT_buff_env.uart_param.StopBits;
      Uart1_handle.Init.Parity     = gAT_buff_env.uart_param.Parity;
      Uart1_handle.Init.FIFO_Mode  = UART_FIFO_ENABLE;
      
      uart_init_ex(&Uart1_handle);
      
      /*enable recv and line status interrupt*/
      __UART_INT_LINE_STATUS_ENABLE(Uart1_handle.UARTx);
      __UART_INT_RX_ENABLE(Uart1_handle.UARTx);
      
      	NVIC_EnableIRQ(UART1_IRQn);
      NVIC_SetPriority(UART1_IRQn, 1);
      	
      	
      NVIC_EnableIRQ(PMU_IRQn);
      

      }
      attribute((section("ram_code"))) void user_entry_before_sleep_imp(void)
      {
      pmu_calibration_stop();

      uart_putc_noint_no_wait(UART0, 's');
      co_delay_100us(1);
      
      pmu_set_pin_to_PMU(GPIO_PORT_A, (1<<GPIO_BIT_0));
      pmu_set_pin_dir(GPIO_PORT_A, (1<<GPIO_BIT_0), GPIO_DIR_IN);
      pmu_set_pin_pull(GPIO_PORT_A, (1<<GPIO_BIT_0),GPIO_PULL_DOWN);//GPIO_PULL_NONE
      
      pmu_set_pin_to_PMU(GPIO_PORT_C, (1<<GPIO_BIT_2));
      pmu_set_pin_dir(GPIO_PORT_C, (1<<GPIO_BIT_2), GPIO_DIR_IN);
      pmu_set_pin_pull(GPIO_PORT_C, (1<<GPIO_BIT_2),GPIO_PULL_UP);
      pmu_set_pin_to_PMU(GPIO_PORT_C, (1<<GPIO_BIT_3));
      pmu_set_pin_dir(GPIO_PORT_C, (1<<GPIO_BIT_3), GPIO_DIR_IN);
      pmu_set_pin_pull(GPIO_PORT_C, (1<<GPIO_BIT_3),GPIO_PULL_UP);	
      

      }
      进入后退出休眠模式初始化了2个串口,这样的话休眠过程连接蓝牙就很慢,去掉打印ws就快不少,还可以怎么优化呢?

      发布在 FR800x
      B
      bing
    • FR8003休眠后串口输出非预期0x00

      ble_hid_kbd_mice 例程里面开启休眠功能,串口打印0_1750141462316_e96ade36-ecb1-4145-a471-b048da02b331-image.png 每次进入休眠打印完s之后都有一个0被输出,会是什么问题呢

      发布在 FR800x
      B
      bing