[FE training-materials-updates] Kernel labs: replace mdelay() by msleep()

Michael Opdenacker michael.opdenacker at free-electrons.com
Thu Mar 17 14:15:36 CET 2016


Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=ac99f8bf82abbca4055ff49d99944cb272283d39

>---------------------------------------------------------------

commit ac99f8bf82abbca4055ff49d99944cb272283d39
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Thu Mar 17 14:15:36 2016 +0100

    Kernel labs: replace mdelay() by msleep()
    
    - Nicer for the system, tested on Linux 4.5
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


>---------------------------------------------------------------

ac99f8bf82abbca4055ff49d99944cb272283d39
 labs/kernel-i2c-communication/kernel-i2c-communication.tex | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/labs/kernel-i2c-communication/kernel-i2c-communication.tex b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
index f04bc90..772a0e2 100644
--- a/labs/kernel-i2c-communication/kernel-i2c-communication.tex
+++ b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
@@ -212,8 +212,10 @@ In this function:
 
 \begin{enumerate}
 \item Start by putting a \code{10 ms} delay by calling the
-      \code{mdelay()} routine. That's needed to add time between the
-      previous i2c operation and the next one.
+      \code{msleep()} routine\footnote{\code{msleep()} is nicer
+      than \code{mdelay()} because it is not making an active wait, and 
+      instead lets the CPU run other tasks in the meantime.}. That's needed
+      to add time between the previous i2c operation and the next one.
 \item Write \code{0x00} to the bus. That will allow us to read
       the device registers.
 \item Add another \code{10 ms} delay.




More information about the training-materials-updates mailing list