fix: Patch freertos_plus_tcp in VAD example

If a newer freertos-kernel version is used then the build
fails because of the temporary solution in  freertos-plus-tcp
repository. Added a patch file as a workaround until the
fetched amazon-freertos repo's version is updated.

Change-Id: I0995cf0eeb48d1f54e971d3838f437988466af5a
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
diff --git a/examples/vad_an552/ns_side/ext/amazon-freertos/0001-Check-every-defines-separately.patch b/examples/vad_an552/ns_side/ext/amazon-freertos/0001-Check-every-defines-separately.patch
new file mode 100644
index 0000000..ea924b7
--- /dev/null
+++ b/examples/vad_an552/ns_side/ext/amazon-freertos/0001-Check-every-defines-separately.patch
@@ -0,0 +1,43 @@
+From ec070d022985a460e81ea79ba29251fac257d0c7 Mon Sep 17 00:00:00 2001
+From: Bence Balogh <bence.balogh@arm.com>
+Date: Tue, 21 Mar 2023 11:41:54 +0100
+Subject: [PATCH 1/1] Check every defines separately
+
+The temporary solution caused problems with newer
+freertos-kernel versions.
+
+Signed-off-by: Bence Balogh <bence.balogh@arm.com>
+---
+ include/FreeRTOS_IP.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/include/FreeRTOS_IP.h b/include/FreeRTOS_IP.h
+index 3354d6a..0f22589 100644
+--- a/libraries/freertos_plus/standard/freertos_plus_tcp/include/FreeRTOS_IP.h
++++ b/libraries/freertos_plus/standard/freertos_plus_tcp/include/FreeRTOS_IP.h
+@@ -274,12 +274,21 @@
+     #define pdMS_TO_MIN_TICKS( xTimeInMs )    ipMS_TO_MIN_TICKS( xTimeInMs )
+ 
+     #ifndef pdTRUE_SIGNED
+-        /* Temporary solution: eventually the defines below will appear in 'Source\include\projdefs.h' */
+         #define pdTRUE_SIGNED       pdTRUE
++    #endif
++    #ifndef pdFALSE_SIGNED
+         #define pdFALSE_SIGNED      pdFALSE
++    #endif
++    #ifndef pdTRUE_UNSIGNED
+         #define pdTRUE_UNSIGNED     ( 1U )
++    #endif
++    #ifndef pdFALSE_UNSIGNED
+         #define pdFALSE_UNSIGNED    ( 0U )
++    #endif
++    #ifndef ipTRUE_BOOL
+         #define ipTRUE_BOOL         ( 1 == 1 )
++    #endif
++    #ifndef ipFALSE_BOOL
+         #define ipFALSE_BOOL        ( 1 == 2 )
+     #endif
+ 
+-- 
+2.25.1
+
diff --git a/examples/vad_an552/ns_side/ext/amazon-freertos/CMakeLists.txt b/examples/vad_an552/ns_side/ext/amazon-freertos/CMakeLists.txt
index f240d32..1150b1e 100644
--- a/examples/vad_an552/ns_side/ext/amazon-freertos/CMakeLists.txt
+++ b/examples/vad_an552/ns_side/ext/amazon-freertos/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -14,6 +14,7 @@
 
 if ("${AMAZON_FREERTOS_SRC_PATH}" STREQUAL "DOWNLOAD")
     find_package(Git)
+    file(GLOB PATCH_FILES *.patch)
 
     FetchContent_Declare(amazon_freertos
         GIT_REPOSITORY https://github.com/aws/amazon-freertos.git
@@ -24,6 +25,7 @@
                         libraries/abstractions/backoff_algorithm
                         libraries/abstractions/pkcs11/corePKCS11
                         libraries/3rdparty/mbedtls"
+        PATCH_COMMAND ${GIT_EXECUTABLE} apply ${PATCH_FILES}
     )
     FetchContent_GetProperties(amazon_freertos)
     if (NOT amazon_freertos)