From 821677bad621d83166e578a7436283bc3259c860 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Sun, 30 Aug 2020 15:24:44 +0200 Subject: [PATCH] [ext] Add local config inclusion for FreeRTOS --- ext/aws/FreeRTOSConfig.h.in | 5 ++++- ext/aws/FreeRTOSIPConfig.h.in | 5 +++++ ext/aws/module.lb | 26 +++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ext/aws/FreeRTOSConfig.h.in b/ext/aws/FreeRTOSConfig.h.in index 9776cf217c..a7afbd7059 100644 --- a/ext/aws/FreeRTOSConfig.h.in +++ b/ext/aws/FreeRTOSConfig.h.in @@ -141,7 +141,10 @@ standard names. */ #define vPortSVCHandler SVC_Handler #define xPortSysTickHandler SysTick_Handler -/* A header file that defines trace macro can be included here. */ +/* A header file that overwrites with local project settings. */ +#if __has_include() +#include +#endif #endif /* FREERTOS_CONFIG_H */ diff --git a/ext/aws/FreeRTOSIPConfig.h.in b/ext/aws/FreeRTOSIPConfig.h.in index a6110ee019..1615f195ec 100644 --- a/ext/aws/FreeRTOSIPConfig.h.in +++ b/ext/aws/FreeRTOSIPConfig.h.in @@ -305,4 +305,9 @@ disconnecting stage will timeout after a period of non-activity. */ #define ipconfigZERO_COPY_TX_DRIVER 1 #define ipconfigUSE_LINKED_RX_MESSAGES 1 +/* A header file that overwrites with local project settings. */ +#if __has_include() +#include +#endif + #endif // FREERTOS_IP_CONFIG_H diff --git a/ext/aws/module.lb b/ext/aws/module.lb index 3d42b86bdf..a3058aae5f 100644 --- a/ext/aws/module.lb +++ b/ext/aws/module.lb @@ -14,7 +14,19 @@ class FreeRTOS_TCP(Module): def init(self, module): module.name = "tcp" - module.description = "FreeRTOS-Plus-TCP" + module.description = """ +# a:FreeRTOS-Plus-TCP + +This module defines a default FreeRTOS IP config. If you need to change a +configuration setting, then you can define a `FreeRTOSConfigIPLocal.h` file, which +is included *after* at the end of the config. You must therefore first `#undef` +the config macros, then redefine them with your options, for example: + +```c +#undef ipconfigUSE_DNS +#define ipconfigUSE_DNS 1 +``` +""" def prepare(self, module, options): return True @@ -33,6 +45,18 @@ def init(module): # a:FreeRTOS Amazon FreeRTOS port for modm to be used with via the `modm:processing:rtos` module. + +## Custom Configuration + +This module defines a default FreeRTOS config. If you need to change a +configuration setting, then you can define a `FreeRTOSConfigLocal.h` file, which +is included *after* at the end of the config. You must therefore first `#undef` +the config macros, then redefine them with your options, for example: + +```c +#undef configCHECK_FOR_STACK_OVERFLOW +#define configCHECK_FOR_STACK_OVERFLOW 0 +``` """ def prepare(module, options):