YuuichiNakamura commented on a change in pull request #1377: URL: https://github.com/apache/incubator-nuttx/pull/1377#discussion_r493667049
########## File path: drivers/note/noteram_driver.c ########## @@ -326,6 +395,24 @@ static ssize_t noteram_size(void) return notelen; } +/**************************************************************************** + * Name: noteram_open + ****************************************************************************/ + +static int noteram_open(FAR struct file *filep) +{ + irqstate_t flags; + + flags = enter_critical_section(); + + /* Reset the read index of the circular buffer */ + + g_noteram_info.ni_read = g_noteram_info.ni_tail; Review comment: It doesn't lose the information. Just rewinding the read pointer. Previously the tail pointer of the circular buffer goes forward in noteram_get(). The data in the circular buffer could be read from /dev/note only once. I have added new read pointer and made it to use instead of tail pointer in noteram_get(). So when we reopen /dev/note, we can get the same data. The tail pointer is modified only when an overwrite in the circular buffer occurs. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org