sync the upstream
This commit is contained in:
@@ -28,14 +28,17 @@ static BusType wdt;
|
||||
*/
|
||||
static void FeedWatchdog(void)
|
||||
{
|
||||
while (1)
|
||||
int cnt = 0;
|
||||
while (cnt < 20)
|
||||
{
|
||||
/* keep watchdog alive in idle task */
|
||||
struct BusConfigureInfo cfg;
|
||||
cfg.configure_cmd = OPER_WDT_KEEPALIVE;
|
||||
cfg.private_data = NONE;
|
||||
BusDrvConfigure(wdt->owner_driver, &cfg);
|
||||
KPrintf("feed the dog!\n ");
|
||||
KPrintf("feed the dog! cnt %u\n", cnt);
|
||||
cnt++;
|
||||
MdelayKTask(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,18 +49,17 @@ static void FeedWatchdog(void)
|
||||
int TestIwg(void)
|
||||
{
|
||||
x_err_t res = EOK;
|
||||
uint32 timeout = 1000; /* timeout time */
|
||||
uint16 timeout = 1000; /* timeout time */
|
||||
|
||||
wdt = BusFind(WDT_BUS_NAME_0);
|
||||
wdt->owner_driver = BusFindDriver(wdt, WDT_DRIVER_NAME_0);
|
||||
wdt->owner_haldev = BusFindDevice(wdt, WDT_0_DEVICE_NAME_0);
|
||||
wdt = BusFind(WDT_BUS_NAME);
|
||||
wdt->owner_driver = BusFindDriver(wdt, WDT_DRIVER_NAME);
|
||||
wdt->owner_haldev = BusFindDevice(wdt, WDT_DEVICE_NAME);
|
||||
|
||||
/* set watchdog timeout time */
|
||||
struct BusConfigureInfo cfg;
|
||||
cfg.configure_cmd = OPER_WDT_SET_TIMEOUT;
|
||||
cfg.private_data = &timeout;
|
||||
res = BusDrvConfigure(wdt->owner_driver, &cfg);
|
||||
KPrintf("feed the dog!\n");
|
||||
|
||||
int32 WdtTask = KTaskCreate("WdtTask", (void *)FeedWatchdog, NONE, 2048, 20);
|
||||
res = StartupKTask(WdtTask);
|
||||
|
||||
@@ -68,11 +68,12 @@ void InstallConsole(const char *bus_name, const char *drv_name, const char *dev_
|
||||
BusDevClose(_console);
|
||||
}
|
||||
|
||||
console_bus->match(console_drv, console);
|
||||
|
||||
configure_info.configure_cmd = OPE_INT;
|
||||
memset(&serial_cfg, 0, sizeof(struct SerialCfgParam));
|
||||
configure_info.private_data = &serial_cfg;
|
||||
BusDrvConfigure(console_drv, &configure_info);
|
||||
console_bus->match(console_drv, console);
|
||||
|
||||
serial_dev_param = (struct SerialDevParam *)console->private_data;
|
||||
serial_dev_param->serial_set_mode = 0;
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#include "connect_usb.h"
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_WDT
|
||||
#include "connect_wdt.h"
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_USER_MAIN
|
||||
#ifndef MAIN_KTASK_STACK_SIZE
|
||||
#define MAIN_KTASK_STACK_SIZE 2048
|
||||
@@ -242,6 +246,10 @@ extern int InitUserspace(void);
|
||||
HwLockSpinlock(&AssignSpinLock);
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_WDT
|
||||
StartWatchdog();
|
||||
#endif
|
||||
|
||||
StartupOsAssign();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -96,7 +96,6 @@ static x_err_t _MsgQueueSend(struct MsgQueue *mq,
|
||||
|
||||
tick_delta = 0;
|
||||
task = GetKTaskDescriptor();
|
||||
|
||||
if(WAITING_FOREVER == msec)
|
||||
timeout = WAITING_FOREVER;
|
||||
else
|
||||
|
||||
@@ -94,12 +94,10 @@ static int32 _SemaphoreObtain(struct Semaphore *sem, int32 msec)
|
||||
struct TaskDescriptor *task = NONE;
|
||||
|
||||
NULL_PARAM_CHECK(sem);
|
||||
|
||||
if(WAITING_FOREVER == msec)
|
||||
wait_time = WAITING_FOREVER;
|
||||
else
|
||||
wait_time = CalculteTickFromTimeMs(msec);
|
||||
|
||||
lock = CriticalAreaLock();
|
||||
|
||||
SYS_KDEBUG_LOG(KDBG_IPC, ("obtain semaphore: id %d, value %d, by task %s\n",
|
||||
|
||||
Reference in New Issue
Block a user