From b3d2a32e11dfc248c4052bb5caa7dc26647efe0c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 27 Oct 2019 08:52:59 +0000 Subject: [PATCH] Fixed small problem in OSLIB cache object. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13147 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/oslib/src/chobjcaches.c | 8 ++++---- testhal/STM32/multi/USB_CDC/.project | 5 +++++ ...B_CDC (Select ELF file)(OpenOCD, Flash and Run).launch | 4 ++-- testhal/STM32/multi/USB_CDC/make/stm32h743_nucleo144.make | 2 +- testhal/STM32/multi/USB_CDC/make/stm32l4r5_nucleo144.make | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/os/oslib/src/chobjcaches.c b/os/oslib/src/chobjcaches.c index 860ba7542..bbe467bcb 100644 --- a/os/oslib/src/chobjcaches.c +++ b/os/oslib/src/chobjcaches.c @@ -311,11 +311,11 @@ oc_object_t *chCacheGetObject(objects_cache_t *ocp, /* Checking the cache for a hit.*/ objp = hash_get_s(ocp, group, key); - - chDbgAssert((objp->obj_flags & OC_FLAG_INHASH) == OC_FLAG_INHASH, - "not in hash"); - if (objp != NULL) { + + chDbgAssert((objp->obj_flags & OC_FLAG_INHASH) == OC_FLAG_INHASH, + "not in hash"); + /* Cache hit, checking if the buffer is owned by some other thread.*/ if (chSemGetCounterI(&objp->obj_sem) > (cnt_t)0) { diff --git a/testhal/STM32/multi/USB_CDC/.project b/testhal/STM32/multi/USB_CDC/.project index d2ce0172b..f3803a1ed 100644 --- a/testhal/STM32/multi/USB_CDC/.project +++ b/testhal/STM32/multi/USB_CDC/.project @@ -81,5 +81,10 @@ 2 CHIBIOS/os + + test + 2 + CHIBIOS/test + diff --git a/testhal/STM32/multi/USB_CDC/debug/STM32-USB_CDC (Select ELF file)(OpenOCD, Flash and Run).launch b/testhal/STM32/multi/USB_CDC/debug/STM32-USB_CDC (Select ELF file)(OpenOCD, Flash and Run).launch index ce12c6a3d..aaa1e1857 100644 --- a/testhal/STM32/multi/USB_CDC/debug/STM32-USB_CDC (Select ELF file)(OpenOCD, Flash and Run).launch +++ b/testhal/STM32/multi/USB_CDC/debug/STM32-USB_CDC (Select ELF file)(OpenOCD, Flash and Run).launch @@ -33,9 +33,9 @@ - + - + diff --git a/testhal/STM32/multi/USB_CDC/make/stm32h743_nucleo144.make b/testhal/STM32/multi/USB_CDC/make/stm32h743_nucleo144.make index 06e63fbdb..a73e64220 100644 --- a/testhal/STM32/multi/USB_CDC/make/stm32h743_nucleo144.make +++ b/testhal/STM32/multi/USB_CDC/make/stm32h743_nucleo144.make @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). diff --git a/testhal/STM32/multi/USB_CDC/make/stm32l4r5_nucleo144.make b/testhal/STM32/multi/USB_CDC/make/stm32l4r5_nucleo144.make index 4550e132b..a077795d5 100644 --- a/testhal/STM32/multi/USB_CDC/make/stm32l4r5_nucleo144.make +++ b/testhal/STM32/multi/USB_CDC/make/stm32l4r5_nucleo144.make @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT).