From c699613cdc358275c97074de7163fd66439dbda3 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 6 Jul 2022 08:36:40 +0000 Subject: [PATCH] Made sioStopOperation() and sioStartOperation() call possible in both SIO_READY and SIO_ACTIVE states. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15677 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/src/hal_sio.c | 9 ++++++--- readme.txt | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/os/hal/src/hal_sio.c b/os/hal/src/hal_sio.c index fc303af5e..57ac3e43d 100644 --- a/os/hal/src/hal_sio.c +++ b/os/hal/src/hal_sio.c @@ -309,7 +309,8 @@ void sioStartOperation(SIODriver *siop, const SIOOperation *operation) { osalSysLock(); - osalDbgAssert(siop->state == SIO_READY, "invalid state"); + osalDbgAssert((siop->state == SIO_READY) || + (siop->state == SIO_ACTIVE), "invalid state"); /* The application can pass NULL if it is not interested in callbacks, attaching a default operation structure.*/ @@ -319,9 +320,11 @@ void sioStartOperation(SIODriver *siop, const SIOOperation *operation) { else { siop->operation = &default_operation; } - siop->state = SIO_ACTIVE; - sio_lld_start_operation(siop); + if (siop->state == SIO_READY) { + sio_lld_start_operation(siop); + siop->state = SIO_ACTIVE; + } osalSysUnlock(); } diff --git a/readme.txt b/readme.txt index 5fe83884d..a694d6d97 100644 --- a/readme.txt +++ b/readme.txt @@ -74,7 +74,8 @@ ***************************************************************************** *** Next *** -- NEW: Made sioStopOperation() call possible in SIO_READY state. +- NEW: Made sioStopOperation() and sioStartOperation() call possible in + both SIO_READY and SIO_ACTIVE states. - NEW: Non-proprietary LLVM build support. - NEW: Added palReadGroupLatch() to PAL driver. - NEW: Added a Posix-favored shell named "msh" (Mini Shell). The shell is able