sched/wdog: Don't dynamically allocate wdog_s

to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
This commit is contained in:
Xiang Xiao
2020-08-04 18:31:31 +08:00
committed by patacongo
parent 4df42ba9fb
commit a0ce81d659
666 changed files with 915 additions and 3286 deletions
+2 -12
View File
@@ -894,16 +894,6 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
priv->threshx = 0;
priv->threshy = 0;
/* Create a timer for catching missed pen up conditions */
priv->wdog = wd_create();
if (!priv->wdog)
{
ierr("ERROR: Failed to create a watchdog\n", errno);
nxsem_post(&priv->exclsem);
return -ENOSPC;
}
/* Register the character driver */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
@@ -949,7 +939,7 @@ void stmpe811_tscworker(FAR struct stmpe811_dev_s *priv, uint8_t intsta)
/* Cancel the missing pen up timer */
wd_cancel(priv->wdog);
wd_cancel(&priv->wdog);
/* Check for pen up or down from the TSC_STA bit in STMPE811_TSC_CTRL. */
@@ -1092,7 +1082,7 @@ ignored:
if (priv->sample.contact == CONTACT_DOWN ||
priv->sample.contact == CONTACT_MOVE)
{
wd_start(priv->wdog, STMPE811_PENUP_TICKS,
wd_start(&priv->wdog, STMPE811_PENUP_TICKS,
stmpe811_timeout, 1, (wdparm_t)priv);
}