Browse Source

1307注册代码注释

master
sc 1 month ago
parent
commit
f740550370
  1. 14
      drivers/drv_ds1307.c

14
drivers/drv_ds1307.c

@ -27,7 +27,7 @@
#include <rtdevice.h>
#include <rtthread.h>
#include <sys/time.h>
#include <drivers/rtc.h>
#define DBG_TAG "DS1307"
#ifdef BRD_RTC_DS1307_DEBUG
@ -215,7 +215,7 @@ static rt_err_t ds1307_write_tm(struct tm *tm)
return err;
}
/* RTC ops */
/* RTC ops *//*
static rt_err_t ds1307_rtc_init(void)
{
return RT_EOK;
@ -272,9 +272,9 @@ static const struct rt_rtc_ops ds1307_rtc_ops =
RT_NULL,
ds1307_rtc_get_timeval,
ds1307_rtc_set_timeval,
};
};*/
static rt_rtc_dev_t ds1307_rtc_dev;
//static rt_rtc_dev_t ds1307_rtc_dev;
/* Initialization and registration */
static int rt_hw_ds1307_rtc_init(void)
@ -297,12 +297,12 @@ static int rt_hw_ds1307_rtc_init(void)
rt_thread_startup(ds1307.thd_soft_update_sec);
}
rt_err_t result = rt_hw_rtc_register(&ds1307_rtc_dev, "ds1307", RT_DEVICE_FLAG_RDWR, &ds1307);
/* rt_err_t result = rt_hw_rtc_register(&ds1307_rtc_dev, "ds1307", RT_DEVICE_FLAG_RDWR, &ds1307);
if (result != RT_EOK)
{
LOG_E("RTC register failed: %d", result);
return result;
}
}*/
LOG_I("DS1307 RTC initialized successfully on %s", ds1307.iic_name);
return RT_EOK;
@ -359,4 +359,4 @@ void date_drv(void)
}
MSH_CMD_EXPORT(date_drv, Read DS1307 RTC time);
/* BRD_RTC_DS1307 */
/* BRD_RTC_DS1307 */

Loading…
Cancel
Save