drivers/serial/serial.c: Call pm_activity() when characters are received on a console device.
This commit is contained in:
parent
63276899bf
commit
f992fd9f51
@ -11,6 +11,22 @@ config DEV_LOWCONSOLE
|
||||
---help---
|
||||
Use the simple, low-level, write-only serial console driver (minimal support)
|
||||
|
||||
config SERIAL_PM_ACTIVITY_DOMAIN
|
||||
int "PM activity domain"
|
||||
default 0
|
||||
depends on PM
|
||||
---help---
|
||||
When characters are received on a console device, pm_activity()
|
||||
will be called with this PM domain
|
||||
|
||||
config SERIAL_PM_ACTIVITY_PRIORITY
|
||||
int "PM activity priority when reive character"
|
||||
default 6
|
||||
depends on PM
|
||||
---help---
|
||||
When characters are received on a console device, pm_activity()
|
||||
will be called with this PM priority
|
||||
|
||||
config SERIAL_REMOVABLE
|
||||
bool
|
||||
default n
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/serial/serial.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/power/pm.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -1687,6 +1688,16 @@ void uart_datareceived(FAR uart_dev_t *dev)
|
||||
/* Notify all poll/select waiters that they can read from the recv buffer */
|
||||
|
||||
uart_pollnotify(dev, POLLIN);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Call pm_activity when characters are received on the console device */
|
||||
|
||||
if (dev->isconsole)
|
||||
{
|
||||
pm_activity(CONFIG_SERIAL_PM_ACTIVITY_DOMAIN,
|
||||
CONFIG_SERIAL_PM_ACTIVITY_PRIORITY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user