diff --git a/ReadMe.md b/ReadMe.md index a58369a4..aca374bd 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,3 +1,7 @@ +# v1.0.8 +* 1.gt911的驱动方式有中断改为轮询,并初始化重新写;解决上电和长期运行屏幕触摸无效的问题 +* 2.修复非标准时区和自动获取时间不一致的bug + # v1.0.7 * 1.增加非标准时区 diff --git a/application/rt-thread/t3e-pro/components/FontEnum.h b/application/rt-thread/t3e-pro/components/FontEnum.h index 55b84a40..e4300309 100644 --- a/application/rt-thread/t3e-pro/components/FontEnum.h +++ b/application/rt-thread/t3e-pro/components/FontEnum.h @@ -11,7 +11,7 @@ #define D_System_Storage "16MB+8MB" #define D_System_Hardware "1.0" #define D_System_Screen "480*480" -#define D_System_Ver 107 +#define D_System_Ver 108 enum { diff --git a/application/rt-thread/t3e-pro/components/mcu_sdk/src/protocol.c b/application/rt-thread/t3e-pro/components/mcu_sdk/src/protocol.c index 55b1a77f..d33c5e6f 100644 --- a/application/rt-thread/t3e-pro/components/mcu_sdk/src/protocol.c +++ b/application/rt-thread/t3e-pro/components/mcu_sdk/src/protocol.c @@ -3389,7 +3389,14 @@ void mcu_write_rtctime(unsigned char time[]) //=0是utc+0 //<0是utc- //>0是utc+ - char zone=(char)((Localtime-standardtime)/3600);//标准时区 + +// //UTC-04:30 +// Localtime=1764832680; +// standardtime=1764848880; +// printf("test utc-04:30 standardtime:%ld\r\n",standardtime); +// printf("test utc-04:30 Localtime:%ld\r\n",Localtime); + + int zone=(int)((Localtime-standardtime)/3600);//标准时区 int zone_offset=((Localtime-standardtime)%3600);//处理5:30 6:30等等非准标时区 printf("zone:%d;zone_offset:%d\r\n", zone,zone_offset); @@ -3481,16 +3488,19 @@ void mcu_write_rtctime(unsigned char time[]) } struct timeval tv; - //tv.tv_sec=(time_t)Localtime;//用本地时间 时区要设置0 相对0时区的时间 - tz_set(zone); - tv.tv_sec=(time_t)standardtime;//utc时间 + tz_set(zone);//不支持半时区设置 + + standardtime=Localtime-zone*3600;//重新计算标准utc+0的时间 考虑UTC+5:30...等非标准时区 + tv.tv_sec=(time_t)standardtime;//utc时间 疑惑点 是否要+-1800/2700 tv.tv_usec=0; + // int settimeofday(const struct timeval *tv , const struct timezone *tz); //tz参数为时区 通常将参数tz设置为NULL,表示使用当前系统的时区 //输入时间戳,通过settimeofday()函数来设置系统时间,这个函数设置的精度可以精确到微秒 // tz_set(0);//本地时间就是相对0时区的时间 - settimeofday(&tv, NULL);//不用重新设置时区 + + settimeofday(&tv, NULL); my_memcpy((void *)timestamp,(const char *)time,4); //get timestamp zigbee_timestamp_to_time(); diff --git a/bsp/peripheral/touch/gt911/src/gt911.c b/bsp/peripheral/touch/gt911/src/gt911.c index 125ca21f..466ec82a 100644 --- a/bsp/peripheral/touch/gt911/src/gt911.c +++ b/bsp/peripheral/touch/gt911/src/gt911.c @@ -259,7 +259,7 @@ static rt_size_t gt911_read_point(struct rt_touch_device *touch, void *buf, cmd[1] = (rt_uint8_t)(GT911_READ_STATUS & 0xFF); if (gt911_read_regs(>911_client, cmd, &point_status, 1) != RT_EOK) { - LOG_D("read point failed\n"); + LOG_E("read point failed\n"); read_num = 0; goto exit_; } @@ -290,7 +290,7 @@ static rt_size_t gt911_read_point(struct rt_touch_device *touch, void *buf, /* read point num is touch_num */ if (gt911_read_regs(>911_client, cmd, read_buf, read_num * GT911_POINT_INFO_NUM) != RT_EOK) { - LOG_D("read point failed\n"); + LOG_E("read point failed\n"); read_num = 0; goto exit_; } @@ -350,7 +350,7 @@ exit_: write_buf[0] = (rt_uint8_t)((GT911_READ_STATUS >> 8) & 0xFF); write_buf[1] = (rt_uint8_t)(GT911_READ_STATUS & 0xFF); write_buf[2] = 0x00; - gt911_write_reg(>911_client, write_buf, 3); + gt911_write_reg(>911_client, write_buf, 3);//读完后把0x814E寄存器清为0 return read_num; } @@ -495,31 +495,53 @@ static int rt_hw_gt911_init(const char *name, struct rt_touch_config *cfg) rt_memset((void *)touch_device, 0, sizeof(struct rt_touch_device)); /* hw init*/ + // // rst output 0 + // rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_OUTPUT); + // rt_pin_write(*(rt_uint8_t *)cfg->user_data, PIN_LOW); + // rt_thread_delay(10); + + // // irq output 0 + // rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_OUTPUT); + // rt_pin_write(cfg->irq_pin.pin, PIN_LOW); + + // rt_thread_delay(2); + // // rst output 1 + // rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_OUTPUT); + // rt_pin_write(*(rt_uint8_t *)cfg->user_data, PIN_HIGH); + + // rt_thread_delay(5); + // // // rst input + // // rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_INPUT); + + // //irq output 0 + // rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_OUTPUT); + // rt_pin_write(cfg->irq_pin.pin, PIN_LOW); + + // rt_thread_delay(50); + + // rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_INPUT); + +//把RST、INT拉低,延时10ms,把RST拉高(>5ms),就可以把IIC地址设为0xBA/0xBB + rt_thread_delay(20);//硬件RC电路采用的10k 1uf 复位需要10ms以上 + // rst output 0 rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_OUTPUT); rt_pin_write(*(rt_uint8_t *)cfg->user_data, PIN_LOW); - rt_thread_delay(10); - // irq output 0 rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_OUTPUT); rt_pin_write(cfg->irq_pin.pin, PIN_LOW); - rt_thread_delay(2); + rt_thread_delay(50); + // rst output 1 - rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_OUTPUT); + rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_OUTPUT); rt_pin_write(*(rt_uint8_t *)cfg->user_data, PIN_HIGH); + + rt_thread_delay(200);// irq output 0 >50ms维持不变 - rt_thread_delay(5); - // // rst input - // rt_pin_mode(*(rt_uint8_t *)cfg->user_data, PIN_MODE_INPUT); + //irq input 0 + rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_INPUT);//改成输入 - //irq output 0 - rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_OUTPUT); - rt_pin_write(cfg->irq_pin.pin, PIN_LOW); - - rt_thread_delay(50); - - rt_pin_mode(cfg->irq_pin.pin, PIN_MODE_INPUT); gt911_client.bus = (struct rt_i2c_bus_device *)rt_device_find(cfg->dev_name); diff --git a/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.c b/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.c index c6160471..7a0be624 100644 --- a/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.c +++ b/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.c @@ -58,7 +58,7 @@ static void touch_entry(void *parameter) /* touch panel control entry */ while (1) { - rt_sem_take(touch_sem, RT_WAITING_FOREVER); + // rt_sem_take(touch_sem, RT_WAITING_FOREVER); int num = rt_device_read(dev, 0, read_data, info.point_num); if (num > 0) { @@ -81,19 +81,26 @@ static void touch_entry(void *parameter) /* touch panel control entry */ } } } - //aicos_msleep(10); - rt_device_control(dev, RT_TOUCH_CTRL_ENABLE_INT, RT_NULL); + + // rt_device_control(dev, RT_TOUCH_CTRL_ENABLE_INT, RT_NULL);//处理完毕再使能中断 + + /* + * If using polling mode, + * the following conmments must be opened, + * and the masking related to semaphores must be removed. + */ + rt_thread_mdelay(10); } } static rt_err_t rx_callback(rt_device_t dev, rt_size_t size) { - rt_sem_release(touch_sem); - rt_device_control(dev, RT_TOUCH_CTRL_DISABLE_INT, RT_NULL); -#ifdef AIC_PM_DEMO - extern struct rt_event pm_event; - rt_event_send(&pm_event, 2); -#endif +// rt_sem_release(touch_sem); +// rt_device_control(dev, RT_TOUCH_CTRL_DISABLE_INT, RT_NULL);//中断来了 暂时关闭中断 等处理完毕再打开 +// #ifdef AIC_PM_DEMO +// extern struct rt_event pm_event; +// rt_event_send(&pm_event, 2); +// #endif return 0; } @@ -105,7 +112,7 @@ int tpc_run(const char *name, rt_uint16_t x, rt_uint16_t y) rt_kprintf("can't find device:%s\n", name); return -1; } - +//中断接收 if (rt_device_open(dev, RT_DEVICE_FLAG_INT_RX) != RT_EOK) { rt_kprintf("dev %s is occupied by someone!\n", name); diff --git a/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.zip b/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.zip new file mode 100644 index 00000000..672a1090 Binary files /dev/null and b/packages/artinchip/lvgl-ui/aic_drivers/lv_tpc_run.zip differ diff --git a/packages/artinchip/lvgl-ui/aic_widgets/aic_canvas/libaic_canvas_v8_e907f.a b/packages/artinchip/lvgl-ui/aic_widgets/aic_canvas/libaic_canvas_v8_e907f.a index 219804a5..cdd93f6d 100644 Binary files a/packages/artinchip/lvgl-ui/aic_widgets/aic_canvas/libaic_canvas_v8_e907f.a and b/packages/artinchip/lvgl-ui/aic_widgets/aic_canvas/libaic_canvas_v8_e907f.a differ diff --git a/t3e-pro标准版_v1.0.8.zip b/t3e-pro标准版_v1.0.8.zip new file mode 100644 index 00000000..968c1101 Binary files /dev/null and b/t3e-pro标准版_v1.0.8.zip differ diff --git a/target/configs/d12x_t3e-pro_rt-thread_t3e-pro_defconfig b/target/configs/d12x_t3e-pro_rt-thread_t3e-pro_defconfig index db25f83a..3e7fe8b3 100644 --- a/target/configs/d12x_t3e-pro_rt-thread_t3e-pro_defconfig +++ b/target/configs/d12x_t3e-pro_rt-thread_t3e-pro_defconfig @@ -253,7 +253,7 @@ CONFIG_AIC_USING_I2C0=y # # CONFIG_AIC_DEV_I2C0_ADDR_BIT is not set CONFIG_AIC_DEV_I2C0_10BIT=0 -CONFIG_AIC_DEV_I2C0_SPEED=400000 +CONFIG_AIC_DEV_I2C0_SPEED=200000 # CONFIG_AIC_DEV_I2C0_BUS_MODE is not set CONFIG_AIC_DEV_I2C0_SLAVE_MODE=0 CONFIG_AIC_USING_PWM0=y diff --git a/target/d12x/t3e-pro/pack/.image_cfg.json.tmp b/target/d12x/t3e-pro/pack/.image_cfg.json.tmp index 75cc1ef2..5faa996d 100644 --- a/target/d12x/t3e-pro/pack/.image_cfg.json.tmp +++ b/target/d12x/t3e-pro/pack/.image_cfg.json.tmp @@ -15,7 +15,7 @@ "info": { // Header information about image "platform": "d12x", "product": "t3e-pro", - "version": "1.0.7", + "version": "1.0.8", "media": { "type": "spi-nor", "device_id": 0, diff --git a/target/d12x/t3e-pro/pack/bootloader.bin b/target/d12x/t3e-pro/pack/bootloader.bin index 9bcf5fd4..1b343c1b 100644 Binary files a/target/d12x/t3e-pro/pack/bootloader.bin and b/target/d12x/t3e-pro/pack/bootloader.bin differ diff --git a/target/d12x/t3e-pro/pack/image_cfg.json b/target/d12x/t3e-pro/pack/image_cfg.json index fbf7c2af..a4c86eb9 100644 --- a/target/d12x/t3e-pro/pack/image_cfg.json +++ b/target/d12x/t3e-pro/pack/image_cfg.json @@ -15,7 +15,7 @@ "info": { // Header information about image "platform": "d12x", "product": "t3e-pro", - "version": "1.0.7", + "version": "1.0.8", "media": { "type": "spi-nor", "device_id": 0, diff --git a/target/d12x/t3e-pro/pinmux.c b/target/d12x/t3e-pro/pinmux.c index 5793b032..5685b760 100644 --- a/target/d12x/t3e-pro/pinmux.c +++ b/target/d12x/t3e-pro/pinmux.c @@ -52,7 +52,7 @@ struct aic_pinmux aic_pinmux_config[] = { #endif #ifdef AIC_USING_CTP {1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_RST_PIN}, - {1, PIN_PULL_UP, 3, AIC_TOUCH_PANEL_INT_PIN},//硬件没贴上拉电阻 芯片的上拉打开 + {1, PIN_PULL_DIS, 3, AIC_TOUCH_PANEL_INT_PIN},//硬件没贴上拉电阻 芯片的上拉打开 #endif #if defined(AIC_USING_QSPI0) && !defined(AIC_SYSCFG_SIP_FLASH_ENABLE) /* qspi0 */ diff --git a/tools/env/tools/ConEmu/ConEmu.xml b/tools/env/tools/ConEmu/ConEmu.xml index 27a86b45..d7440bda 100644 --- a/tools/env/tools/ConEmu/ConEmu.xml +++ b/tools/env/tools/ConEmu/ConEmu.xml @@ -1,7 +1,7 @@ - + @@ -259,8 +259,8 @@ - - + + diff --git a/tools/env/tools/ConEmu/ConEmu/clink/profile/.history b/tools/env/tools/ConEmu/ConEmu/clink/profile/.history index fe254214..b0ee1854 100644 --- a/tools/env/tools/ConEmu/ConEmu/clink/profile/.history +++ b/tools/env/tools/ConEmu/ConEmu/clink/profile/.history @@ -201,3 +201,15 @@ me me bm me +list +lunch 3 +bm +me +me +bm +me +bm +me +me +bm +me