当前位置:首页>Linux>Linux设备驱动 -- DHT11驱动

Linux设备驱动 -- DHT11驱动

  • 2026-03-27 10:25:06
Linux设备驱动 -- DHT11驱动

DHT11

dht11和ds18b20很类似,都是使用单总线通信的。

3种编程实现方式:

  • 查询方式,直接操作gpio,时序通过延时等待实现等
  • 中断方式,通过设置双边沿触发中断,获取时序中高低电平时间,根据时间来判定解析时序
  • 使用内核自带dht11驱动

对于dht11的工作原理,参考别人文章即可:https://blog.csdn.net/qq_44981039/article/details/110185982

驱动实现

野火imx6ull开发板原理图

设备树编写

根节点下添加:dht11

dht11 {
    compatible = "xgj,dht11";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ds18b20>;
    dht11-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; 
    status = "okay"
}

iomuxc节点下添加:

/*ds18b20*/
    pinctrl_ds18b20: ds18b20grp {
        fsl,pins = <
            MX6UL_PAD_GPIO1_IO02__GPIO1_IO02    0x10b0
        >;
    }; 

  • dht11和ds18b20使用的是同一个引脚

设备树编译:

ares@ubuntu:~/work/ebf_linux_kernel-ebf_4.19.35_imx6ul$ cat make_dtb.sh
#!/bin/sh

make ARCH=arm -j4 CROSS_COMPILE=arm-linux-gnueabihf- dtbs

将设备树拷贝系统目录:

debian@npi:~/nfs_root/driver$ cat cp_dtb_to_linux.sh
#!/bin/sh

sudo cp imx6ull-mmc-npi.dtb /usr/lib/linux-image-4.19.35-carp-imx6/
  • /usr/lib/linux-image-4.19.35-carp-imx6/  ,系统存放设备树的目录

重启系统设备树生效:

sudo reboot

驱动编写

typedefunsignedcharuint8_t;

#define DEV_DTS_NODE_PATH    "/dht11"/* 设备树节点的路径,在根节点下 */
#define DEV_PIN_DTS_NAME     "dht11-gpios"/* GPIO引脚的属性名 */
#define DEV_NAME             "dht11"/* 设备名  /dev/dht11 */
#define DEV_DTS_COMPATIBLE   "xgj,dht11"/* 设备匹配属性 compatible */

#define DHT11_PIN               dht11_dev.gpio
#define DHT11_IO_OUT()          gpio_direction_output(DHT11_PIN, 1);
#define DHT11_IO_IN()           gpio_direction_input(DHT11_PIN)
#define DHT11_WRITE(bit)        gpio_set_value(DHT11_PIN, bit)
#define DHT11_READ()            gpio_get_value(DHT11_PIN)

structdht11 {
int gpio;                       /* gpio */
int irq;
dev_t dev_no;                   /* 设备号 */
structcdevchrdev;
structclass *class;
spinlock_t lock;
};
staticintdht11_wait_for_ready(void)
{   
int timeout;

    timeout = 400;
while (DHT11_READ() && timeout)      /* 等待低电平到来 */
    {
        udelay(1);
        --timeout;
    }
if (!timeout) 
    {
        printk("timeout %d\n", __LINE__);
return-1;    /* 超时 */
    }

    timeout = 1000;
while (!DHT11_READ() && timeout)      /* 等待高电平到来    */
    {
        udelay(1);
        --timeout;
    }
if (!timeout) 
    {
        printk("timeout %d\n", __LINE__);
return-1;    /* 超时 */
    }

    timeout = 1000;
while (DHT11_READ() && timeout)  /* 等待高电平结束 */
    {
        udelay(1);
        --timeout;
    }
if (!timeout) 
    {
        printk("timeout %d\n", __LINE__);
return-1;    /* 超时 */
    }

return0;
}

staticintdht11_start(void)
{
    DHT11_IO_OUT();
    DHT11_WRITE(0);
    mdelay(20);
    DHT11_WRITE(1);
    udelay(30);
    DHT11_IO_IN();          /* 设置为输入 */
    udelay(2);

if (dht11_wait_for_ready()) return-1;
return0;
}

staticintdht11_read_byte(unsignedchar *byte)
{
unsignedchar i;
unsignedchar bit = 0;
unsignedchar data = 0;
int timeout = 0;   

for (i = 0; i < 8; i++)
    {
        timeout = 1000;  
while (DHT11_READ() && timeout)   /* 等待变为低电平 */
        {
            udelay(1);
            --timeout;
        }
if (!timeout) 
        {
            printk("timeout %d\n", __LINE__);         
return-1;           /* 超时 */
        }

        timeout = 1000;
while (!DHT11_READ() && timeout)    /* 等待变为高电平 */
        {
            udelay(1);
            --timeout;
        }
if (!timeout) 
        {
            printk("timeout %d\n", __LINE__);
return-1;           /* 超时 */
        }
        udelay(40);

        bit = DHT11_READ();

        data <<= 1;            
if (bit) 
        {
            data |= 0x01;
#if 0
            timeout = 1000;
while (DHT11_READ() && timeout)    /* 等待高电平结束 */
            {
                udelay(1);
                --timeout;
            }
if (!timeout) 
            {
                printk("timeout %d\n", __LINE__);
return-1;           /* 超时 */
            }
#endif
        }
// data <<= 1;          /* 导致错误的原因 : 移位要放前面,不能放在这里,若放在后面一旦获取最后一个位就会多移动一位导致数据不对 */
    }

    *byte = data;
return0;
}
  • 这部分就是驱动dht11的代码,和单片机下驱动没有什么区别。
  • 在编写读取一个字节的函数时出现谬误 : data <<= 1,数据移位,不能放到最后,移位要放前面,不能放在这里,若放在后面一旦获取最后一个位就会多移动一位导致数据不对,该谬误导致调试了挺久,开始还以为时序有问题一直检查时序。。。

dht11驱动跟内核框架有关的部分:

/* 使设备只能被一个进程打开 */
staticint _drv_open (struct inode *node, struct file *file)   
{
    printk("dht11 open\n");
return0;
}

staticssize_t _drv_read(struct file *filp, char __user *buf, size_t size, loff_t *offset)
{
int ret;
int i;
unsignedchar data[5] = {0};
unsignedlong flags;

if (size != 5return -EINVAL;

/* 关闭中断,防止时序被中断破坏 */
    spin_lock_irqsave(&dht11_dev.lock, flags);

/* 启动信号 */
if (dht11_start() != 0)
    {
        printk("dht11 start failed\n");
        ret = -EFAULT;
goto failed1;
    }

/* 读出5字节数据 */
for (i = 0; i < 5; i++)    
    {
if (dht11_read_byte(&data[i]))
        {
            printk("read data err\n");
            ret = -EAGAIN;
goto failed1;
        }
    }

/* 打开中断 */
    spin_unlock_irqrestore(&dht11_dev.lock, flags);
/* 校验数据 */
if (data[4] != (data[0]+data[1]+data[2]+data[3]))
    {
        printk("check data failed\n");
        ret = -EAGAIN;
goto failed1;
    }

/* 将数据拷贝回用户空间 */
if (copy_to_user(buf, data, 5)) 
    {
        ret = -EFAULT;
    } 
else
    {
        ret = 5;
    }

return ret;
failed1:
    spin_unlock_irqrestore(&dht11_dev.lock, flags);
return ret;
}

staticint _drv_release(struct inode *node, struct file *file)
{
    printk("dht11 release\n");
return0;
}

staticstructfile_operationsdrv_file_ops = { 
    .owner    = THIS_MODULE,
    .open   = _drv_open,
    .read   = _drv_read,
    .release = _drv_release,
};

/* 设备树的匹配列表 */
staticstructof_device_iddts_match_table[] = {
    {.compatible = DEV_DTS_COMPATIBLE, },                     /* 通过设备树来匹配 */
};

staticint _driver_probe(struct platform_device *pdev)

int err;
structdevice *ds_dev;
structdevice_node *dev_node;

structdevice_node *node = pdev->dev.of_node;

if (!node) {          
        printk("hc-sr501 dts node can not found!\r\n");    
return -EINVAL; 
    }

    dev_node = of_find_node_by_path(DEV_DTS_NODE_PATH);       /* 找到dht11的设备树节点  */
if (IS_ERR(dev_node)) {          
        printk("dht11 DTS Node not found!\r\n"); 
return PTR_ERR(dev_node); 
    }

    dht11_dev.gpio = of_get_named_gpio(dev_node, DEV_PIN_DTS_NAME, 0);   /* 获取dht11的gpio编号 */
if ( dht11_dev.gpio < 0) {
        printk("dht11-gpio not found!\r\n"); 
return -EINVAL;
    }

    err = gpio_request(dht11_dev.gpio, DEV_PIN_DTS_NAME);  
if(err) 
    {
        printk("gpio_request gpio is failed!\n");
return -EINVAL;
    }

    printk("dht11 gpio %d\n", dht11_dev.gpio);

/* 内核自动分配设备号 */
    err = alloc_chrdev_region(&dht11_dev.dev_no, 01, DEV_NAME);        
if (err < 0) {
        pr_err("Error: failed to register mbochs_dev, err: %d\n", err);
goto failed3;
    }

    cdev_init(&dht11_dev.chrdev, &drv_file_ops);

    cdev_add(&dht11_dev.chrdev, dht11_dev.dev_no, 1);

    dht11_dev.class = class_create(THIS_MODULE, DEV_NAME);
if (IS_ERR(dht11_dev.class)) {   
        err = PTR_ERR(dht11_dev.class);
goto failed1;
    }

/* 创建设备节点 */
    ds_dev = device_create(dht11_dev.class , NULL, dht11_dev.dev_no, NULL, DEV_NAME); 
if (IS_ERR(ds_dev)) {       /* 判断指针是否合法 */
        err = PTR_ERR(ds_dev);
goto failed2;
    }

    spin_lock_init(&dht11_dev.lock);          /* 初始化自旋锁 */
    printk("dht11 probe success\r\n");
return0;
failed2:
    device_destroy(dht11_dev.class, dht11_dev.dev_no);
    class_destroy(dht11_dev.class);
failed1:
    unregister_chrdev_region(dht11_dev.dev_no, 1);
    cdev_del(&dht11_dev.chrdev);
failed3:
    gpio_free(dht11_dev.gpio);
return err;
}

staticint _driver_remove(struct platform_device *pdev)
{
    device_destroy(dht11_dev.class, dht11_dev.dev_no);
    class_destroy(dht11_dev.class);
    unregister_chrdev_region(dht11_dev.dev_no, 1);
    cdev_del(&dht11_dev.chrdev);
    gpio_free(dht11_dev.gpio);

    printk(KERN_INFO"dht11 remove success\n");

return0;
}

staticstructplatform_driver _platform_driver = {
      .probe = _driver_probe,
      .remove = _driver_remove,
      .driver = {
        .name = DEV_DTS_COMPATIBLE,
        .owner = THIS_MODULE,
        .of_match_table = dts_match_table,         /* 通过设备树匹配 */
      },
};

/* 入口函数 */
staticint __init _driver_init(void)
{
int ret;
    printk("dht11 %s\n", __FUNCTION__);

    ret = platform_driver_register(&_platform_driver);   //注册platform驱动
return ret;
}

/*  出口函数 */
staticvoid __exit _driver_exit(void)
{
    printk("dht11  %s\n", __FUNCTION__);
    platform_driver_unregister(&_platform_driver);
}

module_init(_driver_init);
module_exit(_driver_exit);

MODULE_AUTHOR("Ares");
MODULE_LICENSE("GPL");

测试程序

#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdio.h>
#include<string.h>
#include<sys/ioctl.h>
#include<poll.h>
#include<stdint.h>

#define DEV_NAME   "/dev/dht11"

voidsleep_ms(unsignedint ms)
{
structtimevaldelay;
    delay.tv_sec = 0;
    delay.tv_usec = ms * 1000
    select(0NULLNULLNULL, &delay);
}

intmain(int argc, char **argv)
{
int fd;
int ret;

structpollfdfds[1];

/* 2. 打开文件 */
    fd = open(DEV_NAME, O_RDWR);   // | O_NONBLOCK

if (fd < 0)
    {
printf("can not open file %s, %d\n", DEV_NAME, fd);
return-1;
    }

uint8_t dht11_data[5];
while (1)
    {
if ((ret = read(fd, dht11_data, sizeof(dht11_data))) == sizeof(dht11_data))
        {
printf("temp %d.%d  humi %d.%d\r\n", dht11_data[2], dht11_data[3], dht11_data[0], dht11_data[1]);  
        }
else
        {
printf("get temp err %d\r\n", ret);
        }
        sleep_ms(500);   
    }
}

中断方式

通过编写调试发现通过中断方式很难实现,由于linux的非实时性,中断会丢失,会导致时序不对。

内核中自带的dht11驱动使用IIO子系统实现

drivers/iio/humidity/dht11.c

内核配置:

编写设备树参考Documentation\devicetree\bindings\iio\humidity\dht11.txt

* DHT11 humidity/temperature sensor(and compatibles like DHT22)

Required properties:
  - compatible: Should be "dht11"
  - gpios: Should specify the GPIO connected to the sensor's data
    line, see "gpios property" in
    Documentation/devicetree/bindings/gpio/gpio.txt.

Example:

humidity_sensor {
    compatible = "dht11";
    gpios = <&gpio0 60>;
}
  • 若要使用内核dht11驱动,只要在设备树中添加compatible = "dht11"
  • gpios ,设置传感器的单总线的通信引脚

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 16:46:13 HTTP/2.0 GET : https://f.mffb.com.cn/a/482216.html
  2. 运行时间 : 0.090348s [ 吞吐率:11.07req/s ] 内存消耗:4,480.96kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=4b47beddf574a69f09ed642530074708
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000549s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000826s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001486s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000736s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000474s ]
  6. SELECT * FROM `set` [ RunTime:0.001232s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000640s ]
  8. SELECT * FROM `article` WHERE `id` = 482216 LIMIT 1 [ RunTime:0.001235s ]
  9. UPDATE `article` SET `lasttime` = 1774601173 WHERE `id` = 482216 [ RunTime:0.010620s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000296s ]
  11. SELECT * FROM `article` WHERE `id` < 482216 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000514s ]
  12. SELECT * FROM `article` WHERE `id` > 482216 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000394s ]
  13. SELECT * FROM `article` WHERE `id` < 482216 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004482s ]
  14. SELECT * FROM `article` WHERE `id` < 482216 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000915s ]
  15. SELECT * FROM `article` WHERE `id` < 482216 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000658s ]
0.091982s