code simplified and delete some unused
This commit is contained in:
parent
3a6b5d7f4f
commit
e6fa8a2603
|
@ -11,7 +11,6 @@ void TestRTC(int argc,char *argv[])
|
|||
}
|
||||
|
||||
if(argc>1){
|
||||
|
||||
int times = atoi(argv[1]);
|
||||
printf("Time will be printf %d times\n",times);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/**
|
||||
* @file connect_rtc.h
|
||||
* @brief define hc32f4a0-board i2c function and struct
|
||||
* @brief define hc32f4a0-board rtc function and struct
|
||||
* @version 3.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023-02-02
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/**
|
||||
* @file connect_rtc.c
|
||||
* @brief support aiit-riscv64-board rtc function and register to bus framework
|
||||
* @brief support aiit-hc32f4a0-board rtc function and register to bus framework
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023-02-02
|
||||
|
@ -23,14 +23,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
// static int GetWeekDay(int year, int month, int day)
|
||||
// {
|
||||
// /* Magic method to get weekday */
|
||||
// int weekday = (day += month < 3 ? year-- : year - 2,
|
||||
// 23 * month / 9 + day + 4 + year / 4 - year / 100 + year / 400) % 7;
|
||||
// return weekday;
|
||||
// }
|
||||
|
||||
static uint32 RtcConfigure(void *drv, struct BusConfigureInfo *configure_info)
|
||||
{
|
||||
NULL_PARAM_CHECK(drv);
|
||||
|
|
|
@ -25,15 +25,13 @@
|
|||
static uint32 WdtOpen(void *dev)
|
||||
{
|
||||
NULL_PARAM_CHECK(dev);
|
||||
|
||||
struct WdtHardwareDevice *wdt = (struct WdtHardwareDevice *)dev;
|
||||
|
||||
stc_wdt_init_t stcWdtInit;
|
||||
stcWdtInit.u32CountPeriod = WDT_CNT_PERIOD65536;
|
||||
stcWdtInit.u32CountPeriod = WDT_CNT_PERIOD65536;
|
||||
stcWdtInit.u32ClockDiv = WDT_CLK_DIV1024;
|
||||
stcWdtInit.u32RefreshRange = WDT_RANGE_0TO25PCT;
|
||||
stcWdtInit.u32RefreshRange = WDT_RANGE_0TO25PCT;
|
||||
stcWdtInit.u32LPMCount = WDT_LPM_CNT_STOP;
|
||||
stcWdtInit.u32ExceptionType = WDT_EXP_TYPE_RST;
|
||||
stcWdtInit.u32ExceptionType = WDT_EXP_TYPE_RST;
|
||||
(void)WDT_Init(&stcWdtInit);
|
||||
return EOK;
|
||||
}
|
||||
|
@ -43,7 +41,6 @@ static uint32 WdtConfigure(void *drv, struct BusConfigureInfo *args)
|
|||
NULL_PARAM_CHECK(drv);
|
||||
NULL_PARAM_CHECK(args);
|
||||
|
||||
struct WdtDriver *wdt = (struct WdtDriver *)drv;
|
||||
stc_wdt_init_t stcWdtInit;
|
||||
switch (args->configure_cmd)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue