diff --git a/ds18b20.c b/ds18b20.c index 743be2a..c8cb666 100755 --- a/ds18b20.c +++ b/ds18b20.c @@ -26,6 +26,8 @@ int init_DS18B20(void) { unsigned int result; DQ_OUT; + DQ_H; + udelay(2); DQ_L; udelay(480); //480~960 DQ_H; @@ -34,6 +36,7 @@ int init_DS18B20(void) result = DQ_V; udelay(420); DQ_OUT; + DQ_H; printk("ds18b20 init result %d", result); return result; } @@ -96,11 +99,12 @@ void write_char(unsigned char dat) for(i=0; i<8; i++) { DQ_L; + udelay(10); if (dat & 0x01) DQ_H; else DQ_L; - udelay(60); + udelay(50); dat >>= 1; } //spin_unlock(&lock); diff --git a/ds18b20_223.mod.c b/ds18b20_223.mod.c new file mode 100644 index 0000000..ad91d0d --- /dev/null +++ b/ds18b20_223.mod.c @@ -0,0 +1,27 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +__visible struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, + .init = init_module, +#ifdef CONFIG_MODULE_UNLOAD + .exit = cleanup_module, +#endif + .arch = MODULE_ARCH_INIT, +}; + +#ifdef RETPOLINE +MODULE_INFO(retpoline, "Y"); +#endif + +static const char __module_depends[] +__used +__attribute__((section(".modinfo"))) = +"depends="; + + +MODULE_INFO(srcversion, "3C1EE49178DE9599A3E3742"); diff --git a/ds18b20_224.mod.c b/ds18b20_224.mod.c new file mode 100644 index 0000000..0d19538 --- /dev/null +++ b/ds18b20_224.mod.c @@ -0,0 +1,27 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +__visible struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, + .init = init_module, +#ifdef CONFIG_MODULE_UNLOAD + .exit = cleanup_module, +#endif + .arch = MODULE_ARCH_INIT, +}; + +#ifdef RETPOLINE +MODULE_INFO(retpoline, "Y"); +#endif + +static const char __module_depends[] +__used +__attribute__((section(".modinfo"))) = +"depends="; + + +MODULE_INFO(srcversion, "9B05B907F56030A0F0E6D67");