mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
drivers/serial/serial.c: Call pm_activity() when characters are received on a console device.
This commit is contained in:
@@ -11,6 +11,22 @@ config DEV_LOWCONSOLE
|
|||||||
---help---
|
---help---
|
||||||
Use the simple, low-level, write-only serial console driver (minimal support)
|
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
|
config SERIAL_REMOVABLE
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
#include <nuttx/serial/serial.h>
|
#include <nuttx/serial/serial.h>
|
||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
|
#include <nuttx/power/pm.h>
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* 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 */
|
/* Notify all poll/select waiters that they can read from the recv buffer */
|
||||||
|
|
||||||
uart_pollnotify(dev, POLLIN);
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user