Kaynağa Gözat

fix:gpio close没有正确去除低功耗唤醒功能
update:下拉无效提醒

alienwalker 4 yıl önce
ebeveyn
işleme
52a309fa2a

+ 0 - 2
application/src/luat_base_air105.c

@@ -301,8 +301,6 @@ void luat_shell_poweron(int _drv);
 
 void luat_base_init(void)
 {
-	luat_gpio_init();
-
 	luat_vm_pool_init();
 
 #ifdef LUAT_USE_SHELL

+ 3 - 20
application/src/luat_gpio_air105.c

@@ -28,14 +28,8 @@
 #include "platform_define.h"
 #include "luat_irq.h"
 
-//typedef struct wm_gpio_conf
-//{
-//    luat_gpio_irq_cb cb;
-//    void* args;
-//}wm_gpio_conf_t;
-//
-//
-//static wm_gpio_conf_t confs[HAL_GPIO_MAX];
+#define LUAT_LOG_TAG "luat.gpio"
+#include "luat_log.h"
 
 static void luat_gpio_irq_callback(void *ptr, void *pParam)
 {
@@ -83,6 +77,7 @@ int luat_gpio_setup(luat_gpio_t *gpio){
             GPIO_PullConfig(gpio->pin, 1, 1);
             break;
         case Luat_GPIO_PULLDOWN:
+            LLOGE("air105 can't config pulldown");
             GPIO_PullConfig(gpio->pin, 1, 0);
             break;
         case Luat_GPIO_DEFAULT:
@@ -112,18 +107,6 @@ void luat_gpio_close(int pin){
     return ;
 }
 
-void luat_gpio_init(void){
-//    GPIO_GlobalInit(luat_gpio_irq_callback);
-}
-
-// int luat_gpio_set_irq_cb(int pin, luat_gpio_irq_cb cb, void* args) {
-//     if (pin < HAL_GPIO_2 || pin >= HAL_GPIO_MAX) return -1;
-//     if (cb) {
-//     	GPIO_ExtiSetCB(pin, cb, args);
-//     }
-//     return 0;
-// }
-
 void luat_gpio_pulse(int pin, uint8_t *level, uint16_t len, uint16_t delay_ns) {
 	GPIO_OutPulse(pin, level, len, delay_ns);
 }

+ 1 - 1
bsp/air105/hal/core_gpio.c

@@ -214,7 +214,7 @@ void GPIO_ExtiConfig(uint32_t Pin, uint8_t IsLevel, uint8_t IsRiseHigh, uint8_t
 	GPIO->INTP_TYPE_STA[Port].INTP_TYPE = (GPIO->INTP_TYPE_STA[Port].INTP_TYPE & Mask) | Type;
 	uint32_t Sn = Pin / 32;
 	uint32_t Pos = 1 << (Pin % 32);
-	if (!IsLevel)
+	if (!IsLevel && (IsRiseHigh || IsFallLow))
 	{
 		switch(Sn)
 		{